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

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Fully Compatible
    • Sharding 2020-08-10

      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.

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

              Created:
              Updated:
              Resolved: