diff options
Diffstat (limited to 'src/mongo/db/repl')
35 files changed, 72 insertions, 22 deletions
diff --git a/src/mongo/db/repl/SConscript b/src/mongo/db/repl/SConscript index dfd9127b3c6..660198f7f47 100644 --- a/src/mongo/db/repl/SConscript +++ b/src/mongo/db/repl/SConscript @@ -61,7 +61,6 @@ env.Library( 'database_task', 'task_runner', 'storage_interface', - '$BUILD_DIR/mongo/client/remote_command_runner', '$BUILD_DIR/mongo/executor/network_interface', '$BUILD_DIR/mongo/executor/task_executor_interface', '$BUILD_DIR/mongo/util/foundation', diff --git a/src/mongo/db/repl/base_cloner_test_fixture.cpp b/src/mongo/db/repl/base_cloner_test_fixture.cpp index 2c0a4a126b6..ea57b00133a 100644 --- a/src/mongo/db/repl/base_cloner_test_fixture.cpp +++ b/src/mongo/db/repl/base_cloner_test_fixture.cpp @@ -38,6 +38,9 @@ namespace mongo { namespace repl { +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; + const HostAndPort BaseClonerTest::target("localhost", -1); const NamespaceString BaseClonerTest::nss("db.coll"); const BSONObj BaseClonerTest::idIndexSpec = BSON("v" << 1 << "key" << BSON("_id" << 1) << "name" diff --git a/src/mongo/db/repl/check_quorum_for_config_change.cpp b/src/mongo/db/repl/check_quorum_for_config_change.cpp index 437dca34701..4d944c9101d 100644 --- a/src/mongo/db/repl/check_quorum_for_config_change.cpp +++ b/src/mongo/db/repl/check_quorum_for_config_change.cpp @@ -45,6 +45,8 @@ namespace mongo { namespace repl { +using executor::RemoteCommandRequest; + QuorumChecker::QuorumChecker(const ReplicaSetConfig* rsConfig, int myIndex) : _rsConfig(rsConfig), _myIndex(myIndex), diff --git a/src/mongo/db/repl/check_quorum_for_config_change.h b/src/mongo/db/repl/check_quorum_for_config_change.h index 5d33c01f4c1..f5cc2795281 100644 --- a/src/mongo/db/repl/check_quorum_for_config_change.h +++ b/src/mongo/db/repl/check_quorum_for_config_change.h @@ -60,8 +60,8 @@ public: QuorumChecker(const ReplicaSetConfig* rsConfig, int myIndex); virtual ~QuorumChecker(); - virtual std::vector<RemoteCommandRequest> getRequests() const; - virtual void processResponse(const RemoteCommandRequest& request, + virtual std::vector<executor::RemoteCommandRequest> getRequests() const; + virtual void processResponse(const executor::RemoteCommandRequest& request, const ResponseStatus& response); virtual bool hasReceivedSufficientResponses() const; @@ -82,7 +82,7 @@ private: /** * Updates the QuorumChecker state based on the data from a single heartbeat response. */ - void _tabulateHeartbeatResponse(const RemoteCommandRequest& request, + void _tabulateHeartbeatResponse(const executor::RemoteCommandRequest& request, const ResponseStatus& response); // Pointer to the replica set configuration for which we're checking quorum. diff --git a/src/mongo/db/repl/check_quorum_for_config_change_test.cpp b/src/mongo/db/repl/check_quorum_for_config_change_test.cpp index cd39fecf18b..475992e83fe 100644 --- a/src/mongo/db/repl/check_quorum_for_config_change_test.cpp +++ b/src/mongo/db/repl/check_quorum_for_config_change_test.cpp @@ -64,6 +64,8 @@ namespace repl { namespace { using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; class CheckQuorumTest : public mongo::unittest::Test { protected: diff --git a/src/mongo/db/repl/data_replicator.h b/src/mongo/db/repl/data_replicator.h index bff81058859..bd3fd86101e 100644 --- a/src/mongo/db/repl/data_replicator.h +++ b/src/mongo/db/repl/data_replicator.h @@ -65,8 +65,8 @@ using Event = ReplicationExecutor::EventHandle; using Handle = ReplicationExecutor::CallbackHandle; using LockGuard = stdx::lock_guard<stdx::mutex>; using NextAction = Fetcher::NextAction; -using Request = RemoteCommandRequest; -using Response = RemoteCommandResponse; +using Request = executor::RemoteCommandRequest; +using Response = executor::RemoteCommandResponse; using TimestampStatus = StatusWith<Timestamp>; using UniqueLock = stdx::unique_lock<stdx::mutex>; diff --git a/src/mongo/db/repl/data_replicator_test.cpp b/src/mongo/db/repl/data_replicator_test.cpp index e28b3b1fd1e..d6c5dadfacc 100644 --- a/src/mongo/db/repl/data_replicator_test.cpp +++ b/src/mongo/db/repl/data_replicator_test.cpp @@ -56,6 +56,8 @@ namespace { using namespace mongo; using namespace mongo::repl; using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; using LockGuard = stdx::lock_guard<stdx::mutex>; using UniqueLock = stdx::unique_lock<stdx::mutex>; using mutex = stdx::mutex; diff --git a/src/mongo/db/repl/elect_cmd_runner.cpp b/src/mongo/db/repl/elect_cmd_runner.cpp index c0d958c428e..15bf827b1da 100644 --- a/src/mongo/db/repl/elect_cmd_runner.cpp +++ b/src/mongo/db/repl/elect_cmd_runner.cpp @@ -42,6 +42,8 @@ namespace mongo { namespace repl { +using executor::RemoteCommandRequest; + ElectCmdRunner::Algorithm::Algorithm(const ReplicaSetConfig& rsConfig, int selfIndex, const std::vector<HostAndPort>& targets, diff --git a/src/mongo/db/repl/elect_cmd_runner.h b/src/mongo/db/repl/elect_cmd_runner.h index 21295991f26..ad12703b68e 100644 --- a/src/mongo/db/repl/elect_cmd_runner.h +++ b/src/mongo/db/repl/elect_cmd_runner.h @@ -57,8 +57,8 @@ public: OID round); virtual ~Algorithm(); - virtual std::vector<RemoteCommandRequest> getRequests() const; - virtual void processResponse(const RemoteCommandRequest& request, + virtual std::vector<executor::RemoteCommandRequest> getRequests() const; + virtual void processResponse(const executor::RemoteCommandRequest& request, const ResponseStatus& response); virtual bool hasReceivedSufficientResponses() const; diff --git a/src/mongo/db/repl/elect_cmd_runner_test.cpp b/src/mongo/db/repl/elect_cmd_runner_test.cpp index 561fa8e5b1f..5635f177cc0 100644 --- a/src/mongo/db/repl/elect_cmd_runner_test.cpp +++ b/src/mongo/db/repl/elect_cmd_runner_test.cpp @@ -48,6 +48,8 @@ namespace repl { namespace { using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; class ElectCmdRunnerTest : public mongo::unittest::Test { public: diff --git a/src/mongo/db/repl/election_winner_declarer.cpp b/src/mongo/db/repl/election_winner_declarer.cpp index 55016dc373a..9cb43a4c54b 100644 --- a/src/mongo/db/repl/election_winner_declarer.cpp +++ b/src/mongo/db/repl/election_winner_declarer.cpp @@ -41,6 +41,8 @@ namespace mongo { namespace repl { +using executor::RemoteCommandRequest; + ElectionWinnerDeclarer::Algorithm::Algorithm(const std::string& setName, long long winnerId, long long term, diff --git a/src/mongo/db/repl/election_winner_declarer.h b/src/mongo/db/repl/election_winner_declarer.h index 8c5fa995880..c73f2ca3419 100644 --- a/src/mongo/db/repl/election_winner_declarer.h +++ b/src/mongo/db/repl/election_winner_declarer.h @@ -57,8 +57,8 @@ public: long long term, const std::vector<HostAndPort>& targets); virtual ~Algorithm(); - virtual std::vector<RemoteCommandRequest> getRequests() const; - virtual void processResponse(const RemoteCommandRequest& request, + virtual std::vector<executor::RemoteCommandRequest> getRequests() const; + virtual void processResponse(const executor::RemoteCommandRequest& request, const ResponseStatus& response); virtual bool hasReceivedSufficientResponses() const; diff --git a/src/mongo/db/repl/election_winner_declarer_test.cpp b/src/mongo/db/repl/election_winner_declarer_test.cpp index f1bdb7e5af7..ce7cf5f7952 100644 --- a/src/mongo/db/repl/election_winner_declarer_test.cpp +++ b/src/mongo/db/repl/election_winner_declarer_test.cpp @@ -45,6 +45,8 @@ namespace repl { namespace { using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; using unittest::assertGet; bool stringContains(const std::string& haystack, const std::string& needle) { diff --git a/src/mongo/db/repl/freshness_checker.cpp b/src/mongo/db/repl/freshness_checker.cpp index ca1d665dd81..71b7b2e419b 100644 --- a/src/mongo/db/repl/freshness_checker.cpp +++ b/src/mongo/db/repl/freshness_checker.cpp @@ -46,6 +46,8 @@ namespace mongo { namespace repl { +using executor::RemoteCommandRequest; + FreshnessChecker::Algorithm::Algorithm(Timestamp lastOpTimeApplied, const ReplicaSetConfig& rsConfig, int selfIndex, diff --git a/src/mongo/db/repl/freshness_checker.h b/src/mongo/db/repl/freshness_checker.h index 11515bfc0ad..43dd77eee69 100644 --- a/src/mongo/db/repl/freshness_checker.h +++ b/src/mongo/db/repl/freshness_checker.h @@ -64,8 +64,8 @@ public: int selfIndex, const std::vector<HostAndPort>& targets); virtual ~Algorithm(); - virtual std::vector<RemoteCommandRequest> getRequests() const; - virtual void processResponse(const RemoteCommandRequest& request, + virtual std::vector<executor::RemoteCommandRequest> getRequests() const; + virtual void processResponse(const executor::RemoteCommandRequest& request, const ResponseStatus& response); virtual bool hasReceivedSufficientResponses() const; ElectionAbortReason shouldAbortElection() const; diff --git a/src/mongo/db/repl/freshness_checker_test.cpp b/src/mongo/db/repl/freshness_checker_test.cpp index e476a0e6034..a8a269b627b 100644 --- a/src/mongo/db/repl/freshness_checker_test.cpp +++ b/src/mongo/db/repl/freshness_checker_test.cpp @@ -49,6 +49,8 @@ namespace repl { namespace { using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; using unittest::assertGet; bool stringContains(const std::string& haystack, const std::string& needle) { diff --git a/src/mongo/db/repl/replication_coordinator_impl_elect_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_elect_test.cpp index b187ccd74c2..1eb90c747ac 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_elect_test.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_elect_test.cpp @@ -49,6 +49,8 @@ namespace repl { namespace { using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; class ReplCoordElectTest : public ReplCoordTest { protected: diff --git a/src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp index 2125f152d17..82c322e4b24 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_elect_v1_test.cpp @@ -49,6 +49,8 @@ namespace repl { namespace { using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; class ReplCoordElectV1Test : public ReplCoordTest { protected: diff --git a/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp b/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp index dd8652f5f8d..0c12e546e47 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_heartbeat.cpp @@ -62,6 +62,8 @@ typedef ReplicationExecutor::CallbackHandle CBHandle; } // namespace +using executor::RemoteCommandRequest; + void ReplicationCoordinatorImpl::_doMemberHeartbeat(ReplicationExecutor::CallbackArgs cbData, const HostAndPort& target, int targetIndex) { diff --git a/src/mongo/db/repl/replication_coordinator_impl_heartbeat_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_heartbeat_test.cpp index f992bf8e94b..fa9843b15ad 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_heartbeat_test.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_heartbeat_test.cpp @@ -48,6 +48,8 @@ namespace repl { namespace { using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; class ReplCoordHBTest : public ReplCoordTest { protected: diff --git a/src/mongo/db/repl/replication_coordinator_impl_heartbeat_v1_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_heartbeat_v1_test.cpp index 51c23f53c1b..6ab99d225f1 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_heartbeat_v1_test.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_heartbeat_v1_test.cpp @@ -48,6 +48,8 @@ namespace repl { namespace { using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; class ReplCoordHBV1Test : public ReplCoordTest { protected: diff --git a/src/mongo/db/repl/replication_coordinator_impl_reconfig_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_reconfig_test.cpp index 6255e799d67..a40521f9bf0 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_reconfig_test.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_reconfig_test.cpp @@ -48,6 +48,9 @@ namespace repl { namespace { using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; + typedef ReplicationCoordinator::ReplSetReconfigArgs ReplSetReconfigArgs; TEST_F(ReplCoordTest, ReconfigBeforeInitialized) { diff --git a/src/mongo/db/repl/replication_coordinator_impl_test.cpp b/src/mongo/db/repl/replication_coordinator_impl_test.cpp index ab6edb18c0e..87f4ebb9462 100644 --- a/src/mongo/db/repl/replication_coordinator_impl_test.cpp +++ b/src/mongo/db/repl/replication_coordinator_impl_test.cpp @@ -69,6 +69,9 @@ namespace repl { namespace { using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; + typedef ReplicationCoordinator::ReplSetReconfigArgs ReplSetReconfigArgs; Status kInterruptedStatus(ErrorCodes::Interrupted, "operation was interrupted"); diff --git a/src/mongo/db/repl/replication_coordinator_test_fixture.cpp b/src/mongo/db/repl/replication_coordinator_test_fixture.cpp index d76a7fb4c63..ef5a28e3616 100644 --- a/src/mongo/db/repl/replication_coordinator_test_fixture.cpp +++ b/src/mongo/db/repl/replication_coordinator_test_fixture.cpp @@ -57,6 +57,8 @@ bool stringContains(const std::string& haystack, const std::string& needle) { } // namespace using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; ReplicaSetConfig ReplCoordTest::assertMakeRSConfig(const BSONObj& configBson) { ReplicaSetConfig config; diff --git a/src/mongo/db/repl/replication_executor.cpp b/src/mongo/db/repl/replication_executor.cpp index 990737d96db..ff1918416a0 100644 --- a/src/mongo/db/repl/replication_executor.cpp +++ b/src/mongo/db/repl/replication_executor.cpp @@ -49,6 +49,8 @@ stdx::function<void()> makeNoExcept(const stdx::function<void()>& fn); } // namespace using executor::NetworkInterface; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; ReplicationExecutor::ReplicationExecutor(NetworkInterface* netInterface, StorageInterface* storageInterface, diff --git a/src/mongo/db/repl/replication_executor.h b/src/mongo/db/repl/replication_executor.h index f20a288b40c..31bf37c505f 100644 --- a/src/mongo/db/repl/replication_executor.h +++ b/src/mongo/db/repl/replication_executor.h @@ -34,7 +34,6 @@ #include "mongo/base/status.h" #include "mongo/base/status_with.h" #include "mongo/base/string_data.h" -#include "mongo/client/remote_command_runner.h" #include "mongo/db/concurrency/lock_manager_defs.h" #include "mongo/db/repl/task_runner.h" #include "mongo/executor/task_executor.h" @@ -119,7 +118,7 @@ public: void waitForEvent(const EventHandle& event) override; StatusWith<CallbackHandle> scheduleWork(const CallbackFn& work) override; StatusWith<CallbackHandle> scheduleWorkAt(Date_t when, const CallbackFn& work) override; - StatusWith<CallbackHandle> scheduleRemoteCommand(const RemoteCommandRequest& request, + StatusWith<CallbackHandle> scheduleRemoteCommand(const executor::RemoteCommandRequest& request, const RemoteCommandCallbackFn& cb) override; void cancel(const CallbackHandle& cbHandle) override; void wait(const CallbackHandle& cbHandle) override; @@ -262,8 +261,8 @@ private: */ void finishShutdown(); - void _finishRemoteCommand(const RemoteCommandRequest& request, - const StatusWith<RemoteCommandResponse>& response, + void _finishRemoteCommand(const executor::RemoteCommandRequest& request, + const StatusWith<executor::RemoteCommandResponse>& response, const CallbackHandle& cbHandle, const uint64_t expectedHandleGeneration, const RemoteCommandCallbackFn& cb); diff --git a/src/mongo/db/repl/replication_executor_test_fixture.h b/src/mongo/db/repl/replication_executor_test_fixture.h index f2e8257f4c8..f7bd59a8672 100644 --- a/src/mongo/db/repl/replication_executor_test_fixture.h +++ b/src/mongo/db/repl/replication_executor_test_fixture.h @@ -29,6 +29,7 @@ #pragma once #include "mongo/stdx/memory.h" +#include "mongo/db/repl/replication_executor.h" #include "mongo/executor/task_executor_test_fixture.h" #include "mongo/unittest/unittest.h" diff --git a/src/mongo/db/repl/reporter.cpp b/src/mongo/db/repl/reporter.cpp index 23f797fe51c..fbbc4d64d33 100644 --- a/src/mongo/db/repl/reporter.cpp +++ b/src/mongo/db/repl/reporter.cpp @@ -38,6 +38,8 @@ namespace mongo { namespace repl { +using executor::RemoteCommandRequest; + Reporter::Reporter(ReplicationExecutor* executor, PrepareReplSetUpdatePositionCommandFn prepareReplSetUpdatePositionCommandFn, const HostAndPort& target) diff --git a/src/mongo/db/repl/reporter_test.cpp b/src/mongo/db/repl/reporter_test.cpp index 6781341d07d..c5533d7adb2 100644 --- a/src/mongo/db/repl/reporter_test.cpp +++ b/src/mongo/db/repl/reporter_test.cpp @@ -39,6 +39,8 @@ namespace { using namespace mongo; using namespace mongo::repl; using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; class MockProgressManager { public: diff --git a/src/mongo/db/repl/scatter_gather_algorithm.h b/src/mongo/db/repl/scatter_gather_algorithm.h index c5e06e4d3c9..a622473c5ee 100644 --- a/src/mongo/db/repl/scatter_gather_algorithm.h +++ b/src/mongo/db/repl/scatter_gather_algorithm.h @@ -57,12 +57,12 @@ public: /** * Returns the list of requests that should be sent. */ - virtual std::vector<RemoteCommandRequest> getRequests() const = 0; + virtual std::vector<executor::RemoteCommandRequest> getRequests() const = 0; /** * Method to call once for each received response. */ - virtual void processResponse(const RemoteCommandRequest& request, + virtual void processResponse(const executor::RemoteCommandRequest& request, const ResponseStatus& response) = 0; /** diff --git a/src/mongo/db/repl/scatter_gather_runner.cpp b/src/mongo/db/repl/scatter_gather_runner.cpp index 6161f71db63..16c778399d0 100644 --- a/src/mongo/db/repl/scatter_gather_runner.cpp +++ b/src/mongo/db/repl/scatter_gather_runner.cpp @@ -41,6 +41,8 @@ namespace mongo { namespace repl { +using executor::RemoteCommandRequest; + ScatterGatherRunner::ScatterGatherRunner(ScatterGatherAlgorithm* algorithm) : _algorithm(algorithm), _started(false) {} diff --git a/src/mongo/db/repl/scatter_gather_test.cpp b/src/mongo/db/repl/scatter_gather_test.cpp index 8721a201ab0..6e4c11a65e0 100644 --- a/src/mongo/db/repl/scatter_gather_test.cpp +++ b/src/mongo/db/repl/scatter_gather_test.cpp @@ -42,6 +42,8 @@ namespace repl { namespace { using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; /** * Algorithm for testing the ScatterGatherRunner, which will finish running when finish() is diff --git a/src/mongo/db/repl/vote_requester.cpp b/src/mongo/db/repl/vote_requester.cpp index c23bd7d6916..5f0683d0aee 100644 --- a/src/mongo/db/repl/vote_requester.cpp +++ b/src/mongo/db/repl/vote_requester.cpp @@ -42,6 +42,8 @@ namespace mongo { namespace repl { +using executor::RemoteCommandRequest; + VoteRequester::Algorithm::Algorithm(const ReplicaSetConfig& rsConfig, long long candidateId, long long term, diff --git a/src/mongo/db/repl/vote_requester.h b/src/mongo/db/repl/vote_requester.h index 8000d12ddb8..673af6c0415 100644 --- a/src/mongo/db/repl/vote_requester.h +++ b/src/mongo/db/repl/vote_requester.h @@ -66,8 +66,8 @@ public: bool dryRun, OpTime lastOplogEntry); virtual ~Algorithm(); - virtual std::vector<RemoteCommandRequest> getRequests() const; - virtual void processResponse(const RemoteCommandRequest& request, + virtual std::vector<executor::RemoteCommandRequest> getRequests() const; + virtual void processResponse(const executor::RemoteCommandRequest& request, const ResponseStatus& response); virtual bool hasReceivedSufficientResponses() const; diff --git a/src/mongo/db/repl/vote_requester_test.cpp b/src/mongo/db/repl/vote_requester_test.cpp index 98543df392d..d169344c2e6 100644 --- a/src/mongo/db/repl/vote_requester_test.cpp +++ b/src/mongo/db/repl/vote_requester_test.cpp @@ -45,10 +45,10 @@ namespace repl { namespace { using executor::NetworkInterfaceMock; +using executor::RemoteCommandRequest; +using executor::RemoteCommandResponse; using unittest::assertGet; -using RemoteCommandRequest = RemoteCommandRequest; - bool stringContains(const std::string& haystack, const std::string& needle) { return haystack.find(needle) != std::string::npos; } |