|
The updateShardChunks function is deleting outdated chunks and replacing it with the new document covering the same range.
Currently only an index on the lastmod field is created on config.cache.chunks.* collections.
Since the deletion relies on a range query on min/max, the absence of an index on such fields is resulting in a collection scan when having to find matching documents.
This is bad because when a collection has of a lot of chunks:
- It is a resource-consuming task (always paging in/out metadata documents to/from the WT cache )
- In case of shard version mismatch, secondaries are waiting for chunk entries to be persisted before being able to serve queries, hence they will be waiting for the COLLSCAN to complete
|