TopologyDescription::clone should make a deep copy of the ServerDescriptions

XMLWordPrintableJSON

    • Fully Compatible
    • Sharding 2021-07-12, Sharding 2021-07-26, Sharding 2021-08-09, Sharding 2021-08-23
    • 24
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Task: Before associating the server descriptions to the cloned TopologyDescription, the result (cloned) TopologyDescription’s _servers should deep copied.

      Context: TopologyDescription::clone currently makes a shallow copy of the source TopologyDescription. The result’s _servers point to the same underlying ServerDescriptions as the source’s _servers. This becomes an issue since the method mutates the underlying _servers for the source TopologyDescription as well as the result (cloned) version - causing unexpected changes when readers (primarily the ServerSelector) expect the TopologyDescription to be readonly.

              Assignee:
              Luis Osta (Inactive)
              Reporter:
              Haley Connelly
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: