diff options
author | William Schultz <william.schultz@mongodb.com> | 2017-08-23 13:12:17 -0400 |
---|---|---|
committer | William Schultz <william.schultz@mongodb.com> | 2017-08-23 13:27:17 -0400 |
commit | 8097b23bb419708202b5306133cb57a545d0825b (patch) | |
tree | 1556dcbc854d7f11810803618d310ff52328355b /src/mongo/db/repl/rollback_impl.h | |
parent | ce094a604ba1e11ea220a47c0e6626e18103601a (diff) | |
download | mongo-8097b23bb419708202b5306133cb57a545d0825b.tar.gz |
SERVER-29899 Call recovery logic in rollback
Diffstat (limited to 'src/mongo/db/repl/rollback_impl.h')
-rw-r--r-- | src/mongo/db/repl/rollback_impl.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/mongo/db/repl/rollback_impl.h b/src/mongo/db/repl/rollback_impl.h index 46f4111ec95..b8a6b5b04cf 100644 --- a/src/mongo/db/repl/rollback_impl.h +++ b/src/mongo/db/repl/rollback_impl.h @@ -95,14 +95,24 @@ public: virtual ~Listener() = default; /** - * Function called after we transition to ROLLBACK. + * Function called after we transition to ROLLBACK. */ - virtual void onTransitionToRollback() {} + virtual void onTransitionToRollback() noexcept {} /** - * Function called after we find the common point. + * Function called after we find the common point. */ - virtual void onCommonPointFound(Timestamp commonPoint) {} + virtual void onCommonPointFound(Timestamp commonPoint) noexcept {} + + /** + * Function called after we recover to the stable timestamp. + */ + virtual void onRecoverToStableTimestamp() noexcept {} + + /** + * Function called after we recover from the oplog. + */ + virtual void onRecoverFromOplog() noexcept {} }; /** @@ -159,6 +169,17 @@ private: Status _transitionToRollback(OperationContext* opCtx); /** + * Recovers to the stable timestamp while holding the global exclusive lock. + */ + Status _recoverToStableTimestamp(OperationContext* opCtx); + + /** + * Runs the oplog recovery logic. This involves applying oplog operations between the stable + * timestamp and the common point. + */ + Status _oplogRecovery(OperationContext* opCtx); + + /** * If we detected that we rolled back the shardIdentity document as part of this rollback * then we must shut down the server to clear the in-memory ShardingState associated with the * shardIdentity document. |