Shard primaries refresh their chunk metadata by querying the config server for new metadata, and then creating and setting a new CollectionMetadata object. Usually the new CollectionMetadata object is based off of the old CollectionMetadata object, but if the CollectionMetadata was previously cleared then the query will retrieve all the chunk metadata and make an entirely new CollectionMetadata object with the results. The ConfigDiffTracker::calculateConfigDiff function applies the new chunk metadata queried from the config server to the new CollectionMetadata object.
From now on, the primary must read from and write to admin.chunks. In-memory cached chunk metadata manipulations, via CollectionMetadata or ConfigDiffTracker methods, should correspondingly do writes to the admin.chunks collection.
- has to be done after
-
SERVER-27804 Add shard config.chunks collection parsing to/from BSON to ChunkType
- Closed
-
SERVER-27811 Refactor catalog client classes to accommodate shards reading/writing to shard collections
- Closed