summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergi Mateo Bellido <sergi.mateo-bellido@mongodb.com>2021-06-15 17:18:34 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-16 12:42:54 +0000
commit6729afa6c6f081333973601172fafa7c71741508 (patch)
tree883989c9085621ff2d85539b34d885c9bc660fa8
parenta896fe0fdb65e21bb3c92c88043768554399d14b (diff)
downloadmongo-6729afa6c6f081333973601172fafa7c71741508.tar.gz
SERVER-57316 Changing a few functions that rely on the presence of epochs/timestamps on config.chunks
-rw-r--r--src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp b/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp
index 2617c4201a0..fff12e81622 100644
--- a/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp
+++ b/src/mongo/db/s/config/sharding_catalog_manager_chunk_operations.cpp
@@ -1537,13 +1537,15 @@ void ShardingCatalogManager::ensureChunkVersionIsGreaterThan(
// Get the chunk with the current collectionVersion for this epoch.
ChunkType highestChunk;
{
+ const auto query = coll.getTimestamp() ? BSON(ChunkType::collectionUUID() << *collUuid)
+ : BSON(ChunkType::epoch(version.epoch()));
const auto highestChunksVector =
uassertStatusOK(configShard->exhaustiveFindOnConfig(
opCtx,
ReadPreferenceSetting{ReadPreference::PrimaryOnly},
repl::ReadConcernLevel::kLocalReadConcern,
ChunkType::ConfigNS,
- BSON(ChunkType::epoch(version.epoch())) /* query */,
+ query,
BSON(ChunkType::lastmod << -1) /* sort */,
1 /* limit */))
.docs;