summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Saltz <matthew.saltz@mongodb.com>2018-05-17 16:54:21 -0400
committerMatthew Saltz <matthew.saltz@mongodb.com>2018-05-18 11:18:59 -0400
commit35e9928bf33c6270e3195a00c24fe7a09edf512e (patch)
tree95079edc09345afcc1d4373ef0599d8709bd7dfa
parent9ca43580864a05c6eb543b5bee8402d82bd99bc7 (diff)
downloadmongo-35e9928bf33c6270e3195a00c24fe7a09edf512e.tar.gz
SERVER-34807 Rename states in movePrimary state machine to match migration
-rw-r--r--src/mongo/db/s/move_primary_source_manager.cpp10
-rw-r--r--src/mongo/db/s/move_primary_source_manager.h6
2 files changed, 8 insertions, 8 deletions
diff --git a/src/mongo/db/s/move_primary_source_manager.cpp b/src/mongo/db/s/move_primary_source_manager.cpp
index 2bfd92cedfb..5b8902455de 100644
--- a/src/mongo/db/s/move_primary_source_manager.cpp
+++ b/src/mongo/db/s/move_primary_source_manager.cpp
@@ -121,14 +121,14 @@ Status MovePrimarySourceManager::clone(OperationContext* opCtx) {
}
}
- _state = kCloneCompleted;
+ _state = kCloneCaughtUp;
scopedGuard.Dismiss();
return Status::OK();
}
Status MovePrimarySourceManager::enterCriticalSection(OperationContext* opCtx) {
invariant(!opCtx->lockState()->isLocked());
- invariant(_state == kCloneCompleted);
+ invariant(_state == kCloneCaughtUp);
auto scopedGuard = MakeGuard([&] { cleanupOnError(opCtx); });
// Mark the shard as running a critical operation that requires recovery on crash.
@@ -281,7 +281,7 @@ Status MovePrimarySourceManager::commitOnConfig(OperationContext* opCtx) {
return commitStatus;
}
- _state = kCommitted;
+ _state = kCloneCompleted;
_cleanup(opCtx);
@@ -368,9 +368,9 @@ void MovePrimarySourceManager::_cleanup(OperationContext* opCtx) {
ShardingStateRecovery::endMetadataOp(opCtx);
}
- // If we're in the kCommitted state, then we need to do the last step of cleaning up
+ // If we're in the kCloneCompleted state, then we need to do the last step of cleaning up
// now-stale data on the old primary. Otherwise, indicate that we're done.
- if (_state != kCommitted) {
+ if (_state != kCloneCompleted) {
_state = kDone;
}
diff --git a/src/mongo/db/s/move_primary_source_manager.h b/src/mongo/db/s/move_primary_source_manager.h
index 0b1a4127f1c..aa13bf5a0fd 100644
--- a/src/mongo/db/s/move_primary_source_manager.h
+++ b/src/mongo/db/s/move_primary_source_manager.h
@@ -99,7 +99,7 @@ public:
* movePrimary is committed. Therefore, commitMovePrimaryMetadata must be called as soon as
* possible afterwards.
*
- * Expected state: kCloneCompleted
+ * Expected state: kCloneCaughtUp
* Resulting state: kCriticalSection on success, kDone on failure
*/
Status enterCriticalSection(OperationContext* opCtx);
@@ -146,9 +146,9 @@ private:
enum State {
kCreated,
kCloning,
- kCloneCompleted,
+ kCloneCaughtUp,
kCriticalSection,
- kCommitted,
+ kCloneCompleted,
kNeedCleanStaleData,
kDone
};