summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvia Surroca <silvia.surroca@mongodb.com>2023-01-05 14:51:04 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-01-05 15:25:55 +0000
commit8ce31326668592d9121897bd777d017dd24a6fee (patch)
tree13a8056ee322a17f653b9485d3ae74c77816d05c
parentdd398591b83d2fe023439b9498937ecf17fe181c (diff)
downloadmongo-8ce31326668592d9121897bd777d017dd24a6fee.tar.gz
SERVER-72533 Shards must send `validAfter` field on _configsvrCommitChunksMerge on v6.0
-rw-r--r--src/mongo/db/s/shardsvr_merge_chunks_command.cpp2
-rw-r--r--src/mongo/s/request_types/merge_chunk_request.idl4
2 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/s/shardsvr_merge_chunks_command.cpp b/src/mongo/db/s/shardsvr_merge_chunks_command.cpp
index 8e11f5bfec3..8c5086a6ae8 100644
--- a/src/mongo/db/s/shardsvr_merge_chunks_command.cpp
+++ b/src/mongo/db/s/shardsvr_merge_chunks_command.cpp
@@ -59,8 +59,10 @@ Shard::CommandResponse commitMergeOnConfigServer(OperationContext* opCtx,
const ChunkRange& chunkRange,
const CollectionMetadata& metadata) {
auto const shardingState = ShardingState::get(opCtx);
+ const auto currentTime = VectorClock::get(opCtx)->getTime();
ConfigSvrMergeChunks request{nss, shardingState->shardId(), metadata.getUUID(), chunkRange};
+ request.setValidAfter(currentTime.clusterTime().asTimestamp());
request.setEpoch(epoch);
request.setTimestamp(timestamp);
diff --git a/src/mongo/s/request_types/merge_chunk_request.idl b/src/mongo/s/request_types/merge_chunk_request.idl
index 5675303b43f..55d4148902d 100644
--- a/src/mongo/s/request_types/merge_chunk_request.idl
+++ b/src/mongo/s/request_types/merge_chunk_request.idl
@@ -80,6 +80,10 @@ commands:
type: chunk_range
cpp_name: "chunkRange"
description: "Chunk bounds to merge."
+ validAfter:
+ type: timestamp
+ description: "The time after which this chunk is at this shard."
+ optional: true
epoch:
description: "The expected epoch of the collection that is being committed"
type: objectid