summaryrefslogtreecommitdiff
path: root/src/mongo
diff options
context:
space:
mode:
authorAllison Easton <allison.easton@mongodb.com>2022-08-30 07:32:10 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-08-30 08:04:11 +0000
commit3f101399b8b165cb1e3a70bd56d9be7978124f51 (patch)
tree953750db137ef291527b9731d0ff2f2c3a68fee0 /src/mongo
parent7e5986a0748c6d12a2381779ecc2d0115249cfe8 (diff)
downloadmongo-3f101399b8b165cb1e3a70bd56d9be7978124f51.tar.gz
SERVER-69180 Split and Merge commands need to refresh filtering metadata before checking preconditions
Diffstat (limited to 'src/mongo')
-rw-r--r--src/mongo/db/s/shardsvr_merge_chunks_command.cpp1
-rw-r--r--src/mongo/db/s/shardsvr_split_chunk_command.cpp2
2 files changed, 3 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 69a4610a838..22f20b9135b 100644
--- a/src/mongo/db/s/shardsvr_merge_chunks_command.cpp
+++ b/src/mongo/db/s/shardsvr_merge_chunks_command.cpp
@@ -95,6 +95,7 @@ void mergeChunks(OperationContext* opCtx,
// Check that the preconditions for merge chunks are met and throw StaleShardVersion otherwise.
const auto metadataBeforeMerge = [&]() {
+ onShardVersionMismatch(opCtx, nss, boost::none);
OperationShardingState::unsetShardRoleForLegacyDDLOperationsSentWithShardVersionIfNeeded(
opCtx, nss);
const auto metadata = checkCollectionIdentity(opCtx, nss, expectedEpoch, expectedTimestamp);
diff --git a/src/mongo/db/s/shardsvr_split_chunk_command.cpp b/src/mongo/db/s/shardsvr_split_chunk_command.cpp
index bdcae8af9ad..3d11f8990fc 100644
--- a/src/mongo/db/s/shardsvr_split_chunk_command.cpp
+++ b/src/mongo/db/s/shardsvr_split_chunk_command.cpp
@@ -40,6 +40,7 @@
#include "mongo/db/s/chunk_operation_precondition_checks.h"
#include "mongo/db/s/collection_sharding_runtime.h"
#include "mongo/db/s/operation_sharding_state.h"
+#include "mongo/db/s/shard_filtering_metadata_refresh.h"
#include "mongo/db/s/sharding_state.h"
#include "mongo/db/s/split_chunk.h"
#include "mongo/logv2/log.h"
@@ -159,6 +160,7 @@ public:
// Check that the preconditions for split chunk are met and throw StaleShardVersion
// otherwise.
{
+ onShardVersionMismatch(opCtx, nss, boost::none);
OperationShardingState::
unsetShardRoleForLegacyDDLOperationsSentWithShardVersionIfNeeded(opCtx, nss);
const auto metadata = checkCollectionIdentity(