diff options
author | Pierlauro Sciarelli <pierlauro.sciarelli@mongodb.com> | 2020-06-25 15:49:17 +0200 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-06-27 13:11:41 +0000 |
commit | e2aa2d700f7463e4b9097f7707dbe9ccfee44a00 (patch) | |
tree | 66f36957cf186474fb0360e874f0d222558e4308 /src/mongo/db/s/set_shard_version_command.cpp | |
parent | bfa69dbb3978645143e301d8966d020b58de0f4d (diff) | |
download | mongo-e2aa2d700f7463e4b9097f7707dbe9ccfee44a00.tar.gz |
SERVER-49009 SetShardVersion must not call forceShardFilteringMetadataRefresh
Diffstat (limited to 'src/mongo/db/s/set_shard_version_command.cpp')
-rw-r--r-- | src/mongo/db/s/set_shard_version_command.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/mongo/db/s/set_shard_version_command.cpp b/src/mongo/db/s/set_shard_version_command.cpp index 9944d9f72e5..8948c5c5725 100644 --- a/src/mongo/db/s/set_shard_version_command.cpp +++ b/src/mongo/db/s/set_shard_version_command.cpp @@ -239,15 +239,20 @@ public: // Step 6 - // Note: The forceRefresh flag controls whether we make sure to do our own refresh or if - // we're okay with joining another thread const auto status = [&] { try { - forceShardFilteringMetadataRefresh(opCtx, nss, forceRefresh); - return Status::OK(); + // TODO SERVER-48990 remove this if-else: just call onShardVersionMismatch + if (requestedVersion == requestedVersion.DROPPED()) { + // Note: The forceRefresh flag controls whether we make sure to do our own + // refresh or if we're okay with joining another thread + forceShardFilteringMetadataRefresh(opCtx, nss, forceRefresh); + } else { + onShardVersionMismatch(opCtx, nss, requestedVersion); + } } catch (const DBException& ex) { return ex.toStatus(); } + return Status::OK(); }(); { |