summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/block
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@mongodb.com>2015-11-02 11:55:14 +1100
committerMichael Cahill <michael.cahill@mongodb.com>2015-11-02 11:55:14 +1100
commitfb6ebe75207c3221314ed318595489a838ef1db0 (patch)
tree6b9b210b15f9b9685b9a5dd707001297127ee1d3 /src/third_party/wiredtiger/src/block
parent4fbfa13ec0f819080a35ed8b528a030797e483a6 (diff)
downloadmongo-fb6ebe75207c3221314ed318595489a838ef1db0.tar.gz
Import wiredtiger-wiredtiger-mongodb-3.2.0-rc1-194-g0dc3f20.tar.gz from wiredtiger branch mongodb-3.2
Diffstat (limited to 'src/third_party/wiredtiger/src/block')
-rw-r--r--src/third_party/wiredtiger/src/block/block_ckpt.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/third_party/wiredtiger/src/block/block_ckpt.c b/src/third_party/wiredtiger/src/block/block_ckpt.c
index 9b42a072d73..2c8ff89a5cf 100644
--- a/src/third_party/wiredtiger/src/block/block_ckpt.c
+++ b/src/third_party/wiredtiger/src/block/block_ckpt.c
@@ -83,11 +83,16 @@ __wt_block_checkpoint_load(WT_SESSION_IMPL *session, WT_BLOCK *block,
WT_ERR(__wt_block_ckpt_init(session, ci, "checkpoint"));
} else {
/*
- * We depend on the btree level for locking: things will go
- * bad fast should we open the live system in two handles, or
- * if we create, salvage, truncate or verify the live/running
- * file, for that matter.
+ * We depend on the btree level for locking: things will go bad
+ * fast if we open the live system in two handles, or salvage,
+ * truncate or verify the live/running file.
*/
+#ifdef HAVE_DIAGNOSTIC
+ __wt_spin_lock(session, &block->live_lock);
+ WT_ASSERT(session, block->live_open == false);
+ block->live_open = true;
+ __wt_spin_unlock(session, &block->live_lock);
+#endif
ci = &block->live;
WT_ERR(__wt_block_ckpt_init(session, ci, "live"));
}
@@ -178,8 +183,8 @@ __wt_block_checkpoint_unload(
/*
* If it's the live system, truncate to discard any extended blocks and
* discard the active extent lists. Hold the lock even though we're
- * unloading the live checkpoint, there could be readers active in
- * other checkpoints.
+ * unloading the live checkpoint, there could be readers active in other
+ * checkpoints.
*/
if (!checkpoint) {
/*
@@ -191,6 +196,9 @@ __wt_block_checkpoint_unload(
__wt_spin_lock(session, &block->live_lock);
__wt_block_ckpt_destroy(session, &block->live);
+#ifdef HAVE_DIAGNOSTIC
+ block->live_open = false;
+#endif
__wt_spin_unlock(session, &block->live_lock);
}