summaryrefslogtreecommitdiff
path: root/src/mongo/db/s
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/s')
-rw-r--r--src/mongo/db/s/create_collection_coordinator.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/s/create_collection_coordinator.cpp b/src/mongo/db/s/create_collection_coordinator.cpp
index 31d302b9989..ba4eaf99e6e 100644
--- a/src/mongo/db/s/create_collection_coordinator.cpp
+++ b/src/mongo/db/s/create_collection_coordinator.cpp
@@ -493,6 +493,10 @@ ExecutorFuture<void> CreateCollectionCoordinator::_runImpl(
getCollation(opCtx, nss(), _request.getCollation()).second,
_request.getUnique().value_or(false))) {
+ // Ensure that the completion of the request gets recorded at least once on the
+ // oplog.
+ _writeOplogMessage(opCtx, nss(), *_collectionUUID, _request.toBSON());
+
// The critical section can still be held here if the node committed the
// sharding of the collection but then it stepped down before it managed to
// delete the coordinator document