summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2022-02-24 15:00:21 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-02-24 04:25:26 +0000
commita676602d0382df3077f9b0f95cff3175e9af9ea3 (patch)
tree2dd1c6d54c8401fafd62091274b4815034e7acab
parenteef27964f474c5e7b1684b96f9acd53f561062f0 (diff)
downloadmongo-a676602d0382df3077f9b0f95cff3175e9af9ea3.tar.gz
Import wiredtiger: f138cf8582dca92799b86e8d96e5e8a62447d135 from branch mongodb-4.0
ref: 9d683270f1..f138cf8582 for: 4.0.29 WT-7984 Fix a bug that could cause a checkpoint to omit a page of data
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/reconcile/rec_write.c41
2 files changed, 26 insertions, 17 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index f10f402b778..60c316da4cb 100644
--- a/src/third_party/wiredtiger/import.data
+++ b/src/third_party/wiredtiger/import.data
@@ -2,5 +2,5 @@
"vendor": "wiredtiger",
"github": "wiredtiger/wiredtiger.git",
"branch": "mongodb-4.0",
- "commit": "9d683270f19c326e6ca57e795c5cecab91ec1493"
+ "commit": "f138cf8582dca92799b86e8d96e5e8a62447d135"
}
diff --git a/src/third_party/wiredtiger/src/reconcile/rec_write.c b/src/third_party/wiredtiger/src/reconcile/rec_write.c
index a04567eb1c1..46888921f56 100644
--- a/src/third_party/wiredtiger/src/reconcile/rec_write.c
+++ b/src/third_party/wiredtiger/src/reconcile/rec_write.c
@@ -157,6 +157,9 @@ __reconcile(WT_SESSION_IMPL *session, WT_REF *ref, WT_SALVAGE_COOKIE *salvage, u
WT_PAGE *page;
WT_PAGE_MODIFY *mod;
WT_RECONCILE *r;
+#ifdef HAVE_DIAGNOSTIC
+ void *addr;
+#endif
btree = S2BT(session);
page = ref->page;
@@ -204,11 +207,17 @@ __reconcile(WT_SESSION_IMPL *session, WT_REF *ref, WT_SALVAGE_COOKIE *salvage, u
/* Check for a successful reconciliation. */
WT_TRET(__rec_write_check_complete(session, r, ret, lookaside_retryp));
+#ifdef HAVE_DIAGNOSTIC
+ addr = ref->addr;
+#endif
/* Wrap up the page reconciliation. */
if (ret == 0 && (ret = __rec_write_wrapup(session, r, page)) == 0)
__rec_write_page_status(session, r);
- else
+ else {
+ /* Make sure that reconciliation doesn't free the page that has been written to disk. */
+ WT_ASSERT(session, addr == NULL || ref->addr != NULL);
WT_TRET(__rec_write_wrapup_err(session, r, page));
+ }
/*
* If reconciliation completes successfully, save the stable timestamp.
@@ -2165,6 +2174,21 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
ref = r->ref;
/*
+ * If using the lookaside table eviction path and we found updates that weren't globally visible
+ * when reconciling this page, copy them into the database's lookaside store.
+ */
+ if (F_ISSET(r, WT_REC_LOOKASIDE))
+ WT_RET(__rec_las_wrapup(session, r));
+
+ /*
+ * Wrap up overflow tracking. If we are about to create a checkpoint, the system must be
+ * entirely consistent at that point (the underlying block manager is presumably going to do
+ * some action to resolve the list of allocated/free/whatever blocks that are associated with
+ * the checkpoint).
+ */
+ WT_RET(__wt_ovfl_track_wrapup(session, page));
+
+ /*
* This page may have previously been reconciled, and that information is now about to be
* replaced. Make sure it's discarded at some point, and clear the underlying modification
* information, we're creating a new reality.
@@ -2213,21 +2237,6 @@ __rec_write_wrapup(WT_SESSION_IMPL *session, WT_RECONCILE *r, WT_PAGE *page)
/* Reset the reconciliation state. */
mod->rec_result = 0;
- /*
- * If using the lookaside table eviction path and we found updates that weren't globally visible
- * when reconciling this page, copy them into the database's lookaside store.
- */
- if (F_ISSET(r, WT_REC_LOOKASIDE))
- WT_RET(__rec_las_wrapup(session, r));
-
- /*
- * Wrap up overflow tracking. If we are about to create a checkpoint, the system must be
- * entirely consistent at that point (the underlying block manager is presumably going to do
- * some action to resolve the list of allocated/free/whatever blocks that are associated with
- * the checkpoint).
- */
- WT_RET(__wt_ovfl_track_wrapup(session, page));
-
__wt_verbose(session, WT_VERB_RECONCILE, "%p reconciled into %" PRIu32 " pages", (void *)ref,
r->multi_next);