-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Replication
-
ALL
-
105
Currently, FeatureFlag::isEnabled() is the method that we use to check whether a feature flag enabled if we don't want to ignore the FCV. However, the method involves getting the FCV which would throw if the FCV is uninitialized. So right now we do the feature flag check by doing serverGlobalParams.featureCompatibility.isVersionInitialized() and then gFeatureFlagName.isEnabled(serverGlobalParams.featureCompatibility). However, it turns out initial sync has a step to reset the FCV so the FCV can become uninitialized in between the two steps, leading to an invariant failure.
Here are all the instances of the two-step feature flag check in the 7.0 branch: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25. The last two are inside NamespaceStringUtil::serialize() and deserialize() so have a high chance of hitting the race with the initial sync FCV reset.
So the proposed solution here is to replace the two-step check with a single check handles the case where FCV is uninitialized.
- duplicates
-
SERVER-79274 fCV checks can be racy if fCV is uninitialized in between the checks
- Closed
- is related to
-
SERVER-79330 Audit featureFlag usage in v7.0 branch in mongod binary
- Backlog