summaryrefslogtreecommitdiff
path: root/src/lsm
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2014-11-20 21:48:40 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2014-11-20 21:48:40 +1100
commit225aa8174db9220e5144ed70961379c1efc16cd3 (patch)
tree9b81ce53cb2d85d06a4c7156c4c4dc3adce6e4ee /src/lsm
parenta69f70973ae0f3d6035e6b9c01369ff257917115 (diff)
downloadmongo-225aa8174db9220e5144ed70961379c1efc16cd3.tar.gz
Only clear the LSM exclusive flag when releasing a tree if it was set, and before decrementing the reference count.
Diffstat (limited to 'src/lsm')
-rw-r--r--src/lsm/lsm_tree.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/lsm/lsm_tree.c b/src/lsm/lsm_tree.c
index af6b1812cf6..b4cfae02823 100644
--- a/src/lsm/lsm_tree.c
+++ b/src/lsm/lsm_tree.c
@@ -576,6 +576,8 @@ __wt_lsm_tree_get(WT_SESSION_IMPL *session,
* lock beat us to it.
*/
if (lsm_tree->exclusive) {
+ WT_ASSERT(session,
+ lsm_tree->refcnt > 1);
(void)WT_ATOMIC_SUB4(
lsm_tree->refcnt, 1);
return (EBUSY);
@@ -598,8 +600,11 @@ void
__wt_lsm_tree_release(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree)
{
WT_ASSERT(session, lsm_tree->refcnt > 0);
+ if (lsm_tree->exclusive) {
+ WT_ASSERT(session, lsm_tree->refcnt == 1);
+ lsm_tree->exclusive = 0;
+ }
(void)WT_ATOMIC_SUB4(lsm_tree->refcnt, 1);
- lsm_tree->exclusive = 0;
}
/* How aggressively to ramp up or down throttle due to level 0 merging */