[SERVER-57451] TopologyDescription::clone should make a deep copy of the ServerDescriptions Created: 04/Jun/21  Updated: 29/Oct/23  Resolved: 07/Sep/21

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 5.1.0-rc0

Type: Task Priority: Major - P3
Reporter: Haley Connelly Assignee: Luis Osta (Inactive)
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Related
related to SERVER-60062 Fix duplicate uuid and server descrip... Closed
is related to SERVER-50170 Fix server selection failure on mongos Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2021-07-12, Sharding 2021-07-26, Sharding 2021-08-09, Sharding 2021-08-23
Participants:
Linked BF Score: 24

 Description   

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.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 07/Sep/21 ]

Author:

{'name': 'Luis Osta', 'email': 'luis.osta@mongodb.com', 'username': 'LuisOsta'}

Message: SERVER-57451 implemented deep cloning for TopologyDescription
Branch: master
https://github.com/mongodb/mongo/commit/201cc6d586d53ae64d1a54e4b2c4b18120cf43e8

Generated at Thu Feb 08 05:41:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.