summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2018-03-02 16:56:16 +1100
committerLuke Chen <luke.chen@mongodb.com>2018-03-02 16:59:17 +1100
commit21cd15430f92461afd381b2f34c5582e540d63f3 (patch)
treeb20e55bf758562bfffabcdf1791abd982769e12d /src/third_party/wiredtiger/src/lsm/lsm_work_unit.c
parent80bf700fbb9f8fb3e71fe88888f3a7fb69450ef7 (diff)
downloadmongo-21cd15430f92461afd381b2f34c5582e540d63f3.tar.gz
Import wiredtiger: f428c0667e73dddce9bc45e0924fdee64f1b1716 from branch mongodb-3.8
ref: 8f5b5544d8..f428c0667e for: 3.7.3 WT-3906 Respect stable_timestamp in WT_CONNECTION::close WT-3911 Ignore lookaside data on shutdown WT-3934 LSM chunk checkpoints can race with system checkpoints WT-3935 Enable cursor caching by default in WiredTiger. WT-3939 test_txn14.test_txn14.test_log_flush timeout WT-3940 s_export issue detected during WiredTiger release execution WT-3945 Support libwiredtiger.so checking in s_export WT-3946 Truncate segfault with a NULL start cursor WT-3947 Allow wiredtiger_open configuration to disable cursor caching
Diffstat (limited to 'src/third_party/wiredtiger/src/lsm/lsm_work_unit.c')
-rw-r--r--src/third_party/wiredtiger/src/lsm/lsm_work_unit.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c b/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c
index 29ece08004d..dcb9b34802a 100644
--- a/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c
+++ b/src/third_party/wiredtiger/src/lsm/lsm_work_unit.c
@@ -313,6 +313,26 @@ __wt_lsm_chunk_visible_all(
}
/*
+ * __lsm_checkpoint_chunk --
+ * Checkpoint an LSM chunk, separated out to make locking easier.
+ */
+static int
+__lsm_checkpoint_chunk(WT_SESSION_IMPL *session)
+{
+ WT_DECL_RET;
+
+ /*
+ * Turn on metadata tracking to ensure the checkpoint gets the
+ * necessary handle locks.
+ */
+ WT_RET(__wt_meta_track_on(session));
+ ret = __wt_checkpoint(session, NULL);
+ WT_TRET(__wt_meta_track_off(session, false, ret != 0));
+
+ return (ret);
+}
+
+/*
* __wt_lsm_checkpoint_chunk --
* Flush a single LSM chunk to disk.
*/
@@ -394,19 +414,13 @@ __wt_lsm_checkpoint_chunk(WT_SESSION_IMPL *session,
chunk->uri);
/*
- * Turn on metadata tracking to ensure the checkpoint gets the
- * necessary handle locks.
- *
- * Ensure that we don't race with a running checkpoint: the checkpoint
- * lock protects against us racing with an application checkpoint in
- * this chunk. Don't wait for it, though: checkpoints can take a long
- * time, and our checkpoint operation should be very quick.
+ * Ensure we don't race with a running checkpoint: the checkpoint lock
+ * protects against us racing with an application checkpoint in this
+ * chunk.
*/
- WT_ERR(__wt_meta_track_on(session));
WT_WITH_CHECKPOINT_LOCK(session,
WT_WITH_SCHEMA_LOCK(session,
- ret = __wt_checkpoint(session, NULL)));
- WT_TRET(__wt_meta_track_off(session, false, ret != 0));
+ ret = __lsm_checkpoint_chunk(session)));
if (ret != 0)
WT_ERR_MSG(session, ret, "LSM checkpoint");