diff options
author | Brian DeLeonardis <brian.deleonardis@mongodb.com> | 2020-10-29 00:57:17 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-10-29 15:26:36 +0000 |
commit | e74d2512df1ad2309b46bd9d2d49d0e1628fcc31 (patch) | |
tree | 14587024e120fdd2e42e07c414d44db7412b873f /src/mongo/db | |
parent | ef0f2d453e2397a7a9d1a09da31cb840c7be62f5 (diff) | |
download | mongo-e74d2512df1ad2309b46bd9d2d49d0e1628fcc31.tar.gz |
SERVER-50868 Refactor so insertSingleDocumentForInitialSyncOrRecovery is correctly named
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/catalog/multi_index_block.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/catalog/multi_index_block.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/db/catalog/multi_index_block.cpp b/src/mongo/db/catalog/multi_index_block.cpp index 24ac0c90eb2..37025a4656a 100644 --- a/src/mongo/db/catalog/multi_index_block.cpp +++ b/src/mongo/db/catalog/multi_index_block.cpp @@ -459,7 +459,7 @@ Status MultiIndexBlock::insertAllDocumentsInCollection( // The external sorter is not part of the storage engine and therefore does not need a // WriteUnitOfWork to write keys. - uassertStatusOK(insertSingleDocumentForInitialSyncOrRecovery(opCtx, objToIndex, loc)); + uassertStatusOK(_insert(opCtx, objToIndex, loc)); _failPointHangDuringBuild(opCtx, &hangIndexBuildDuringCollectionScanPhaseAfterInsertion, @@ -552,6 +552,10 @@ Status MultiIndexBlock::insertAllDocumentsInCollection( Status MultiIndexBlock::insertSingleDocumentForInitialSyncOrRecovery(OperationContext* opCtx, const BSONObj& doc, const RecordId& loc) { + return _insert(opCtx, doc, loc); +} + +Status MultiIndexBlock::_insert(OperationContext* opCtx, const BSONObj& doc, const RecordId& loc) { invariant(!_buildIsCleanedUp); for (size_t i = 0; i < _indexes.size(); i++) { if (_indexes[i].filterExpression && !_indexes[i].filterExpression->matchesBSON(doc)) { diff --git a/src/mongo/db/catalog/multi_index_block.h b/src/mongo/db/catalog/multi_index_block.h index 9c82ceb9a3c..8a625a4267b 100644 --- a/src/mongo/db/catalog/multi_index_block.h +++ b/src/mongo/db/catalog/multi_index_block.h @@ -317,6 +317,8 @@ private: const CollectionPtr& collection, const IndexCatalogEntry* refIdx); + Status _insert(OperationContext* opCtx, const BSONObj& wholeDocument, const RecordId& loc); + // Is set during init() and ensures subsequent function calls act on the same Collection. boost::optional<UUID> _collectionUUID; |