summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChenhao Qu <chenhao.qu@mongodb.com>2020-07-15 05:14:55 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-07-15 05:48:44 +0000
commitc6d6f989ef0b320c36bf62e4fd7dd0c4d335da38 (patch)
treeae7c7b3f10fc4a1a0c6b73576e056dab0250fc6d
parentbd12a2bf57e9fcdcf216d11b67dadc557cfd9d1d (diff)
downloadmongo-c6d6f989ef0b320c36bf62e4fd7dd0c4d335da38.tar.gz
Import wiredtiger: e2ca2adcee82b274d89543f8b64cb84334ca07ea from branch mongodb-4.6
ref: 4c6b28fb2b..e2ca2adcee for: 4.5.1 WT-6517 Update test_txn13 to avoid getting a rollback error WT-6521 Don't perform checkpoint cleanup during server startup and shutdown phase
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/btree/bt_sync.c19
-rw-r--r--src/third_party/wiredtiger/test/suite/test_txn13.py11
3 files changed, 24 insertions, 8 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 0151688bada..25d09f0cf80 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.6",
- "commit": "4c6b28fb2bdd12681391b1e1eb11070d391aae57"
+ "commit": "e2ca2adcee82b274d89543f8b64cb84334ca07ea"
}
diff --git a/src/third_party/wiredtiger/src/btree/bt_sync.c b/src/third_party/wiredtiger/src/btree/bt_sync.c
index af2e22f7582..b897ce6bbbd 100644
--- a/src/third_party/wiredtiger/src/btree/bt_sync.c
+++ b/src/third_party/wiredtiger/src/btree/bt_sync.c
@@ -388,7 +388,16 @@ __sync_page_skip(WT_SESSION_IMPL *session, WT_REF *ref, void *context, bool *ski
if (ref->state != WT_REF_DISK)
return (0);
- /* Check whether this ref has any possible updates to be aborted. */
+ /* Don't read pages into cache during startup or shutdown phase. */
+ if (F_ISSET(S2C(session), WT_CONN_RECOVERING | WT_CONN_CLOSING_TIMESTAMP)) {
+ *skipp = true;
+ return (0);
+ }
+
+ /*
+ * Ignore the pages with no on-disk address. It is possible that a page with deleted state may
+ * not have an on-disk address.
+ */
if (!__wt_ref_addr_copy(session, ref, &addr))
return (0);
@@ -553,8 +562,12 @@ __wt_sync_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop)
if (walk == NULL)
break;
- /* Traverse through the internal page for obsolete child pages. */
- if (F_ISSET(walk, WT_REF_FLAG_INTERNAL)) {
+ /*
+ * Perform checkpoint cleanup when not in startup or shutdown phase by traversing
+ * through internal pages looking for obsolete child pages.
+ */
+ if (!F_ISSET(conn, WT_CONN_RECOVERING | WT_CONN_CLOSING_TIMESTAMP) &&
+ F_ISSET(walk, WT_REF_FLAG_INTERNAL)) {
WT_WITH_PAGE_INDEX(
session, ret = __sync_ref_int_obsolete_cleanup(session, walk, &ref_list));
WT_ERR(ret);
diff --git a/src/third_party/wiredtiger/test/suite/test_txn13.py b/src/third_party/wiredtiger/test/suite/test_txn13.py
index 541017804c9..fcd1dae95da 100644
--- a/src/third_party/wiredtiger/test/suite/test_txn13.py
+++ b/src/third_party/wiredtiger/test/suite/test_txn13.py
@@ -40,13 +40,16 @@ class test_txn13(wttest.WiredTigerTestCase, suite_subprocess):
logmax = "100K"
tablename = 'test_txn13'
uri = 'table:' + tablename
- nops = 1024
+ # We use 8 ops here to get around the 10 operation check done by WiredTiger to determine if
+ # a transaction is blocking or not.
+ nops = 8
create_params = 'key_format=i,value_format=S'
+ # The 1gb, 2gb and 4gb scenario names refer to the valuesize * nops.
scenarios = make_scenarios([
- ('1gb', dict(expect_err=False, valuesize=1048576)),
- ('2gb', dict(expect_err=False, valuesize=2097152)),
- ('4gb', dict(expect_err=True, valuesize=4194304))
+ ('1gb', dict(expect_err=False, valuesize=134217728)),
+ ('2gb', dict(expect_err=False, valuesize=268435456)),
+ ('4gb', dict(expect_err=True, valuesize=536870912))
])
# Turn on logging for this test.