Skip to content

Commit 2fd67ac

Browse files
RedBeard0531erh
authored andcommitted
Async flush uasserts on windows SERVER-735
1 parent fca1962 commit 2fd67ac

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

util/mmap_win.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,21 +100,20 @@ namespace mongo {
100100
}
101101

102102
void MemoryMappedFile::flush(bool sync) {
103+
uassert(13056, "Async flushing not supported on windows", sync);
104+
103105
if (!view) return;
104106

105-
// Note: this is blocking and ignores sync
106107
bool success = FlushViewOfFile(view, 0); // 0 means whole mapping
107108
if (!success){
108109
int err = GetLastError();
109-
out() << "FlushViewOfFile failed " << err << " " << endl;
110+
out() << "FlushViewOfFile failed " << err << endl;
110111
}
111112

112-
if (sync){
113-
bool success = FlushFileBuffers(fd);
114-
if (!success){
115-
int err = GetLastError();
116-
out() << "FlushFileBuffers failed " << err << " " << endl;
117-
}
113+
success = FlushFileBuffers(fd);
114+
if (!success){
115+
int err = GetLastError();
116+
out() << "FlushFileBuffers failed " << err << endl;
118117
}
119118
}
120119
}

0 commit comments

Comments
 (0)