diff options
author | Judah Schvimer <judah@mongodb.com> | 2018-03-14 12:08:02 -0400 |
---|---|---|
committer | Judah Schvimer <judah@mongodb.com> | 2018-03-14 12:08:08 -0400 |
commit | 2edfc326d51ba09ff83b0305155a006b39eea609 (patch) | |
tree | ac0c18c3c665f032e49167efac79711b644a3d81 /src/mongo/db/repl/rollback_impl.h | |
parent | 8727cdfc81358fa829cb86153606b84efca4edfd (diff) | |
download | mongo-2edfc326d51ba09ff83b0305155a006b39eea609.tar.gz |
SERVER-33600 Rollback cannot set oplogTruncateAfterPoint until recoverToStableTimestamp succeeds
Diffstat (limited to 'src/mongo/db/repl/rollback_impl.h')
-rw-r--r-- | src/mongo/db/repl/rollback_impl.h | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/mongo/db/repl/rollback_impl.h b/src/mongo/db/repl/rollback_impl.h index aa086c1d708..d19da54cac6 100644 --- a/src/mongo/db/repl/rollback_impl.h +++ b/src/mongo/db/repl/rollback_impl.h @@ -64,19 +64,19 @@ class ReplicationProcess; * machinery. This class runs synchronously on the caller's thread. * * Order of actions: - * 1. Transition to ROLLBACK - * 2. Find the common point between the local and remote oplogs. - * a. Keep track of what is rolled back to provide a summary to the user - * b. Write rolled back documents to 'Rollback Files' - * 3. Increment the Rollback ID (RBID) - * 4. Write the common point as the 'OplogTruncateAfterPoint' - * 5. Tell the storage engine to recover to the last stable timestamp - * 6. Call recovery code - * a. Truncate the oplog at the common point + * 1. Transition to ROLLBACK. + * 2. Await background index completion. + * 3. Find the common point between the local and remote oplogs. + * a. Keep track of what is rolled back to provide a summary to the user. + * b. Write rolled back documents to 'Rollback Files'. + * 4. Increment the Rollback ID (RBID). + * 5. Tell the storage engine to recover to the last stable timestamp. + * 6. Write the oplog entry after the common point as the 'OplogTruncateAfterPoint'. + * 7. Call recovery code. + * a. Truncate the oplog at the common point. * b. Apply all oplog entries to the end of oplog. - * 7. Check the shard identity document for roll back - * 8. Clear the in-memory transaction table - * 9. Transition to SECONDARY + * 8. Trigger the on-rollback op observer. + * 9. Transition to SECONDARY. * * If the node crashes while in rollback and the storage engine has not recovered to the last * stable timestamp yet, then rollback will simply restart against the new sync source upon restart. @@ -118,6 +118,11 @@ public: virtual void onRecoverToStableTimestamp(Timestamp stableTimestamp) noexcept {} /** + * Function called after we set the oplog truncate after point. + */ + virtual void onSetOplogTruncateAfterPoint(Timestamp truncatePoint) noexcept {} + + /** * Function called after we recover from the oplog. */ virtual void onRecoverFromOplog() noexcept {} |