[SERVER-74936] Improve shard key index inconsistency checks during migrations Created: 16/Mar/23  Updated: 23/Mar/23  Resolved: 23/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Pol Pinol Assignee: [DO NOT USE] Backlog - Sharding EMEA
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-72895 Implement shardKey index check in che... Closed
Assigned Teams:
Sharding EMEA
Participants:

 Description   

With actual implementation of the shard key index inconsistency checks, if we are running the checkMetadataConsistency cmd in a recipient shard part of a migration, and that shard had no chunks about the collection being migrated (chunk version <0,0>), we will skip the checks.

https://github.com/10gen/mongo/blob/be31cc047874ed3c6854534bf419021655535034/src/mongo/db/s/metadata_consistency_util.cpp#L230-L249

This is done because there is a space where the collection is registered on the recipient's shard but it has no indexes yet.

https://github.com/10gen/mongo/blob/be31cc047874ed3c6854534bf419021655535034/src/mongo/db/s/migration_destination_manager.cpp#L1079 

The goal of this ticket is to investigate if there is a more optimized way of checking shard key indexes when there are migrations.

A possible optimistic approach was to first check if the shard key index exists, and if not check if there is a migration running.


Generated at Thu Feb 08 06:28:55 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.