-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Fully Compatible
-
ALL
-
-
Repl 2021-08-09, Repl 2021-08-23
-
110
setFeatureCompatibilityVersion reads the in-memory FCV value and then calls FeatureCompatibilityVersion::updateFeatureCompatibilityVersionDocument, which will use that FCV value we read to look up the transitional FCV state. It will fassert that it is found.
The problem is that we could have stepped down anywhere here, but we wouldn't realize yet because:
a. When setFCV acquires the FCV lock in exclusive mode, it uses the non-interruptible variant of the ExclusiveLock constructor
b. We could even have stepped down after having acquired the lock, but before reading the in-memory FCV value.
Then, if the new primary runs setFCV and the former primary that is still running setFCV replicates the FCV change, the former primary could attempt to look up an invalid FCV transition and fassert.
To address this, FeatureCompatibilityVersion::updateFeatureCompatibilityVersionDocument should check that the opCtx is not interrupted.