If we shard over
{ x : 1 }with index
{ x : 1, y : 1 }, and have chunks A:
{x:2}->
{x:3}and B:
{x:3}->
{x:4}, a document D :
{ x : 3, y : "abcde" }is currently included in migrations and other operations for both A and B.
This is b/c when we get index key bounds from the prefix, we complete them with MinKey for min and MaxKey for max, so the index max bound of A is
{x:3,y:MaxKey}and the index min bound of B is
{x:3,y:MinKey}, and both ranges overlap D. Included test shows how this results in extra documents removed during migration.
Proposed solution - complete with just MinKey?
The problem is harder to trigger with our standard tests with _id indexes, not sure why.
- related to
-
SERVER-6809 splitVector doesn't filter additional index fields when shard key is prefix of index
- Closed