Details
-
Bug
-
Resolution: Works as Designed
-
Major - P3
-
None
-
4.0.28, 4.2.24, 6.0.6, 4.4.22, 5.0.18, 7.0.0-rc4
-
Sharding EMEA
-
ALL
-
Sharding EMEA 2023-07-24
-
2
Description
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