diff options
Diffstat (limited to 'src/mongo/db/repl/base_cloner.h')
-rw-r--r-- | src/mongo/db/repl/base_cloner.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/mongo/db/repl/base_cloner.h b/src/mongo/db/repl/base_cloner.h index 38079eeebac..d34597b332f 100644 --- a/src/mongo/db/repl/base_cloner.h +++ b/src/mongo/db/repl/base_cloner.h @@ -112,11 +112,13 @@ protected: } /** - * Returns true if the rollback ID should be checked before retrying. - * This is provided because the "connect" stage must complete successfully - * before checking rollback ID. + * Returns true if the sync source validity should be checked before retrying. + * This includes checking the sync source member state, checking the rollback ID, + * and checking the sync source initial sync ID. + * This method is provided because early stages which connect and collect + * the initial sync ID must complete successfully before checking sync source validity. */ - virtual bool checkRollBackIdOnRetry() { + virtual bool checkSyncSourceValidityOnRetry() { return true; } @@ -226,12 +228,25 @@ private: AfterStageBehavior runStageWithRetries(BaseClonerStage* stage); /** + * Make sure the initial sync ID on the sync source has not changed. Throws an exception + * if it has. Returns a not-OK status if a network error occurs. + */ + Status checkInitialSyncIdIsUnchanged(); + + /** * Make sure the rollback ID has not changed. Throws an exception if it has. Returns * a not-OK status if a network error occurs. */ Status checkRollBackIdIsUnchanged(); /** + * Does validity checks on the sync source. If the sync source is now no longer usable, + * throws an exception. Returns a not-OK status if a network error occurs or if the sync + * source is temporarily unusable (e.g. restarting). + */ + Status checkSyncSourceIsStillValid(); + + /** * Supports pausing at certain stages for the initial sync fuzzer test framework. */ void pauseForFuzzer(BaseClonerStage* stage); |