summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2022-09-20 14:57:20 +1000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-09-20 05:19:14 +0000
commit8cf76063d48455174ed4b6fd29eccac5d1944cd8 (patch)
tree698d427a543e761b39387733df61194b8bc5e197
parent0177b3d9c4472033df800a247ff5af28abe8169e (diff)
downloadmongo-8cf76063d48455174ed4b6fd29eccac5d1944cd8.tar.gz
Import wiredtiger: d58d8b0f51124c47f97f14aaa3053b23c480cbe7 from branch mongodb-4.4
ref: e868ffed8a..d58d8b0f51 for: 4.4.17 WT-9477 Don't allow checkpoint triggering internal page split which leads to corrupted internal page in the checkpoint (#8046) (#8166) (#8222)
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_split.c11
2 files changed, 10 insertions, 3 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 72e3430c5e5..e8255e17c2b 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.4",
- "commit": "e868ffed8aa1e49240fecce1e472ef7a03482a6d"
+ "commit": "d58d8b0f51124c47f97f14aaa3053b23c480cbe7"
}
diff --git a/src/third_party/wiredtiger/src/btree/bt_split.c b/src/third_party/wiredtiger/src/btree/bt_split.c
index 2c2b255242c..f4bc49db05d 100644
--- a/src/third_party/wiredtiger/src/btree/bt_split.c
+++ b/src/third_party/wiredtiger/src/btree/bt_split.c
@@ -1271,8 +1271,15 @@ __split_parent_climb(WT_SESSION_IMPL *session, WT_PAGE *page)
* to a different part of the tree where it will be written; in other words, in one part of the
* tree we'll skip the newly created insert split chunk, but we'll write it upon finding it in a
* different part of the tree.
- */
- if (!__wt_btree_can_evict_dirty(session)) {
+ *
+ * Historically we allowed checkpoint itself to trigger an internal split here. That wasn't
+ * correct, since if that split climbs the tree above the immediate parent the checkpoint walk
+ * will potentially miss some internal pages. This is wrong as checkpoint needs to reconcile the
+ * entire internal tree structure. Non checkpoint cursor traversal doesn't care the internal
+ * tree structure as they just want to get the next leaf page correctly. Therefore, it is OK to
+ * split concurrently to cursor operations.
+ */
+ if (WT_BTREE_SYNCING(S2BT(session))) {
__split_internal_unlock(session, page);
return (0);
}