summaryrefslogtreecommitdiff
path: root/src/mongo/db/repl/replication_recovery.h
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2020-01-06 17:44:32 +0000
committerevergreen <evergreen@mongodb.com>2020-01-06 17:44:32 +0000
commitd8c8abbbbc716b431ac33ef768a4f71644eda75d (patch)
tree791eaf1c72e1f1ac86fcc8fbd6cf173cefd0acbb /src/mongo/db/repl/replication_recovery.h
parent3842544b5e534b87c9bfc46d9c67b8726fd6b27b (diff)
downloadmongo-d8c8abbbbc716b431ac33ef768a4f71644eda75d.tar.gz
SERVER-44442 Allow queryableBackupMode to perform replication recovery
Diffstat (limited to 'src/mongo/db/repl/replication_recovery.h')
-rw-r--r--src/mongo/db/repl/replication_recovery.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mongo/db/repl/replication_recovery.h b/src/mongo/db/repl/replication_recovery.h
index 72acfbb8d3b..0a891420b54 100644
--- a/src/mongo/db/repl/replication_recovery.h
+++ b/src/mongo/db/repl/replication_recovery.h
@@ -62,6 +62,11 @@ public:
* ensures that recovery can be skipped safely.
*/
virtual void recoverFromOplogAsStandalone(OperationContext* opCtx) = 0;
+
+ /**
+ * Recovers the data on disk from the oplog up to and including the given timestamp.
+ */
+ virtual void recoverFromOplogUpTo(OperationContext* opCtx, Timestamp endPoint) = 0;
};
class ReplicationRecoveryImpl : public ReplicationRecovery {
@@ -77,6 +82,8 @@ public:
void recoverFromOplogAsStandalone(OperationContext* opCtx) override;
+ void recoverFromOplogUpTo(OperationContext* opCtx, Timestamp endPoint) override;
+
private:
/**
* Confirms that the data and oplog all indicate that the nodes has an unstable checkpoint
@@ -102,7 +109,7 @@ private:
OpTime topOfOplog);
/**
- * Applies all oplog entries from oplogApplicationStartPoint (exclusive) to topOfOplog
+ * Applies all oplog entries from oplogApplicationStartPoint (inclusive) to topOfOplog
* (inclusive). This fasserts if oplogApplicationStartPoint is not in the oplog.
*/
void _applyToEndOfOplog(OperationContext* opCtx,
@@ -110,6 +117,14 @@ private:
const Timestamp& topOfOplog);
/**
+ * Applies all oplog entries from startPoint (inclusive) to endPoint (inclusive). Returns the
+ * Timestamp of the last applied operation.
+ */
+ Timestamp _applyOplogOperations(OperationContext* opCtx,
+ const Timestamp& startPoint,
+ const Timestamp& endPoint);
+
+ /**
* Gets the last applied OpTime from the end of the oplog. Returns CollectionIsEmpty if there is
* no oplog.
*/