diff options
author | Louis Williams <louis.williams@mongodb.com> | 2021-10-22 15:33:00 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-10-22 16:45:38 +0000 |
commit | 6d9fecf38c44b0739de5b34c9f82d6a4ed9f508b (patch) | |
tree | c066e7e3a2c0b5cccb457b4bbc84db1fa334dd88 /src/mongo/db/index/index_build_interceptor.cpp | |
parent | f674422c7489dca8a9ef4c19a38b26d79a3e9321 (diff) | |
download | mongo-6d9fecf38c44b0739de5b34c9f82d6a4ed9f508b.tar.gz |
SERVER-60639 Defer TemporaryRecordStore dropping to the storage engine
Users of TemporaryRecordStore no longer have to "finalize" by explicitly dropping the temporary table. Instead, tables are queued in the storage engine to be periodically dropped. All storage engines have the ability to support deferring ident drops.
Diffstat (limited to 'src/mongo/db/index/index_build_interceptor.cpp')
-rw-r--r-- | src/mongo/db/index/index_build_interceptor.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/mongo/db/index/index_build_interceptor.cpp b/src/mongo/db/index/index_build_interceptor.cpp index eb6f8893f09..051d2bdb7f7 100644 --- a/src/mongo/db/index/index_build_interceptor.cpp +++ b/src/mongo/db/index/index_build_interceptor.cpp @@ -80,11 +80,6 @@ IndexBuildInterceptor::IndexBuildInterceptor(OperationContext* opCtx, _skippedRecordTracker(opCtx, entry, skippedRecordTrackerIdent), _skipNumAppliedCheck(true) { - ScopeGuard finalizeTableOnFailure([&] { - _sideWritesTable->finalizeTemporaryTable(opCtx, - TemporaryRecordStore::FinalizationAction::kDelete); - }); - auto dupKeyTrackerIdentExists = duplicateKeyTrackerIdent ? true : false; uassert(ErrorCodes::BadValue, str::stream() << "Resume info must contain the duplicate key tracker ident [" @@ -95,17 +90,14 @@ IndexBuildInterceptor::IndexBuildInterceptor(OperationContext* opCtx, _duplicateKeyTracker = std::make_unique<DuplicateKeyTracker>(opCtx, entry, duplicateKeyTrackerIdent.get()); } - - finalizeTableOnFailure.dismiss(); } -void IndexBuildInterceptor::finalizeTemporaryTables( - OperationContext* opCtx, TemporaryRecordStore::FinalizationAction action) { - _sideWritesTable->finalizeTemporaryTable(opCtx, action); +void IndexBuildInterceptor::keepTemporaryTables() { + _sideWritesTable->keep(); if (_duplicateKeyTracker) { - _duplicateKeyTracker->finalizeTemporaryTable(opCtx, action); + _duplicateKeyTracker->keepTemporaryTable(); } - _skippedRecordTracker.finalizeTemporaryTable(opCtx, action); + _skippedRecordTracker.keepTemporaryTable(); } Status IndexBuildInterceptor::recordDuplicateKey(OperationContext* opCtx, |