SERVER-109207 Fix bug in oplog cap maintainer thread run (#40001)

GitOrigin-RevId: b19533124bb495cfd0a6b54edf392cf3e5e8fc72
This commit is contained in:
clarissecheah 2025-08-18 10:17:40 +10:00 committed by MongoDB Bot
parent 05c03f3e8a
commit ed6a5c217e

View File

@ -237,10 +237,11 @@ void OplogCapMaintainerThread::_run() {
AutoGetOplogFastPathOptions{.skipRSTLLock = true,
.explicitIntent =
rss::consensus::IntentRegistry::Intent::Read});
const auto& oplogCollection = oplogRead->getCollection();
rs = oplogCollection->getRecordStore();
if (rs) {
return;
const auto& oplog = oplogRead->getCollection();
if (oplog) {
rs = oplog->getRecordStore();
break;
}
// Wait a bit to give the oplog a chance to be created.
MONGO_IDLE_THREAD_BLOCK;