diff options
author | Keith Bostic <keith@wiredtiger.com> | 2016-03-27 10:50:14 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2016-03-27 10:50:14 -0400 |
commit | 69b26f1f8338eee18fe0abdba43264e4cbfd443f (patch) | |
tree | ad52bfc50da95c91f1cf79755272637185a7075a /src/block | |
parent | 5ea3ffb90fbd27f65e632e8f496f1da569b06434 (diff) | |
download | mongo-69b26f1f8338eee18fe0abdba43264e4cbfd443f.tar.gz |
WT-2330: in-memory configurations should not create on-disk collection files
Remove HAVE_SYNC_FILE_RANGE #ifdef from the block manager and support
ENOTSUP returns up the stack from any underlying asynchronous flush
call. General reworking of block manager's sync code to ignore further
calls whenever ENOTSUP is returned on a handle.
Diffstat (limited to 'src/block')
-rw-r--r-- | src/block/block_mgr.c | 14 | ||||
-rw-r--r-- | src/block/block_open.c | 3 | ||||
-rw-r--r-- | src/block/block_write.c | 11 |
3 files changed, 23 insertions, 5 deletions
diff --git a/src/block/block_mgr.c b/src/block/block_mgr.c index f842fd4d98e..f20bb991ff7 100644 --- a/src/block/block_mgr.c +++ b/src/block/block_mgr.c @@ -413,7 +413,19 @@ __bm_stat(WT_BM *bm, WT_SESSION_IMPL *session, WT_DSRC_STATS *stats) static int __bm_sync(WT_BM *bm, WT_SESSION_IMPL *session, bool block) { - return (__wt_fsync(session, bm->block->fh, block)); + WT_DECL_RET; + + if (!block && !bm->block->nowait_sync_available) + return (0); + + if ((ret = __wt_fsync(session, bm->block->fh, block)) == 0) + return (0); + + /* Ignore ENOTSUP, but don't try again. */ + if (ret != ENOTSUP) + return (ret); + bm->block->nowait_sync_available = false; + return (0); } /* diff --git a/src/block/block_open.c b/src/block/block_open.c index 0fef6ad0e66..777fb1e8cd9 100644 --- a/src/block/block_open.c +++ b/src/block/block_open.c @@ -210,7 +210,8 @@ __wt_block_open(WT_SESSION_IMPL *session, /* Set the file extension information. */ block->extend_len = conn->data_extend_len; - /* Set the preload availability. */ + /* Set the asynchronous flush, preload availability. */ + block->nowait_sync_available = true; block->preload_available = true; /* Initialize the live checkpoint's lock. */ diff --git a/src/block/block_write.c b/src/block/block_write.c index d6599d81a8e..771b0d34193 100644 --- a/src/block/block_write.c +++ b/src/block/block_write.c @@ -337,7 +337,6 @@ __wt_block_write_off(WT_SESSION_IMPL *session, WT_BLOCK *block, WT_RET(ret); } -#ifdef HAVE_SYNC_FILE_RANGE /* * Optionally schedule writes for dirty pages in the system buffer * cache, but only if the current session can wait. @@ -346,9 +345,15 @@ __wt_block_write_off(WT_SESSION_IMPL *session, WT_BLOCK *block, (block->os_cache_dirty += align_size) > block->os_cache_dirty_max && __wt_session_can_wait(session)) { block->os_cache_dirty = 0; - WT_RET(__wt_fsync(session, fh, false)); + if ((ret = __wt_fsync(session, fh, false)) != 0) { + /* + * Ignore ENOTSUP, but don't try again. + */ + if (ret != ENOTSUP) + return (ret); + block->os_cache_dirty_max = 0; + } } -#endif /* Optionally discard blocks from the buffer cache. */ WT_RET(__wt_block_discard(session, block, align_size)); |