Details
Description
The primary does a series of chunk metadata writes and it is unsafe for the secondary to refresh until it receives all of the writes. The primary will update the config.collections with the latest chunk version after finishing the series of writes. Secondaries will only refresh in-memory chunk metadata up to the version specified in the config.collection entry on the shard.
-------------
Shards need the collection shard key for filtering, eventually the collection UUID (will temporarily be the namespace until that project is complete), and a chunk version for secondary refresh (SERVER-28120). It will look roughly like this
{
|
"_id" : UUID,
|
"ns" : “test.foo”,
|
"key" : {
|
"a" : 1
|
},
|
“ lastConsistentCollectionVersion”: ChunkVersion
|
}
|
It should be persisted in MetadataLoader::_initCollection, where we query the config server for the necessary config.collection entry.