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

RoutingTableHistory::makeUpdated should skip copying chunkMap if it will result in no diffs

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 4.7.0
    • None
    • Sharding
    • None
    • Fully Compatible
    • Sharding 2020-08-10

    Description

      RoutingTableHistory currently copies the chunkMap unconditionally:

      https://github.com/mongodb/mongo/blob/r4.4.0-rc12/src/mongo/s/chunk_manager.cpp#L600

      And throws it away if it results in no diff:

      https://github.com/mongodb/mongo/blob/r4.4.0-rc12/src/mongo/s/chunk_manager.cpp#L665

      In special cases when the size of the changedChunks is 1, we can simply inspect the chunk and compare it to the chunk in the map and skip the copying all together when they are the same. This would save memory and computation in collections with millions of chunks.

      Attachments

        Activity

          People

            allison.easton@mongodb.com Allison Easton
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: