Commit e2b82098 authored by Kris Zyp's avatar Kris Zyp Committed by Howard Chu
Browse files

ITS#9618 fix Windows WRITEMAP flush

Revert back to using standard FlushViewOfFile/FlushFileBuffers
to sync data with WRITEMAP mode on Windows
parent 52836cdb
...@@ -3008,9 +3008,9 @@ mdb_env_sync0(MDB_env *env, int force, pgno_t numpgs) ...@@ -3008,9 +3008,9 @@ mdb_env_sync0(MDB_env *env, int force, pgno_t numpgs)
int rc = 0; int rc = 0;
if (env->me_flags & MDB_RDONLY) if (env->me_flags & MDB_RDONLY)
return EACCES; return EACCES;
if (force if (force || !(env->me_flags & MDB_NOSYNC)
#ifndef _WIN32 /* Sync is normally achieved in Windows by doing WRITE_THROUGH writes */ #ifdef _WIN32 /* Sync is normally achieved in Windows by doing WRITE_THROUGH writes */
|| !(env->me_flags & MDB_NOSYNC) && (env->me_flags & MDB_WRITEMAP)
#endif #endif
) { ) {
if (env->me_flags & MDB_WRITEMAP) { if (env->me_flags & MDB_WRITEMAP) {
...@@ -3958,13 +3958,7 @@ mdb_page_flush(MDB_txn *txn, int keep) ...@@ -3958,13 +3958,7 @@ mdb_page_flush(MDB_txn *txn, int keep)
j = i = keep; j = i = keep;
if (env->me_flags & MDB_WRITEMAP if (env->me_flags & MDB_WRITEMAP) {
#ifdef _WIN32
/* In windows, we still do writes to the file (with write-through enabled in sync mode),
* as this is faster than FlushViewOfFile/FlushFileBuffers */
&& (env->me_flags & MDB_NOSYNC)
#endif
) {
goto done; goto done;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment