-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Catalog and Routing
-
Fully Compatible
-
ALL
-
CAR Team 2026-07-20
-
200
-
🟦 Shard Catalog
-
None
-
None
-
None
-
None
-
None
-
None
As part of movePrimary, the new primary shard must clear metadata for tracked collections that do not own any chunks on that shard. This is needed because some DDL operations, such as refineShardKey and shardCollection, only send the shard catalog commit to the primary shard and to shards that own chunks. As a result, shards without chunks can keep stale metadata.
Today, movePrimary only clears metadata for collections marked as kUnowned. However, a collection without chunks can also be marked as kTracked and still have a routing table. This change updates the condition so movePrimary also clears metadata in that case.
This exposed another issue: chunk migrations could fail with ConflictingOperationInProgress because the metadata was being reset in the middle of the migration. To fix this, we added a shard role loop so that, if the recipient finds the filtering metadata unknown, it refreshes it and continues.