summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2021-11-08 13:51:43 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-23 09:58:43 +0000
commitb6a46beabe55c02587f3938278b970a3af4dc4c8 (patch)
treeab1b374ae4824d7bfd7c63b9742e7c114de6253d
parent6aec2dd4d87e4620b42760ac34cbee855151a608 (diff)
downloadmongo-b6a46beabe55c02587f3938278b970a3af4dc4c8.tar.gz
SERVER-61275 Destruct the size storer after the session cache has shutdown
(cherry picked from commit 81569b78ee627263a8e2240e87d46946971aadde)
-rw-r--r--src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
index f77f5d3d12c..eaf1ea32e06 100644
--- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
+++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp
@@ -977,8 +977,6 @@ void WiredTigerKVEngine::cleanShutdown() {
LOGV2(22317, "WiredTigerKVEngine shutting down");
WiredTigerUtil::resetTableLoggingInfo();
- if (!_readOnly)
- syncSizeInfo(true);
if (!_conn) {
return;
}
@@ -1001,9 +999,18 @@ void WiredTigerKVEngine::cleanShutdown() {
"stableTimestamp_load"_attr = _stableTimestamp.load(),
"initialDataTimestamp_load"_attr = _initialDataTimestamp.load());
- _sizeStorer.reset();
_sessionCache->shuttingDown();
+ if (!_readOnly) {
+ syncSizeInfo(/*syncToDisk=*/true);
+ }
+
+ // The size storer has to be destructed after the session cache has shut down. This sets the
+ // shutdown flag internally in the session cache. As operations get interrupted during shutdown,
+ // they release their session back to the session cache. If the shutdown flag has been set,
+ // released sessions will skip flushing the size storer.
+ _sizeStorer.reset();
+
// We want WiredTiger to leak memory for faster shutdown except when we are running tools to
// look for memory leaks.
bool leak_memory = !kAddressSanitizerEnabled;