summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/rollback_impl.h
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2017-04-25 14:46:14 -0400
committerBenety Goh <benety@mongodb.com>2017-05-04 14:49:43 -0400
commit32dccaea13fda911c5367287a39290706380941e (patch)
tree1551a19ce0044e399399e889976e48f5a94d4784 /src/mongo/db/repl/rollback_impl.h
parent566694eb312d7eaaf9e6e756e42cf863ad7f0f58 (diff)
downloadmongo-32dccaea13fda911c5367287a39290706380941e.tar.gz
SERVER-28214 integrate RollbackCommonPointResolver into RollbackImpl
Diffstat (limited to 'src/mongo/db/repl/rollback_impl.h')
-rw-r--r--src/mongo/db/repl/rollback_impl.h21
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.