[SERVER-82087] FCVServerStatusMetrics::generateSection is racy Created: 11/Oct/23  Updated: 16/Oct/23  Resolved: 16/Oct/23

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

Type: Bug Priority: Major - P3
Reporter: Kaitlin Mahar Assignee: Backlog - Replication Team
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
duplicates SERVER-79274 FCV checks can be racy if FCV is unin... Closed
Related
related to SERVER-79274 FCV checks can be racy if FCV is unin... Closed
related to SERVER-79317 Provide more documentation and helper... Closed
related to SERVER-58534 Collect FCV in FTDC Closed
Assigned Teams:
Replication
Operating System: ALL
Participants:
Linked BF Score: 105

 Description   

This is the same root issue as SERVER-79274. This method performs an initial check that FCV is initialized and later on attempts to get the FCV. But it's possible for the FCV to get unset in between those calls, e.g. if we are in initial sync (as seen in BF-30375) leading us to hit an invariant.



 Comments   
Comment by Kaitlin Mahar [ 11/Oct/23 ]

To capture some conversation from Slack: we think one acceptable fix in this case would be to use some new helper that atomically checks if the FCV is initialized and returns it if so, and to update this function to 1) only include the FCV info if that helper returned non-null and 2) use that same returned value throughout the function rather than re-obtaining it. This is for serverStatus and so it is ok if there is some staleness in the data by the time the function exits; FTDC only collects serverStatus every 1 second so it is bound to be stale regardless.

Generated at Thu Feb 08 06:48:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.