Create index for config.cache.chunks.* collections on min/max fields

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: 4.0.28, 4.2.24, 6.0.6, 4.4.22, 5.0.18, 7.0.0-rc4
    • Component/s: Sharding
    • Sharding EMEA
    • ALL
    • Sharding EMEA 2023-07-24
    • 2
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

            Assignee:
            Jordi Serra Torrens
            Reporter:
            Pierlauro Sciarelli
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: