diff options
author | Clarisse Cheah <clarisse.cheah@mongodb.com> | 2022-11-03 04:37:51 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-11-03 05:18:48 +0000 |
commit | 23c7727f6b20099eb3e1a1fee340d789d1bbe3bf (patch) | |
tree | 7f66d4bf0a1422658e8c1f766f414773621b0a39 | |
parent | 379053351a57352180267d3e38bbcfb510469406 (diff) | |
download | mongo-23c7727f6b20099eb3e1a1fee340d789d1bbe3bf.tar.gz |
Import wiredtiger: 2bc86676ae60a59f91492760d2d9bd438206d849 from branch mongodb-master
ref: b5dc894abb..2bc86676ae
for: 6.2.0-rc0
WT-10065 Avoid logging statistics for tables before recovery completes.
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/conn/conn_stat.c | 10 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/cursor/cur_stat.c | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/include/connection.h | 7 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/txn/txn_recover.c | 1 |
5 files changed, 14 insertions, 8 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 4a41d1926b6..3dcc223c598 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-master", - "commit": "b5dc894abbb12fe4661866fb40b276a9d2cf0851" + "commit": "2bc86676ae60a59f91492760d2d9bd438206d849" } diff --git a/src/third_party/wiredtiger/src/conn/conn_stat.c b/src/third_party/wiredtiger/src/conn/conn_stat.c index 95028fa55e0..2697c24d554 100644 --- a/src/third_party/wiredtiger/src/conn/conn_stat.c +++ b/src/third_party/wiredtiger/src/conn/conn_stat.c @@ -494,17 +494,19 @@ __statlog_log_one(WT_SESSION_IMPL *session, WT_ITEM *path, WT_ITEM *tmp) /* * Lock the schema and walk the list of open handles, dumping any that match the list of object - * sources. + * sources. Statistics logging starts before recovery is run. Only walk the handles after the + * connection completes recovery. */ - if (conn->stat_sources != NULL) + if (conn->stat_sources != NULL && F_ISSET(conn, WT_CONN_RECOVERY_COMPLETE)) WT_RET(__wt_conn_btree_apply(session, NULL, __statlog_apply, NULL, NULL)); /* - * Walk the list of open LSM trees, dumping any that match the list of object sources. + * Walk the list of open LSM trees, dumping any that match the list of object sources. Only walk + * handles after the connection after completes recovery. * * XXX This code should be removed when LSM objects are converted to data handles. */ - if (conn->stat_sources != NULL) + if (conn->stat_sources != NULL && F_ISSET(conn, WT_CONN_RECOVERY_COMPLETE)) WT_RET(__statlog_lsm_apply(session)); WT_RET(__statlog_print_footer(session)); diff --git a/src/third_party/wiredtiger/src/cursor/cur_stat.c b/src/third_party/wiredtiger/src/cursor/cur_stat.c index a3899eeac21..bf8e1351e54 100644 --- a/src/third_party/wiredtiger/src/cursor/cur_stat.c +++ b/src/third_party/wiredtiger/src/cursor/cur_stat.c @@ -565,6 +565,8 @@ __wt_curstat_init(WT_SESSION_IMPL *session, const char *uri, WT_CURSOR *curjoin, return (0); } + /* Data source statistics are only available after recovery completes. */ + WT_ASSERT(session, F_ISSET(S2C(session), WT_CONN_RECOVERY_COMPLETE)); dsrc_uri = uri + strlen("statistics:"); if (strcmp(dsrc_uri, "join") == 0) diff --git a/src/third_party/wiredtiger/src/include/connection.h b/src/third_party/wiredtiger/src/include/connection.h index fd5e273fd41..3ea5487522e 100644 --- a/src/third_party/wiredtiger/src/include/connection.h +++ b/src/third_party/wiredtiger/src/include/connection.h @@ -658,9 +658,10 @@ struct __wt_connection_impl { #define WT_CONN_READY 0x0100000u #define WT_CONN_RECONFIGURING 0x0200000u #define WT_CONN_RECOVERING 0x0400000u -#define WT_CONN_SALVAGE 0x0800000u -#define WT_CONN_TIERED_FIRST_FLUSH 0x1000000u -#define WT_CONN_WAS_BACKUP 0x2000000u +#define WT_CONN_RECOVERY_COMPLETE 0x0800000u +#define WT_CONN_SALVAGE 0x1000000u +#define WT_CONN_TIERED_FIRST_FLUSH 0x2000000u +#define WT_CONN_WAS_BACKUP 0x4000000u /* AUTOMATIC FLAG VALUE GENERATION STOP 32 */ uint32_t flags; }; diff --git a/src/third_party/wiredtiger/src/txn/txn_recover.c b/src/third_party/wiredtiger/src/txn/txn_recover.c index 7714a43a08e..4638f906089 100644 --- a/src/third_party/wiredtiger/src/txn/txn_recover.c +++ b/src/third_party/wiredtiger/src/txn/txn_recover.c @@ -1050,6 +1050,7 @@ err: WT_TRET(__wt_evict_destroy(session)); WT_TRET(__wt_session_close_internal(session)); + F_SET(conn, WT_CONN_RECOVERY_COMPLETE); F_CLR(conn, WT_CONN_RECOVERING); return (ret); |