-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
ALL
-
-
2023-12-12 - Heisenbug
-
2
In SERVER-80123, we found that we were hitting the following assert as we are not holding the lock IX:
dassert(shard_role_details::getLocker(opCtx)->isWriteLocked());
Suggested code change:
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp index 5cdcfabc190..43e2e7a0ea2 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp @@ -632,6 +632,7 @@ void WiredTigerKVEngine::notifyStartupComplete(OperationContext* opCtx) { StorageEngine::AutoCompactOptions options{/*enable=*/true, /*freeSpaceTargetMB=*/boost::none, /*excludedIdents*/ std::vector<StringData>()}; + Lock::GlobalLock lk(opCtx, MODE_IX); auto status = autoCompact(opCtx, options); uassert(8373401, "Failed to execute autoCompact.", status.isOK()); }
- is caused by
-
SERVER-83734 Create a server parameter to enable background compaction on startup
- Closed