[SERVER-62989] Rely on canAcceptWritesForDatabase to know if the current node is standalone or primary Created: 26/Jan/22  Updated: 29/Oct/23  Resolved: 26/Jan/22

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

Type: Task Priority: Major - P3
Reporter: Sergi Mateo Bellido Assignee: Sergi Mateo Bellido
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Problem/Incident
Backwards Compatibility: Fully Compatible
Sprint: Sharding EMEA 2022-02-07
Participants:
Linked BF Score: 100

 Description   

The canAcceptWritesForDatabase function doesn't accquire the ReplicationCoordinatorImpl::_mutex.

The acquisition of this lock as part of this code seems to be the reason why we had a performance drop in this micro-benchmark.



 Comments   
Comment by Githook User [ 26/Jan/22 ]

Author:

{'name': 'Sergi Mateo Bellido', 'email': 'sergi.mateo-bellido@mongodb.com', 'username': 'smateo'}

Message: SERVER-62989 Find a cheaper implementation of isStandaloneOrPrimary
Branch: master
https://github.com/mongodb/mongo/commit/621f19ad4010d2f2a4c6f466619fc07ab8d22f22

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