diff options
author | Luke Chen <luke.chen@mongodb.com> | 2021-06-17 15:47:11 +1000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-06-17 06:09:32 +0000 |
commit | 3bebe0b8f9c89098586fa2638fd1bb640e516486 (patch) | |
tree | 194c6db0b3e2ff5fe1c9334da8580ac4d4362722 | |
parent | c5ab2e0d8c5852b38f90df8ef4c28df6b9f5f009 (diff) | |
download | mongo-3bebe0b8f9c89098586fa2638fd1bb640e516486.tar.gz |
Import wiredtiger: 4524d572ff451edf69aaa70d211946a3b1ccb19f from branch mongodb-5.0
ref: b724e3ec5c..4524d572ff
for: 5.1.0
WT-7687 Stop tiered manager thread before internal thread
-rw-r--r-- | src/third_party/wiredtiger/import.data | 2 | ||||
-rw-r--r-- | src/third_party/wiredtiger/src/conn/conn_tiered.c | 22 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/third_party/wiredtiger/import.data b/src/third_party/wiredtiger/import.data index 78611070478..9356fe181ee 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.0", - "commit": "b724e3ec5cd6e27bcfaaa53f6308519bda56c7e6" + "commit": "4524d572ff451edf69aaa70d211946a3b1ccb19f" } diff --git a/src/third_party/wiredtiger/src/conn/conn_tiered.c b/src/third_party/wiredtiger/src/conn/conn_tiered.c index e24e44dc03c..90e3d778c72 100644 --- a/src/third_party/wiredtiger/src/conn/conn_tiered.c +++ b/src/third_party/wiredtiger/src/conn/conn_tiered.c @@ -644,10 +644,23 @@ __wt_tiered_storage_destroy(WT_SESSION_IMPL *session) conn = S2C(session); + FLD_CLR(conn->server_flags, WT_CONN_SERVER_TIERED_MGR); + /* + * Stop the storage manager thread. This must be stopped before the internal thread because it + * could be adding work for the internal thread. So stop it first and the internal thread will + * have the opportunity to drain all work. + */ + if (conn->tiered_mgr_tid_set) { + WT_ASSERT(session, conn->tiered_mgr_cond != NULL); + __wt_cond_signal(session, conn->tiered_mgr_cond); + WT_TRET(__wt_thread_join(session, &conn->tiered_mgr_tid)); + conn->tiered_mgr_tid_set = false; + } + /* Stop the internal server thread. */ if (conn->flush_cond != NULL) __wt_cond_signal(session, conn->flush_cond); - FLD_CLR(conn->server_flags, WT_CONN_SERVER_TIERED | WT_CONN_SERVER_TIERED_MGR); + FLD_CLR(conn->server_flags, WT_CONN_SERVER_TIERED); if (conn->tiered_tid_set) { WT_ASSERT(session, conn->tiered_cond != NULL); __wt_cond_signal(session, conn->tiered_cond); @@ -663,13 +676,6 @@ __wt_tiered_storage_destroy(WT_SESSION_IMPL *session) conn->tiered_session = NULL; } - /* Stop the storage manager thread. */ - if (conn->tiered_mgr_tid_set) { - WT_ASSERT(session, conn->tiered_mgr_cond != NULL); - __wt_cond_signal(session, conn->tiered_mgr_cond); - WT_TRET(__wt_thread_join(session, &conn->tiered_mgr_tid)); - conn->tiered_mgr_tid_set = false; - } /* Destroy all condition variables after threads have stopped. */ __wt_cond_destroy(session, &conn->tiered_cond); __wt_cond_destroy(session, &conn->tiered_mgr_cond); |