-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Replication
When processing a heartbeat request, we end up unnecessarily taking the replication coordinator mutex twice because we guard the scope of the first mutex acquisition unnecessarily: once to check the config state and once for the duration of preparing the heartbeat response.
During times of high contention for the mutex, where the time to process a heartbeat is dominated by the time it takes to take the mutex, this can mean it can take almost twice as long to prepare the heartbeat response.
We should just take the mutex once without releasing it and re-acquiring it.