summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2016-04-04 11:53:29 +1000
committerAlex Gorrod <alexg@wiredtiger.com>2016-04-04 11:53:29 +1000
commitdb105a8b177ffc027624629eeae05007c8ae2967 (patch)
treec2dda5dfc2bb5b8d6d144604a62fb5b560b0a0d3
parent64cb9c809a525573535badd280dfd5c13d2ba6a9 (diff)
downloadmongo-db105a8b177ffc027624629eeae05007c8ae2967.tar.gz
WT-2529 Move an assertion related to fsync and readonly connections.
It is still reasonable to fsync the standard I/O channels in a read only connection.
-rw-r--r--src/include/misc.i2
-rw-r--r--src/os_posix/os_fs.c2
-rw-r--r--src/os_win/os_fs.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/src/include/misc.i b/src/include/misc.i
index a96ce405c89..114b711ac88 100644
--- a/src/include/misc.i
+++ b/src/include/misc.i
@@ -273,8 +273,6 @@ __wt_filesize(WT_SESSION_IMPL *session, WT_FH *fh, wt_off_t *sizep)
static inline int
__wt_fsync(WT_SESSION_IMPL *session, WT_FH *fh, bool block)
{
- WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
-
WT_RET(__wt_verbose(
session, WT_VERB_HANDLEOPS, "%s: handle-sync", fh->name));
diff --git a/src/os_posix/os_fs.c b/src/os_posix/os_fs.c
index 7d3049f6c2d..86aa8db8f4f 100644
--- a/src/os_posix/os_fs.c
+++ b/src/os_posix/os_fs.c
@@ -18,6 +18,8 @@ __posix_sync(WT_SESSION_IMPL *session,
{
WT_DECL_RET;
+ WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
+
#ifdef HAVE_SYNC_FILE_RANGE
if (!block) {
WT_SYSCALL_RETRY(sync_file_range(fd,
diff --git a/src/os_win/os_fs.c b/src/os_win/os_fs.c
index 7f2c797dbe4..462773cb9fb 100644
--- a/src/os_win/os_fs.c
+++ b/src/os_win/os_fs.c
@@ -395,6 +395,8 @@ __win_handle_sync(WT_SESSION_IMPL *session, WT_FH *fh, bool block)
{
WT_DECL_RET;
+ WT_ASSERT(session, !F_ISSET(S2C(session), WT_CONN_READONLY));
+
/*
* We don't open Windows system handles when opening directories
* for flushing, as it is not necessary (or possible) to flush