summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/split_chunk.cpp
diff options
context:
space:
mode:
authorPierlauro Sciarelli <pierlauro.sciarelli@mongodb.com>2022-01-14 20:03:18 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-01-14 21:22:02 +0000
commitda1a24bd16ce627122def05de91856ea8686b64a (patch)
tree9e9af520f1894ec2e92d3fd31a1bf04f0a33c347 /src/mongo/db/s/split_chunk.cpp
parent5a86a7dfff7743a7ac2dc9484fc854351c253f69 (diff)
downloadmongo-da1a24bd16ce627122def05de91856ea8686b64a.tar.gz
SERVER-61726 disallow committing auto-splits for collections under defragmentation
Diffstat (limited to 'src/mongo/db/s/split_chunk.cpp')
-rw-r--r--src/mongo/db/s/split_chunk.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/db/s/split_chunk.cpp b/src/mongo/db/s/split_chunk.cpp
index cc66c2672cf..9ea408b54d3 100644
--- a/src/mongo/db/s/split_chunk.cpp
+++ b/src/mongo/db/s/split_chunk.cpp
@@ -132,7 +132,8 @@ StatusWith<boost::optional<ChunkRange>> splitChunk(OperationContext* opCtx,
const ChunkRange& chunkRange,
const std::vector<BSONObj>& splitKeys,
const std::string& shardName,
- const OID& expectedCollectionEpoch) {
+ const OID& expectedCollectionEpoch,
+ const bool fromChunkSplitter) {
auto scopedSplitOrMergeChunk(uassertStatusOK(
ActiveMigrationsRegistry::get(opCtx).registerSplitOrMergeChunk(opCtx, nss, chunkRange)));
@@ -153,8 +154,8 @@ StatusWith<boost::optional<ChunkRange>> splitChunk(OperationContext* opCtx,
}
// Commit the split to the config server.
- auto request =
- SplitChunkRequest(nss, shardName, expectedCollectionEpoch, chunkRange, splitKeys);
+ auto request = SplitChunkRequest(
+ nss, shardName, expectedCollectionEpoch, chunkRange, splitKeys, fromChunkSplitter);
auto configCmdObj =
request.toConfigCommandBSON(ShardingCatalogClient::kMajorityWriteConcern.toBSON());