summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-02-17 09:35:08 -0500
committerKeith Bostic <keith@wiredtiger.com>2015-02-17 09:35:08 -0500
commit2886bed7d7c63b29ab07f9da121bba4f05229c28 (patch)
tree827bf22bf28023a499c4305fa84aba746d6ad1f4
parentcc63b91e5462fb5595ad926c7eb9fb7eac3c40dc (diff)
downloadmongo-2886bed7d7c63b29ab07f9da121bba4f05229c28.tar.gz
Clearing WT_CONNECTION_IMPL.compact_in_memory_pass doesn't require a
full barrier, it's just to allow reconciliation to stop locking pages. Use the WT_BTREE.flush_lock barrier to flush the write, incidentally fixing Coverity complaint 44258.
-rw-r--r--src/btree/bt_compact.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/btree/bt_compact.c b/src/btree/bt_compact.c
index 405410c6a1c..3609431137e 100644
--- a/src/btree/bt_compact.c
+++ b/src/btree/bt_compact.c
@@ -105,8 +105,8 @@ __wt_compact(WT_SESSION_IMPL *session, const char *cfg[])
* writing the page modify information.
*
* There are three ways we call reconciliation: checkpoints, threads
- * writing leaf pages (usually in preparation for a checkpoint), and
- * eviction.
+ * writing leaf pages (usually in preparation for a checkpoint or if
+ * closing a file), and eviction.
*
* We're holding the schema lock which serializes with checkpoints.
*/
@@ -171,10 +171,12 @@ err: if (ref != NULL)
if (block_manager_begin)
WT_TRET(bm->compact_end(bm, session));
- __wt_spin_unlock(session, &btree->flush_lock);
-
+ /*
+ * Unlock will be a release barrier, use it to update the compaction
+ * status for reconciliation.
+ */
conn->compact_in_memory_pass = 0;
- WT_FULL_BARRIER();
+ __wt_spin_unlock(session, &btree->flush_lock);
return (ret);
}