summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2023-04-03 11:26:26 +1000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-04-03 01:41:52 +0000
commitfb3e6824af816ec06fd69a644a3b535a063384d7 (patch)
tree5d573a489673dadd03cb18e3c727fd3d9d66ec05
parenta33905827de242473e4b58ff49c7584c4484331e (diff)
downloadmongo-fb3e6824af816ec06fd69a644a3b535a063384d7.tar.gz
Import wiredtiger: 2a45076e8628d7eef79e9ba8bc8abdbd13e711f3 from branch mongodb-4.4
ref: 3decc745ec..2a45076e86 for: 4.4.20 WT-8652 Do not skip the final metadata checkpoint when shutdown configured with use_timestamp=true
-rw-r--r--src/third_party/wiredtiger/import.data2
-rw-r--r--src/third_party/wiredtiger/src/conn/conn_dhandle.c5
-rw-r--r--src/third_party/wiredtiger/src/include/connection.h33
-rw-r--r--src/third_party/wiredtiger/src/txn/txn.c6
-rw-r--r--src/third_party/wiredtiger/src/txn/txn_ckpt.c4
5 files changed, 24 insertions, 26 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data
index 910ee19e10e..827b197b1e6 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": "3decc745ece9155d004ca447b72cb5c8122847eb"
+ "commit": "2a45076e8628d7eef79e9ba8bc8abdbd13e711f3"
}
diff --git a/src/third_party/wiredtiger/src/conn/conn_dhandle.c b/src/third_party/wiredtiger/src/conn/conn_dhandle.c
index 215eb5a47f0..da3543333a3 100644
--- a/src/third_party/wiredtiger/src/conn/conn_dhandle.c
+++ b/src/third_party/wiredtiger/src/conn/conn_dhandle.c
@@ -371,12 +371,9 @@ __wt_conn_dhandle_close(WT_SESSION_IMPL *session, bool final, bool mark_dead)
* We can't discard non-durable trees yet: first we have to close the underlying btree
* handle, then we can mark the data handle dead.
*
- * If we are closing with timestamps enforced, then we have already checkpointed as of the
- * timestamp as needed and any remaining dirty data should be discarded.
*/
if (!discard && !marked_dead) {
- if (F_ISSET(conn, WT_CONN_CLOSING_TIMESTAMP) || F_ISSET(conn, WT_CONN_IN_MEMORY) ||
- F_ISSET(btree, WT_BTREE_NO_CHECKPOINT))
+ if (F_ISSET(conn, WT_CONN_IN_MEMORY) || F_ISSET(btree, WT_BTREE_NO_CHECKPOINT))
discard = true;
else {
WT_TRET(__wt_checkpoint_close(session, final));
diff --git a/src/third_party/wiredtiger/src/include/connection.h b/src/third_party/wiredtiger/src/include/connection.h
index 73eee425d13..0e1b2aaa5bc 100644
--- a/src/third_party/wiredtiger/src/include/connection.h
+++ b/src/third_party/wiredtiger/src/include/connection.h
@@ -656,23 +656,22 @@ struct __wt_connection_impl {
#define WT_CONN_CLOSING 0x000010u
#define WT_CONN_CLOSING_CHECKPOINT 0x000020u
#define WT_CONN_CLOSING_NO_MORE_OPENS 0x000040u
-#define WT_CONN_CLOSING_TIMESTAMP 0x000080u
-#define WT_CONN_COMPATIBILITY 0x000100u
-#define WT_CONN_DATA_CORRUPTION 0x000200u
-#define WT_CONN_EVICTION_RUN 0x000400u
-#define WT_CONN_FILE_CLOSE_SYNC 0x000800u
-#define WT_CONN_HS_OPEN 0x001000u
-#define WT_CONN_INCR_BACKUP 0x002000u
-#define WT_CONN_IN_MEMORY 0x004000u
-#define WT_CONN_LEAK_MEMORY 0x008000u
-#define WT_CONN_LSM_MERGE 0x010000u
-#define WT_CONN_OPTRACK 0x020000u
-#define WT_CONN_PANIC 0x040000u
-#define WT_CONN_READONLY 0x080000u
-#define WT_CONN_RECONFIGURING 0x100000u
-#define WT_CONN_RECOVERING 0x200000u
-#define WT_CONN_SALVAGE 0x400000u
-#define WT_CONN_WAS_BACKUP 0x800000u
+#define WT_CONN_COMPATIBILITY 0x000080u
+#define WT_CONN_DATA_CORRUPTION 0x000100u
+#define WT_CONN_EVICTION_RUN 0x000200u
+#define WT_CONN_FILE_CLOSE_SYNC 0x000400u
+#define WT_CONN_HS_OPEN 0x000800u
+#define WT_CONN_INCR_BACKUP 0x001000u
+#define WT_CONN_IN_MEMORY 0x002000u
+#define WT_CONN_LEAK_MEMORY 0x004000u
+#define WT_CONN_LSM_MERGE 0x008000u
+#define WT_CONN_OPTRACK 0x010000u
+#define WT_CONN_PANIC 0x020000u
+#define WT_CONN_READONLY 0x040000u
+#define WT_CONN_RECONFIGURING 0x080000u
+#define WT_CONN_RECOVERING 0x100000u
+#define WT_CONN_SALVAGE 0x200000u
+#define WT_CONN_WAS_BACKUP 0x400000u
/* AUTOMATIC FLAG VALUE GENERATION STOP 32 */
uint32_t flags;
};
diff --git a/src/third_party/wiredtiger/src/txn/txn.c b/src/third_party/wiredtiger/src/txn/txn.c
index 9e25d7a2517..791069c2846 100644
--- a/src/third_party/wiredtiger/src/txn/txn.c
+++ b/src/third_party/wiredtiger/src/txn/txn.c
@@ -2447,8 +2447,10 @@ __wt_txn_global_shutdown(WT_SESSION_IMPL *session, const char **cfg)
WT_SESSION_IMPL *s;
char ts_string[WT_TS_INT_STRING_SIZE];
const char *ckpt_cfg;
+ bool use_timestamp;
conn = S2C(session);
+ use_timestamp = false;
/*
* Perform a system-wide checkpoint so that all tables are consistent with each other. All
@@ -2462,14 +2464,14 @@ __wt_txn_global_shutdown(WT_SESSION_IMPL *session, const char **cfg)
if (cval.val != 0) {
ckpt_cfg = "use_timestamp=true";
if (conn->txn_global.has_stable_timestamp)
- F_SET(conn, WT_CONN_CLOSING_TIMESTAMP);
+ use_timestamp = true;
}
if (!F_ISSET(conn, WT_CONN_IN_MEMORY | WT_CONN_READONLY | WT_CONN_PANIC)) {
/*
* Perform rollback to stable to ensure that the stable version is written to disk on a
* clean shutdown.
*/
- if (F_ISSET(conn, WT_CONN_CLOSING_TIMESTAMP)) {
+ if (use_timestamp) {
__wt_verbose(session, WT_VERB_RTS,
"performing shutdown rollback to stable with stable timestamp: %s",
__wt_timestamp_to_string(conn->txn_global.stable_timestamp, ts_string));
diff --git a/src/third_party/wiredtiger/src/txn/txn_ckpt.c b/src/third_party/wiredtiger/src/txn/txn_ckpt.c
index 574ff3453eb..7056e154077 100644
--- a/src/third_party/wiredtiger/src/txn/txn_ckpt.c
+++ b/src/third_party/wiredtiger/src/txn/txn_ckpt.c
@@ -2128,9 +2128,9 @@ __wt_checkpoint_close(WT_SESSION_IMPL *session, bool final)
* is a stable timestamp set or the connection is configured to disallow such operation.
* Flushing trees can lead to files that are inconsistent on disk after a crash.
*/
- if (btree->modified && !bulk && !__wt_btree_immediately_durable(session) &&
+ if (btree->modified && !bulk && !__wt_btree_immediately_durable(session) && !metadata &&
(S2C(session)->txn_global.has_stable_timestamp ||
- (!F_ISSET(S2C(session), WT_CONN_FILE_CLOSE_SYNC) && !metadata)))
+ !F_ISSET(S2C(session), WT_CONN_FILE_CLOSE_SYNC)))
return (__wt_set_return(session, EBUSY));
/*