diff options
Diffstat (limited to 'src/mongo/db/repl/rollback_impl.h')
-rw-r--r-- | src/mongo/db/repl/rollback_impl.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mongo/db/repl/rollback_impl.h b/src/mongo/db/repl/rollback_impl.h index 5bbe64d0a80..cbddbca41e7 100644 --- a/src/mongo/db/repl/rollback_impl.h +++ b/src/mongo/db/repl/rollback_impl.h @@ -28,6 +28,8 @@ #pragma once +#include <memory> + #include "mongo/base/status_with.h" #include "mongo/db/repl/abstract_async_component.h" #include "mongo/db/repl/optime.h" @@ -152,6 +154,10 @@ private: * | * | * V + * _commonPointResolverCallback() + * | + * | + * V * _tearDown() * | * | @@ -169,6 +175,13 @@ private: void _transitionToRollbackCallback(const executor::TaskExecutor::CallbackArgs& callbackArgs); /** + * Callback function invoked when the RollbackCommonPointResolver completes its processing. + * + * This callback is scheduled by _transitionToRollbackCallback(). + */ + void _commonPointResolverCallback(const Status& commonPointResolverStatus); + + /** * 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. @@ -245,6 +258,14 @@ private: // This is used to read and update the global minValid settings and to access the storage layer. StorageInterface* const _storageInterface; // (R) + // Once we are in ROLLBACK, this is used to determine the common point between the local and + // remote oplogs. As we walk the local oplog backwards towards the common point, we will use + // the RollbackFixUpInfo to process each entry (but not including the common point itself). This + // gives us the information we need to roll back the local oplog entries that succeed the common + // point. + std::unique_ptr<RollbackCommonPointResolver::Listener> _listener; // (S) + std::unique_ptr<RollbackCommonPointResolver> _commonPointResolver; // (S) + // This is invoked with the final status of the rollback. If startup() fails, this callback // is never invoked. The caller gets the last applied optime when the rollback completes // successfully or an error status. |