diff options
Diffstat (limited to 'src/mongo/db/repl/replication_coordinator_impl.h')
-rw-r--r-- | src/mongo/db/repl/replication_coordinator_impl.h | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/mongo/db/repl/replication_coordinator_impl.h b/src/mongo/db/repl/replication_coordinator_impl.h index a6dc8fe9066..9ac44fdc62e 100644 --- a/src/mongo/db/repl/replication_coordinator_impl.h +++ b/src/mongo/db/repl/replication_coordinator_impl.h @@ -469,7 +469,7 @@ public: executor::TaskExecutor::CallbackHandle getCatchupTakeoverCbh_forTest() const; /** - * Simple wrappers around _setLastOptime to make it easier to test. + * Simple wrappers around _setLastOptimeForMember to make it easier to test. */ Status setLastAppliedOptime_forTest(long long cfgVer, long long memberId, @@ -1099,8 +1099,19 @@ private: * This is only valid to call on replica sets. * "configVersion" will be populated with our config version if it and the configVersion * of "args" differ. + * + * If either applied or durable optime has changed, returns the later of the two (even if + * that's not the one which changed). Otherwise returns a null optime. + */ + StatusWith<OpTime> _setLastOptimeForMember(WithLock lk, + const UpdatePositionArgs::UpdateInfo& args); + + /** + * Helper for processReplSetUpdatePosition, companion to _setLastOptimeForMember above. Updates + * replication coordinator state and notifies waiters after remote optime updates. Must be + * called within the same critical section as _setLastOptimeForMember. */ - Status _setLastOptime(WithLock lk, const UpdatePositionArgs::UpdateInfo& args); + void _updateStateAfterRemoteOpTimeUpdates(WithLock lk, const OpTime& maxRemoteOpTime); /** * This function will report our position externally (like upstream) if necessary. @@ -1463,17 +1474,6 @@ private: EventHandle _processReplSetMetadata_inlock(const rpc::ReplSetMetadata& replMetadata); /** - * Prepares a metadata object for ReplSetMetadata. - */ - void _prepareReplSetMetadata_inlock(const OpTime& lastOpTimeFromClient, - BSONObjBuilder* builder) const; - - /** - * Prepares a metadata object for OplogQueryMetadata. - */ - void _prepareOplogQueryMetadata_inlock(int rbid, BSONObjBuilder* builder) const; - - /** * Blesses a snapshot to be used for new committed reads. * * Returns true if the value was updated to `newCommittedSnapshot`. @@ -1719,9 +1719,6 @@ private: // Current ReplicaSet state. MemberState _memberState; // (M) - // Used to signal threads waiting for changes to _memberState. - stdx::condition_variable _drainFinishedCond; // (M) - ReplicationCoordinator::ApplierState _applierState = ApplierState::Running; // (M) // Used to signal threads waiting for changes to _rsConfigState. |