diff options
author | Gregory Wlodarek <gregory.wlodarek@mongodb.com> | 2020-06-04 12:37:15 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-06-04 17:00:43 +0000 |
commit | 0e08b33037f30094e9e213eacfe16fe88b52ff84 (patch) | |
tree | 42da2523334f8e097b7576eb0f5639a74639e439 | |
parent | 37ff80f6234137fd314d00e2cd1ff77cde90ce11 (diff) | |
download | mongo-0e08b33037f30094e9e213eacfe16fe88b52ff84.tar.gz |
Revert "SERVER-48332 Failed initial sync attempts should abort all in-progress index builds before retrying"
This reverts commit ec28479e742b52c4aa036a804820bbe8aa4afd32.
-rw-r--r-- | src/mongo/db/index_builds_coordinator.cpp | 15 | ||||
-rw-r--r-- | src/mongo/db/index_builds_coordinator.h | 11 | ||||
-rw-r--r-- | src/mongo/db/repl/SConscript | 2 | ||||
-rw-r--r-- | src/mongo/db/repl/initial_syncer.cpp | 8 | ||||
-rw-r--r-- | src/mongo/db/repl/initial_syncer_test.cpp | 2 |
5 files changed, 0 insertions, 38 deletions
diff --git a/src/mongo/db/index_builds_coordinator.cpp b/src/mongo/db/index_builds_coordinator.cpp index 10d1e2ac0b3..e58cee5ca31 100644 --- a/src/mongo/db/index_builds_coordinator.cpp +++ b/src/mongo/db/index_builds_coordinator.cpp @@ -623,21 +623,6 @@ void IndexBuildsCoordinator::abortDatabaseIndexBuilds(OperationContext* opCtx, } } -void IndexBuildsCoordinator::abortAllIndexBuildsForInitialSync(OperationContext* opCtx, - const std::string& reason) { - LOGV2(4833200, "About to abort all index builders running", "reason"_attr = reason); - - auto builds = [&]() -> std::vector<std::shared_ptr<ReplIndexBuildState>> { - stdx::unique_lock<Latch> lk(_mutex); - auto indexBuildFilter = [](const auto& replState) { return true; }; - return _filterIndexBuilds_inlock(lk, indexBuildFilter); - }(); - for (auto replState : builds) { - abortIndexBuildByBuildUUID( - opCtx, replState->buildUUID, IndexBuildAction::kInitialSyncAbort, reason); - } -} - namespace { NamespaceString getNsFromUUID(OperationContext* opCtx, const UUID& uuid) { auto& catalog = CollectionCatalog::get(opCtx); diff --git a/src/mongo/db/index_builds_coordinator.h b/src/mongo/db/index_builds_coordinator.h index 62f0e06b338..db8040fd227 100644 --- a/src/mongo/db/index_builds_coordinator.h +++ b/src/mongo/db/index_builds_coordinator.h @@ -232,17 +232,6 @@ public: const std::string& reason); /** - * Signals all of the index builds to abort and then waits until the index builds are no longer - * running. The provided 'reason' will be used in the error message that the index builders - * return to their callers. - * - * Does not require holding locks. - * - * Does not stop new index builds from starting. Caller must make that guarantee. - */ - void abortAllIndexBuildsForInitialSync(OperationContext* opCtx, const std::string& reason); - - /** * Aborts an index build by index build UUID. Returns when the index build thread exits. * * Returns true if the index build was aborted or the index build is already in the process of diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript index b4900aa5c8e..4ad8d93386f 100644 --- a/src/mongo/db/repl/SConscript +++ b/src/mongo/db/repl/SConscript @@ -1100,7 +1100,6 @@ env.Library( LIBDEPS_PRIVATE=[ 'repl_server_parameters', '$BUILD_DIR/mongo/db/commands/feature_compatibility_parsers', - '$BUILD_DIR/mongo/db/index_builds_coordinator_interface', ] ) @@ -1284,7 +1283,6 @@ env.CppUnitTest( '$BUILD_DIR/mongo/db/commands/mongod_fcv', '$BUILD_DIR/mongo/db/commands/txn_cmd_request', '$BUILD_DIR/mongo/db/dbdirectclient', - '$BUILD_DIR/mongo/db/index_builds_coordinator_mongod', '$BUILD_DIR/mongo/db/index/index_access_methods', '$BUILD_DIR/mongo/db/logical_session_id_helpers', '$BUILD_DIR/mongo/db/logical_time', diff --git a/src/mongo/db/repl/initial_syncer.cpp b/src/mongo/db/repl/initial_syncer.cpp index 86fa399d5f1..446723111fa 100644 --- a/src/mongo/db/repl/initial_syncer.cpp +++ b/src/mongo/db/repl/initial_syncer.cpp @@ -46,7 +46,6 @@ #include "mongo/db/commands/feature_compatibility_version_parser.h" #include "mongo/db/commands/server_status_metric.h" #include "mongo/db/concurrency/d_concurrency.h" -#include "mongo/db/index_builds_coordinator.h" #include "mongo/db/jsobj.h" #include "mongo/db/namespace_string.h" #include "mongo/db/repl/all_database_cloner.h" @@ -1703,13 +1702,6 @@ void InitialSyncer::_finishInitialSyncAttempt(const StatusWith<OpTimeAndWallTime (_stats.maxFailedInitialSyncAttempts - _stats.failedInitialSyncAttempts), "error"_attr = redact(result.getStatus())); - { - // Abort any index builds started during initial sync. - auto opCtx = cc().makeOperationContext(); - IndexBuildsCoordinator::get(opCtx.get()) - ->abortAllIndexBuildsForInitialSync(opCtx.get(), "Initial sync attempt failed"); - } - // Check if need to do more retries. if (_stats.failedInitialSyncAttempts >= _stats.maxFailedInitialSyncAttempts) { LOGV2_FATAL_CONTINUE(21202, diff --git a/src/mongo/db/repl/initial_syncer_test.cpp b/src/mongo/db/repl/initial_syncer_test.cpp index 6b7138aaa8e..489b885784c 100644 --- a/src/mongo/db/repl/initial_syncer_test.cpp +++ b/src/mongo/db/repl/initial_syncer_test.cpp @@ -37,7 +37,6 @@ #include "mongo/db/client.h" #include "mongo/db/commands/feature_compatibility_version_parser.h" -#include "mongo/db/index_builds_coordinator_mongod.h" #include "mongo/db/json.h" #include "mongo/db/namespace_string.h" #include "mongo/db/query/getmore_request.h" @@ -355,7 +354,6 @@ protected: // Required by CollectionCloner::listIndexesStage() and IndexBuildsCoordinator. service->setStorageEngine(std::make_unique<StorageEngineMock>()); - IndexBuildsCoordinator::set(service, std::make_unique<IndexBuildsCoordinatorMongod>()); _target = HostAndPort{"localhost:12346"}; _mockServer = std::make_unique<MockRemoteDBServer>(_target.toString()); |