From 1ccd927d11fc604fdba9112e7f53e781128b6d64 Mon Sep 17 00:00:00 2001 From: Allison Easton Date: Wed, 9 Nov 2022 10:21:04 +0000 Subject: SERVER-70654 Add a warning when using find during moveChunk for a hashed shard key --- src/mongo/s/commands/cluster_move_chunk_cmd.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mongo/s') diff --git a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp index 1f97441ed1e..8c56bfea1f9 100644 --- a/src/mongo/s/commands/cluster_move_chunk_cmd.cpp +++ b/src/mongo/s/commands/cluster_move_chunk_cmd.cpp @@ -152,6 +152,11 @@ public: str::stream() << "no shard key found in chunk query " << *find, !shardKey.isEmpty()); + if (find && chunkManager.getShardKeyPattern().isHashedPattern()) { + LOGV2_WARNING(7065400, + "bounds should be used instead of query for hashed shard keys"); + } + chunk.emplace(chunkManager.findIntersectingChunkWithSimpleCollation(shardKey)); } else { -- cgit v1.2.1