diff options
author | William Schultz <william.schultz@mongodb.com> | 2017-11-28 16:20:05 -0500 |
---|---|---|
committer | William Schultz <william.schultz@mongodb.com> | 2017-11-28 16:20:05 -0500 |
commit | 48c4e4eb48e7994a78bee8f3384df2963a1ea407 (patch) | |
tree | 0bae29d3a511e2d8cb9030ec023119be884276ef /src/mongo/db/repl/storage_interface.h | |
parent | a25df7d03ac286f28eadebdd361802ad522e74e9 (diff) | |
download | mongo-48c4e4eb48e7994a78bee8f3384df2963a1ea407.tar.gz |
SERVER-31662 Initialize rollback id to 1 and log when it changes
Diffstat (limited to 'src/mongo/db/repl/storage_interface.h')
-rw-r--r-- | src/mongo/db/repl/storage_interface.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/mongo/db/repl/storage_interface.h b/src/mongo/db/repl/storage_interface.h index d6c50c28b26..a7882041c21 100644 --- a/src/mongo/db/repl/storage_interface.h +++ b/src/mongo/db/repl/storage_interface.h @@ -84,11 +84,26 @@ public: virtual ~StorageInterface() = default; /** - * Rollback ID is an increasing counter of how many rollbacks have occurred on this server. + * Rollback ID is an increasing counter of how many rollbacks have occurred on this server. It + * is initialized with a value of 1, and should increase by exactly 1 every time a rollback + * occurs. + */ + + /** + * Return the current value of the rollback ID. */ virtual StatusWith<int> getRollbackID(OperationContext* opCtx) = 0; - virtual Status initializeRollbackID(OperationContext* opCtx) = 0; - virtual Status incrementRollbackID(OperationContext* opCtx) = 0; + + /** + * Initialize the rollback ID to 1. Returns the value of the initialized rollback ID if + * successful. + */ + virtual StatusWith<int> initializeRollbackID(OperationContext* opCtx) = 0; + + /** + * Increments the current rollback ID. Returns the new value of the rollback ID if successful. + */ + virtual StatusWith<int> incrementRollbackID(OperationContext* opCtx) = 0; // Collection creation and population for initial sync. |