summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/resharding/resharding_recipient_service.h
diff options
context:
space:
mode:
authorMax Hirschhorn <max.hirschhorn@mongodb.com>2021-02-24 15:08:40 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-24 16:41:46 +0000
commit6ca44ce30689b3fe93d3afe75f07c70a0fdc3d8d (patch)
treea84afaf9fbebe581a7af6d103e58ea974cc366a2 /src/mongo/db/s/resharding/resharding_recipient_service.h
parentfdfc0daa5e3c46ac7a2b6e08d98528b161217467 (diff)
downloadmongo-6ca44ce30689b3fe93d3afe75f07c70a0fdc3d8d.tar.gz
SERVER-54513 Add kAwaitingFetchTimestamp to resharding recipient states.
Also changes the RecoverRefreshThread to insert the donor and recipient state documents rather than the primary-only service Instance itself.
Diffstat (limited to 'src/mongo/db/s/resharding/resharding_recipient_service.h')
-rw-r--r--src/mongo/db/s/resharding/resharding_recipient_service.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mongo/db/s/resharding/resharding_recipient_service.h b/src/mongo/db/s/resharding/resharding_recipient_service.h
index 43cf216f367..a8f8f22899d 100644
--- a/src/mongo/db/s/resharding/resharding_recipient_service.h
+++ b/src/mongo/db/s/resharding/resharding_recipient_service.h
@@ -130,9 +130,13 @@ public:
void onReshardingFieldsChanges(OperationContext* opCtx,
const TypeCollectionReshardingFields& reshardingFields);
+ static void insertStateDocument(OperationContext* opCtx,
+ const ReshardingRecipientDocument& recipientDoc);
+
private:
// The following functions correspond to the actions to take at a particular recipient state.
- void _transitionToCreatingTemporaryReshardingCollection();
+ ExecutorFuture<void> _awaitAllDonorsPreparedToDonateThenTransitionToCreatingCollection(
+ const std::shared_ptr<executor::ScopedTaskExecutor>& executor);
void _createTemporaryReshardingCollectionThenTransitionToCloning();
@@ -157,9 +161,6 @@ private:
void _updateCoordinator();
- // Inserts 'doc' on-disk and sets '_replacementDoc' in-memory.
- void _insertRecipientDocument(const ReshardingRecipientDocument& doc);
-
// Updates the recipient document on-disk and in-memory with the 'replacementDoc.'
void _updateRecipientDocument(ReshardingRecipientDocument&& replacementDoc);
@@ -206,6 +207,8 @@ private:
// Each promise below corresponds to a state on the recipient state machine. They are listed in
// ascending order, such that the first promise below will be the first promise fulfilled.
+ SharedPromise<Timestamp> _allDonorsPreparedToDonate;
+
SharedPromise<void> _coordinatorHasDecisionPersisted;
SharedPromise<void> _completionPromise;