We only check that a sharded collection is supported by a valid shard key index under the optimistic check (only holding the DDL lock, but not collection locks). A chunk migration does not acquire the DDL lock, so checkMetadataConsistency may observes the intermediate state where the collection has been cloned by the MigrationDestinationManager but the indexes have not built yet.
聽
We should re-check the condition under the collection lock so that we serialize with chunk migrations. (This will serialize with the MigrationDestinationManager's corresponding lock.)
聽
This is a regression introduced by SERVER-99314 (v8.2+).
- is caused by
-
SERVER-99314 Add range deletions cannot proceed due to missing shard key index to checkMetadataConsistency
-
- Closed
-