diff options
author | Samy Lanka <samy.lanka@mongodb.com> | 2020-07-31 07:20:47 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-08-04 08:33:16 +0000 |
commit | 2fc36d0b12d1c44893a5f3c1fe0ac8fb0125a071 (patch) | |
tree | 735ccccb879cd841d19f953282f1e74a27a21bd1 /src/mongo/db/storage/storage_engine_impl.cpp | |
parent | 4b967fd6c5e679b33922a4d287755ea987dc882c (diff) | |
download | mongo-2fc36d0b12d1c44893a5f3c1fe0ac8fb0125a071.tar.gz |
SERVER-48417 Reconstruct in-memory state when resuming index build
Diffstat (limited to 'src/mongo/db/storage/storage_engine_impl.cpp')
-rw-r--r-- | src/mongo/db/storage/storage_engine_impl.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/db/storage/storage_engine_impl.cpp b/src/mongo/db/storage/storage_engine_impl.cpp index a4590dd850f..93742937d27 100644 --- a/src/mongo/db/storage/storage_engine_impl.cpp +++ b/src/mongo/db/storage/storage_engine_impl.cpp @@ -368,6 +368,11 @@ bool StorageEngineImpl::_handleInternalIdents( reconcileResult->indexBuildsToResume.push_back(resumeInfo); + // Once we have parsed the resume info, we can safely drop the internal ident. + // TODO SERVER-49846: revisit this logic since this could cause the side tables + // associated with the index build to be orphaned if resuming fails. + internalIdentsToDrop->insert(ident); + LOGV2(4916301, "Found unfinished index build to resume", "buildUUID"_attr = resumeInfo.getBuildUUID(), @@ -842,6 +847,12 @@ std::unique_ptr<TemporaryRecordStore> StorageEngineImpl::makeTemporaryRecordStor return std::make_unique<TemporaryKVRecordStore>(getEngine(), std::move(rs)); } +std::unique_ptr<TemporaryRecordStore> StorageEngineImpl::makeTemporaryRecordStoreFromExistingIdent( + OperationContext* opCtx, StringData ident) { + auto rs = _engine->getRecordStore(opCtx, "", ident, CollectionOptions()); + return std::make_unique<TemporaryKVRecordStore>(getEngine(), std::move(rs)); +} + void StorageEngineImpl::setJournalListener(JournalListener* jl) { _engine->setJournalListener(jl); } |