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

Use a single delete statement in updateShardChunks

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Catalog and Routing

      from jordi.serra-torrens@mongodb.com

      This is the SSCCL code that processes the changed chunks it fetched from the primary and writes them down to config.cache.chunks.<nss>. The process is roughly:

      • For each changedChunk:
        • Delete from config.cache.chunks.<nss> all entries that overlap with changedChunk (i.e. the delete filter is match $gte: changedChunk.min, $le: changedChunk.max)
        • Insert changedChunk

      This is the delete bit. SERVER-81133 attempted an optimization where the deletes are batched together in a single command. However, that command is still composed of N (1000) individual delete operations – one per changed chunk, rather than one single deleteOp with a filter that covers all the changedChunks in the batch.
      Functionally, both are the same. But I suspect the first has some additional overhead. Because when processing the delete, each deleteOp is processed individually, and for each one of them a query plan is built, cursors established, etc.

            Assignee:
            adam.farkas@mongodb.com Wolfee Farkas
            Reporter:
            adam.farkas@mongodb.com Wolfee Farkas
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: