[SERVER-5392] Consider allowing only one thread to be responsible in modifying _nodes in ReplicaSetMonitor Created: 24/Mar/12  Updated: 19/Mar/13  Resolved: 25/Mar/12

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Randolph Tan Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-5110 ReplicaSetMonitor::check not thread s... Closed
is related to SERVER-6972 C++ driver should use isMaster, not r... Closed
is related to SERVER-9021 Make sure that at most one thread at ... Closed
Participants:

 Description   

For the current code right now, any thread who calls getMaster (and also the ReplicaSetMonitorWatcher) can potentially change the _nodes vector. It is easy for multiple threads to do duplicate work since it is relatively easy for a thread to be replaced by another because it will be blocked when it calls isMaster.



 Comments   
Comment by Eliot Horowitz (Inactive) [ 25/Mar/12 ]

making this code thread safe shouldn't be hard.
1 thread is already not ideal
what we might need is a better abstraction so its cleaner, or just refactoring.

Generated at Thu Feb 08 03:08:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.