diff options
author | Benety Goh <benety@mongodb.com> | 2016-02-23 14:22:11 -0500 |
---|---|---|
committer | Benety Goh <benety@mongodb.com> | 2016-03-10 20:30:51 -0500 |
commit | 052c463c90eb19e73f2e9b2f6fbd4eb669c83855 (patch) | |
tree | 3f7e313a10b8cc09f0429939ee872ede12920dfc /src/mongo/db/repl/sync_source_feedback.h | |
parent | 690e2b3cd215f2d9355451aadc8608e5b3026128 (diff) | |
download | mongo-052c463c90eb19e73f2e9b2f6fbd4eb669c83855.tar.gz |
SERVER-18029 integrated Reporter into SyncSourceFeedback
Diffstat (limited to 'src/mongo/db/repl/sync_source_feedback.h')
-rw-r--r-- | src/mongo/db/repl/sync_source_feedback.h | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/src/mongo/db/repl/sync_source_feedback.h b/src/mongo/db/repl/sync_source_feedback.h index f3fcdca0abc..3d3ea0e4747 100644 --- a/src/mongo/db/repl/sync_source_feedback.h +++ b/src/mongo/db/repl/sync_source_feedback.h @@ -29,17 +29,16 @@ #pragma once -#include "mongo/client/constants.h" -#include "mongo/client/dbclientcursor.h" -#include "mongo/db/repl/replication_coordinator.h" +#include "mongo/base/status.h" #include "mongo/stdx/condition_variable.h" #include "mongo/stdx/mutex.h" -#include "mongo/util/net/hostandport.h" namespace mongo { +struct HostAndPort; class OperationContext; namespace repl { +class Reporter; class SyncSourceFeedback { public: @@ -58,47 +57,22 @@ public: void shutdown(); private: - void _resetConnection(); - - /** - * Authenticates _connection using the server's cluster-membership credentials. - * - * Returns true on successful authentication. - */ - bool replAuthenticate(); - /* Inform the sync target of our current position in the oplog, as well as the positions * of all secondaries chained through us. - * "commandStyle" indicates whether or not the upstream node is pre-3.2.4 and needs the older - * style - * ReplSetUpdatePosition commands as a result. */ - Status updateUpstream(OperationContext* txn, - ReplicationCoordinator::ReplSetUpdatePositionCommandStyle commandStyle); + Status _updateUpstream(OperationContext* txn); - bool hasConnection() { - return _connection.get(); - } - - /// Connect to sync target. - bool _connect(OperationContext* txn, const HostAndPort& host); - - // the member we are currently syncing from - HostAndPort _syncTarget; - // our connection to our sync target - std::unique_ptr<DBClientConnection> _connection; // protects cond, _shutdownSignaled, _keepAliveInterval, and _positionChanged. stdx::mutex _mtx; // used to alert our thread of changes which need to be passed up the chain stdx::condition_variable _cond; - /// _keepAliveInterval indicates how frequently to forward progress in the absence of updates. - Milliseconds _keepAliveInterval = Milliseconds(100); // used to indicate a position change which has not yet been pushed along bool _positionChanged = false; // Once this is set to true the _run method will terminate bool _shutdownSignaled = false; - // Indicates version of the UpdatePosition command accepted by our syncSource. - ReplicationCoordinator::ReplSetUpdatePositionCommandStyle _commandStyle; + // Reports replication progress to sync source. + Reporter* _reporter = nullptr; }; + } // namespace repl } // namespace mongo |