[SERVER-47828] Do not copy replica set config when accessing it Created: 28/Apr/20  Updated: 29/Oct/23  Resolved: 22/Jun/21

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

Type: Improvement Priority: Major - P3
Reporter: Siyuan Zhou Assignee: Carolyn Duan (Inactive)
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Problem/Incident
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0, v4.4, v4.2, v4.0
Sprint: Repl 2021-06-14, Repl 2021-06-28
Participants:
Linked BF Score: 120

 Description   

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.



 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 [ 22/Jun/21 ]

Author:

{'name': 'Carolyn Duan', 'email': 'carolyn.duan@mongodb.com', 'username': 'duancaro'}

Message: SERVER-47828 Add getConfig* methods to avoid copying ReplSetConfig
through ReplicationCoordinatorImpl::getConfig()
Branch: master
https://github.com/mongodb/mongo/commit/e866ed8e645c034d773bc9de6dd4ec13ee769bea

Comment by Siyuan Zhou [ 28/Apr/20 ]

ldeng, how much perf drop was in SERVER-40250?

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