diff options
author | Luke Chen <luke.chen@mongodb.com> | 2022-01-11 16:22:22 +1100 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-01-11 05:52:02 +0000 |
commit | ab16caa6f6e80312de2abe3c5372049e2ebfd2da (patch) | |
tree | a317db988fac0386a358c285f3b765db7b2adaff | |
parent | 2c0f2afab443b792eccc5d57fdd132a5277def6a (diff) | |
download | mongo-ab16caa6f6e80312de2abe3c5372049e2ebfd2da.tar.gz |
Import wiredtiger: df8173e94998ddd53638f68e9f6fb858f25f5648 from branch mongodb-5.2
ref: 799d1c7ff2..df8173e949
for: 5.2.0-rc5
Reverted ticket(s):
WT-8598 Avoid checkpoint cleanup always on shutdown
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/btree/bt_sync.c | 4 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/conn/conn_dhandle.c | 5 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/include/connection.h | 4 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/txn/txn.c | 7 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/txn/txn_ckpt.c | 7 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c | 2 |
7 files changed, 15 insertions, 16 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 48f03c88099..e531f95769b 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-5.2", - "commit": "799d1c7ff250039f4b22133aa94a996a538a2b1d" + "commit": "df8173e94998ddd53638f68e9f6fb858f25f5648" } diff --git a/src/third_party/wiredtiger/src/btree/bt_sync.c b/src/third_party/wiredtiger/src/btree/bt_sync.c index 72b66ed006f..df8dab28f4a 100644 --- a/src/third_party/wiredtiger/src/btree/bt_sync.c +++ b/src/third_party/wiredtiger/src/btree/bt_sync.c @@ -396,7 +396,7 @@ __sync_page_skip(WT_SESSION_IMPL *session, WT_REF *ref, void *context, bool *ski } /* Don't read pages into cache during startup or shutdown phase. */ - if (F_ISSET(S2C(session), WT_CONN_RECOVERING | WT_CONN_CLOSING_CHECKPOINT)) { + if (F_ISSET(S2C(session), WT_CONN_RECOVERING | WT_CONN_CLOSING_TIMESTAMP)) { *skipp = true; return (0); } @@ -557,7 +557,7 @@ __wt_sync_file(WT_SESSION_IMPL *session, WT_CACHE_OP syncop) * reads all of the internal pages to improve cleanup). */ if (btree->type == BTREE_ROW) - internal_cleanup = !F_ISSET(conn, WT_CONN_RECOVERING | WT_CONN_CLOSING_CHECKPOINT); + internal_cleanup = !F_ISSET(conn, WT_CONN_RECOVERING | WT_CONN_CLOSING_TIMESTAMP); else { LF_SET(WT_READ_CACHE); internal_cleanup = false; diff --git a/src/third_party/wiredtiger/src/conn/conn_dhandle.c b/src/third_party/wiredtiger/src/conn/conn_dhandle.c index 3ed40c84d83..efe3a852ef7 100644 --- a/src/third_party/wiredtiger/src/conn/conn_dhandle.c +++ b/src/third_party/wiredtiger/src/conn/conn_dhandle.c @@ -377,9 +377,8 @@ __wt_conn_dhandle_close(WT_SESSION_IMPL *session, bool final, bool mark_dead) * timestamp as needed and any remaining dirty data should be discarded. */ if (!discard && !marked_dead) { - if ((F_ISSET(conn, WT_CONN_CLOSING_CHECKPOINT) && - conn->txn_global.has_stable_timestamp) || - F_ISSET(conn, WT_CONN_IN_MEMORY) || F_ISSET(btree, WT_BTREE_NO_CHECKPOINT)) + if (F_ISSET(conn, WT_CONN_CLOSING_TIMESTAMP) || 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 14fb4a17708..bbd4db1a9ae 100644 --- a/src/third_party/wiredtiger/src/include/connection.h +++ b/src/third_party/wiredtiger/src/include/connection.h @@ -625,8 +625,8 @@ struct __wt_connection_impl { #define WT_CONN_CKPT_GATHER 0x000004u #define WT_CONN_CKPT_SYNC 0x000008u #define WT_CONN_CLOSING 0x000010u -#define WT_CONN_CLOSING_CHECKPOINT 0x000020u -#define WT_CONN_CLOSING_NO_MORE_OPENS 0x000040u +#define WT_CONN_CLOSING_NO_MORE_OPENS 0x000020u +#define WT_CONN_CLOSING_TIMESTAMP 0x000040u #define WT_CONN_COMPATIBILITY 0x000080u #define WT_CONN_DATA_CORRUPTION 0x000100u #define WT_CONN_EVICTION_RUN 0x000200u diff --git a/src/third_party/wiredtiger/src/txn/txn.c b/src/third_party/wiredtiger/src/txn/txn.c index d519b514a4c..d5e277f41ce 100644 --- a/src/third_party/wiredtiger/src/txn/txn.c +++ b/src/third_party/wiredtiger/src/txn/txn.c @@ -2369,10 +2369,8 @@ __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 @@ -2380,20 +2378,19 @@ __wt_txn_global_shutdown(WT_SESSION_IMPL *session, const char **cfg) * before shutting down all the subsystems. We have shut down all user sessions, but send in * true for waiting for internal races. */ - F_SET(conn, WT_CONN_CLOSING_CHECKPOINT); WT_TRET(__wt_config_gets(session, cfg, "use_timestamp", &cval)); ckpt_cfg = "use_timestamp=false"; if (cval.val != 0) { ckpt_cfg = "use_timestamp=true"; if (conn->txn_global.has_stable_timestamp) - use_timestamp = true; + F_SET(conn, WT_CONN_CLOSING_TIMESTAMP); } 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 (use_timestamp) { + if (F_ISSET(conn, WT_CONN_CLOSING_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 3981a09023a..31b01b21e3d 100644 --- a/src/third_party/wiredtiger/src/txn/txn_ckpt.c +++ b/src/third_party/wiredtiger/src/txn/txn_ckpt.c @@ -352,8 +352,11 @@ __checkpoint_reduce_dirty_cache(WT_SESSION_IMPL *session) conn = S2C(session); cache = conn->cache; - /* Give up if scrubbing is disabled. */ - if (cache->eviction_checkpoint_target < DBL_EPSILON) + /* + * Give up if scrubbing is disabled, including when checkpointing with a timestamp on close (we + * can't evict dirty pages in that case, so scrubbing cannot help). + */ + if (F_ISSET(conn, WT_CONN_CLOSING_TIMESTAMP) || cache->eviction_checkpoint_target < DBL_EPSILON) return; time_start = __wt_clock(session); diff --git a/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c b/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c index d23e0fe1ad4..818eaf079c5 100644 --- a/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c +++ b/src/third_party/wiredtiger/src/txn/txn_rollback_to_stable.c @@ -1623,7 +1623,7 @@ __rollback_to_stable_btree_apply( * 2. Table has timestamped updates without a stable timestamp. */ if ((F_ISSET(S2C(session), WT_CONN_RECOVERING) || - F_ISSET(S2C(session), WT_CONN_CLOSING_CHECKPOINT)) && + F_ISSET(S2C(session), WT_CONN_CLOSING_TIMESTAMP)) && (addr_size == 0 || (rollback_timestamp == WT_TS_NONE && max_durable_ts != WT_TS_NONE))) { __wt_verbose_multi(session, WT_VERB_RECOVERY_RTS(session), "skip rollback to stable on file %s because %s", uri, |