From 32f992461970176f919f424610f1a6925bc76ab6 Mon Sep 17 00:00:00 2001 From: Chenhao Qu Date: Wed, 2 Nov 2022 11:57:22 +1100 Subject: Import wiredtiger: 0fc80dd1e769b50f81227391436206d01ddd4aa1 from branch mongodb-master ref: 2c683e1b51..0fc80dd1e7 for: 6.2.0-rc0 WT-10064 Don't evict internal pages with non-globally visible deleted pages for non standalone build --- src/third_party/wiredtiger/import.data | 2 +- .../wiredtiger/src/reconcile/rec_child.c | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 34512cbf7ba..2784e70399a 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-master", - "commit": "2c683e1b5159958d4564f442225e3fc0466658cc" + "commit": "0fc80dd1e769b50f81227391436206d01ddd4aa1" } diff --git a/src/third_party/wiredtiger/src/reconcile/rec_child.c b/src/third_party/wiredtiger/src/reconcile/rec_child.c index 653f14a0b57..87fcd4ff1ea 100644 --- a/src/third_party/wiredtiger/src/reconcile/rec_child.c +++ b/src/third_party/wiredtiger/src/reconcile/rec_child.c @@ -44,8 +44,8 @@ __rec_child_deleted( /* * If an earlier reconciliation chose to write the fast truncate information to the page, we - * should select it regardless of visibility unless it is visible globally visible. This is - * important as it is never ok to shift the on-disk value backwards. + * should select it regardless of visibility unless it is globally visible. This is important as + * it is never ok to shift the on-disk value backwards. */ if (page_del->selected_for_write && !visible_all) { cmsp->del = *page_del; @@ -125,6 +125,24 @@ __rec_child_deleted( * cells to the page. Copy out the current fast-truncate information for that function. */ if (!visible_all) { + if (!__wt_process.fast_truncate_2022) { + /* + * Internal pages with deletes that aren't globally visible cannot be evicted if we + * don't write the page_del information, we don't have sufficient information to restore + * the page's information if subsequently read (we wouldn't know which transactions + * should see the original page and which should see the deleted page). + */ + if (F_ISSET(r, WT_REC_EVICT)) + return (__wt_set_return(session, EBUSY)); + + /* + * It is wrong to leave the page clean after checkpoint if we cannot write the deleted + * pages to disk in eviction. If we do so, the next eviction will discard the page + * without reconcile it again and we lose the time point information of the non-obsolete + * deleted pages. + */ + r->leave_dirty = true; + } cmsp->del = *page_del; cmsp->state = WT_CHILD_PROXY; page_del->selected_for_write = true; -- cgit v1.2.1