Do not copy replica set config when accessing it

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 5.1.0-rc0
    • Affects Version/s: None
    • Component/s: Replication
    • Fully Compatible
    • v5.0, v4.4, v4.2, v4.0
    • Repl 2021-06-14, Repl 2021-06-28
    • 120
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      ReplicationCoordinatorImpl::getConfig() copies the whole config which can be a subtle performance trap as we have seen in SERVER-40250. It's an issue in SERVER-46186's patch as well.

      We can either return a const reference or expose a way to call member functions on the config without copying it.

            Assignee:
            Carolyn Duan (Inactive)
            Reporter:
            Siyuan Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: