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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7.0
    • Component/s: Sharding
    • Labels:
      None

      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

            Assignee:
            allison.easton Allison Easton (Inactive)
            Reporter:
            renctan Randolph Tan
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: