summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/src/reconcile/rec_child.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/third_party/wiredtiger/src/reconcile/rec_child.c')
-rw-r--r--src/third_party/wiredtiger/src/reconcile/rec_child.c22
1 files changed, 20 insertions, 2 deletions
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;