summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2016-02-09 09:44:22 -0500
committerKeith Bostic <keith@wiredtiger.com>2016-02-09 09:44:22 -0500
commit0f2420492e7ce145114d70af66ae7268d027ae27 (patch)
tree436a386fbd2a1f240122b574c1e98372adb9a744
parent3afbc3749499312f95c85a8e9e1b3ed44bf4bf93 (diff)
downloadmongo-0f2420492e7ce145114d70af66ae7268d027ae27.tar.gz
WT-2361: column-store starting record number error
Acquire page lock before reading or updating any page transactional information. I've never seen a bug here, but insert splits are concurrent with checkpoints and I'm worried this is a problem waiting to happen.
-rw-r--r--src/reconcile/rec_write.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/reconcile/rec_write.c b/src/reconcile/rec_write.c
index 032b3fa31fa..f245ff5d921 100644
--- a/src/reconcile/rec_write.c
+++ b/src/reconcile/rec_write.c
@@ -363,6 +363,17 @@ __wt_reconcile(WT_SESSION_IMPL *session,
WT_ASSERT(session, __wt_page_is_modified(page));
/*
+ * Reconciliation locks the page for three reasons:
+ * Reconciliation reads the lists of page updates, obsolete updates
+ * cannot be discarded while reconciliation is in progress;
+ * The compaction process reads page modification information, which
+ * reconciliation modifies;
+ * In-memory splits: reconciliation of an internal page cannot handle
+ * a child page splitting during the reconciliation.
+ */
+ WT_RET(__wt_fair_lock(session, &page->page_lock));
+
+ /*
* Check that transaction time always moves forward for a given page.
* If this check fails, reconciliation can free something that a future
* reconciliation will need.
@@ -376,17 +387,6 @@ __wt_reconcile(WT_SESSION_IMPL *session,
session, ref, flags, salvage, &session->reconcile));
r = session->reconcile;
- /*
- * Reconciliation locks the page for three reasons:
- * Reconciliation reads the lists of page updates, obsolete updates
- * cannot be discarded while reconciliation is in progress;
- * The compaction process reads page modification information, which
- * reconciliation modifies;
- * In-memory splits: reconciliation of an internal page cannot handle
- * a child page splitting during the reconciliation.
- */
- WT_RET(__wt_fair_lock(session, &page->page_lock));
-
/* Reconcile the page. */
switch (page->type) {
case WT_PAGE_COL_FIX: