mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
SERVER-49706 Repair should not write documents with duplicate keys to local.system collections
This commit is contained in:
parent
992cff8ecb
commit
5d8f238387
@ -13,7 +13,7 @@ load("jstests/libs/uuid_util.js");
|
||||
const baseName = "repair_duplicate_keys";
|
||||
const localBaseName = "local";
|
||||
const collName = "test";
|
||||
const lostAndFoundCollBaseName = "system.lost_and_found.";
|
||||
const lostAndFoundCollBaseName = "lost_and_found.";
|
||||
|
||||
const dbpath = MongoRunner.dataPath + baseName + "/";
|
||||
const indexName = "a_1";
|
||||
|
@ -224,8 +224,8 @@ StatusWith<std::pair<long long, long long>> IndexBuildsManager::startBuildingInd
|
||||
long long recordsRemoved = 0;
|
||||
long long bytesRemoved = 0;
|
||||
|
||||
const NamespaceString lostAndFoundNss = NamespaceString(
|
||||
NamespaceString::kLocalDb, "system.lost_and_found." + coll->uuid().toString());
|
||||
const NamespaceString lostAndFoundNss =
|
||||
NamespaceString(NamespaceString::kLocalDb, "lost_and_found." + coll->uuid().toString());
|
||||
|
||||
// Delete duplicate record and insert it into local lost and found.
|
||||
Status status = [&] {
|
||||
@ -400,9 +400,10 @@ StatusWith<MultiIndexBlock*> IndexBuildsManager::_getBuilder(const UUID& buildUU
|
||||
return builderIt->second.get();
|
||||
}
|
||||
|
||||
StatusWith<int> IndexBuildsManager::_moveRecordToLostAndFound(OperationContext* opCtx,
|
||||
NamespaceString nss,
|
||||
NamespaceString lostAndFoundNss,
|
||||
StatusWith<int> IndexBuildsManager::_moveRecordToLostAndFound(
|
||||
OperationContext* opCtx,
|
||||
const NamespaceString& nss,
|
||||
const NamespaceString& lostAndFoundNss,
|
||||
RecordId dupRecord) {
|
||||
invariant(opCtx->lockState()->isCollectionLockedForMode(nss, MODE_IX));
|
||||
|
||||
|
@ -219,12 +219,12 @@ private:
|
||||
|
||||
/**
|
||||
* Deletes record containing duplicate keys and insert it into a local lost and found collection
|
||||
* titled "local.system.lost_and_found.<original collection UUID>". Returns the size of the
|
||||
* titled "local.lost_and_found.<original collection UUID>". Returns the size of the
|
||||
* record removed.
|
||||
*/
|
||||
StatusWith<int> _moveRecordToLostAndFound(OperationContext* opCtx,
|
||||
NamespaceString ns,
|
||||
NamespaceString lostAndFoundNss,
|
||||
const NamespaceString& ns,
|
||||
const NamespaceString& lostAndFoundNss,
|
||||
RecordId dupRecord);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user