Due to historical reason (e.g. inserts via direct connection) or unforeseen range deleter bugs, it may happen for documents to exist on a shard not owning the range they fall into.
In order to prevent mixing up legit documents (incoming via a migration) and spurious ones (incorrectly present within the range being moved), we could add a check at the beginning of cloning and fail the migration if documents are already present. This would be as cheap as opening a cursor on the shard key index at the beginning of the range and checking the shard key of the first returned document.
- related to
-
SERVER-122239 [v8.0] Test reporting_compound_wildcard_index_prefixed_by_shard_key.js should consider that recipient shard also uses the shard key index
-
- In Code Review
-
-
SERVER-103774 Disallow compound wildcard indexes from being used as a shard key index
-
- Closed
-
-
SERVER-113659 Add error label from chunk migration aborting when existing document is found
-
- Closed
-