summaryrefslogtreecommitdiff
path: root/src/mongo/db/index
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2020-03-24 16:53:15 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-02 16:38:50 +0000
commite896d4dca291ba0ef3f9a63779c210780637336b (patch)
tree9019d297505f7a324f62c88cd209d1333e34730e /src/mongo/db/index
parent41710b8842747067e82f1ac3cc46acd4fab75008 (diff)
downloadmongo-e896d4dca291ba0ef3f9a63779c210780637336b.tar.gz
SERVER-46895 Do not check duplicate key violations on index builds during oplog application phase of initial sync
(cherry picked from commit 45db64dd0947fa13373a0ed03ce7c3da9d97f12b)
Diffstat (limited to 'src/mongo/db/index')
-rw-r--r--src/mongo/db/index/duplicate_key_tracker.cpp11
-rw-r--r--src/mongo/db/index/duplicate_key_tracker.h6
-rw-r--r--src/mongo/db/index/index_build_interceptor.cpp7
-rw-r--r--src/mongo/db/index/index_build_interceptor.h6
4 files changed, 0 insertions, 30 deletions
diff --git a/src/mongo/db/index/duplicate_key_tracker.cpp b/src/mongo/db/index/duplicate_key_tracker.cpp
index b334ec5c481..5ddec2d8e74 100644
--- a/src/mongo/db/index/duplicate_key_tracker.cpp
+++ b/src/mongo/db/index/duplicate_key_tracker.cpp
@@ -151,15 +151,4 @@ Status DuplicateKeyTracker::checkConstraints(OperationContext* opCtx) const {
return Status::OK();
}
-bool DuplicateKeyTracker::areAllConstraintsChecked(OperationContext* opCtx) const {
- auto cursor = _keyConstraintsTable->rs()->getCursor(opCtx);
- auto record = cursor->next();
-
- // The table is empty only when there are no more constraints to check.
- if (!record)
- return true;
-
- return false;
-}
-
} // namespace mongo
diff --git a/src/mongo/db/index/duplicate_key_tracker.h b/src/mongo/db/index/duplicate_key_tracker.h
index 391a7d673a7..5034bca4c02 100644
--- a/src/mongo/db/index/duplicate_key_tracker.h
+++ b/src/mongo/db/index/duplicate_key_tracker.h
@@ -76,12 +76,6 @@ public:
*/
Status checkConstraints(OperationContext* opCtx) const;
- /**
- * Returns true if all recorded duplicate key constraint violations have been deleted from the
- * temporary record store.
- */
- bool areAllConstraintsChecked(OperationContext* opCtx) const;
-
private:
const IndexCatalogEntry* _indexCatalogEntry;
diff --git a/src/mongo/db/index/index_build_interceptor.cpp b/src/mongo/db/index/index_build_interceptor.cpp
index c1b53479b50..77d87b00a4b 100644
--- a/src/mongo/db/index/index_build_interceptor.cpp
+++ b/src/mongo/db/index/index_build_interceptor.cpp
@@ -116,13 +116,6 @@ Status IndexBuildInterceptor::checkDuplicateKeyConstraints(OperationContext* opC
return _duplicateKeyTracker->checkConstraints(opCtx);
}
-bool IndexBuildInterceptor::areAllConstraintsChecked(OperationContext* opCtx) const {
- if (!_duplicateKeyTracker) {
- return true;
- }
- return _duplicateKeyTracker->areAllConstraintsChecked(opCtx);
-}
-
Status IndexBuildInterceptor::drainWritesIntoIndex(OperationContext* opCtx,
const InsertDeleteOptions& options,
TrackDuplicates trackDuplicates,
diff --git a/src/mongo/db/index/index_build_interceptor.h b/src/mongo/db/index/index_build_interceptor.h
index ded0aaa1e33..695cbfd3e39 100644
--- a/src/mongo/db/index/index_build_interceptor.h
+++ b/src/mongo/db/index/index_build_interceptor.h
@@ -159,12 +159,6 @@ public:
bool areAllWritesApplied(OperationContext* opCtx) const;
/**
- * Returns true if all recorded duplicate key constraint violations have been checked.
- */
- bool areAllConstraintsChecked(OperationContext* opCtx) const;
-
-
- /**
* When an index builder wants to commit, use this to retrieve any recorded multikey paths
* that were tracked during the build.
*/