From a1dffcb5572f36b39ab54b84bab3cd7f1373789b Mon Sep 17 00:00:00 2001 From: chendianqiang Date: Fri, 19 Aug 2022 15:37:56 +0800 Subject: [PATCH] Wait upon write-out of all pages in the specified range not only submitted, so that fsync on the end will be soon --- src/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/config.h b/src/config.h index dafbf15a9..86d7ec960 100644 --- a/src/config.h +++ b/src/config.h @@ -158,7 +158,7 @@ * the plain fsync() call. */ #if (defined(__linux__) && defined(SYNC_FILE_RANGE_WAIT_BEFORE)) #define HAVE_SYNC_FILE_RANGE 1 -#define rdb_fsync_range(fd,off,size) sync_file_range(fd,off,size,SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE) +#define rdb_fsync_range(fd,off,size) sync_file_range(fd,off,size,SYNC_FILE_RANGE_WAIT_BEFORE|SYNC_FILE_RANGE_WRITE|SYNC_FILE_RANGE_WAIT_AFTER) #elif defined(__APPLE__) #define rdb_fsync_range(fd,off,size) fcntl(fd, F_FULLFSYNC) #else