Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-78227

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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Works as Designed
    • Icon: Major - P3 Major - P3
    • None
    • 4.0.28, 4.2.24, 6.0.6, 4.4.22, 5.0.18, 7.0.0-rc4
    • Sharding
    • 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

      Attachments

        Activity

          People

            jordi.serra-torrens@mongodb.com Jordi Serra Torrens
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: