Operational Defect Database

BugZero found this defect 2357 days ago.

MongoDB | 425845

[SERVER-31017] Race condition in setFeatureCompatibilityVersion command leads to fCV=3.6 and isSchemaVersion36=false

Last update date:

10/27/2023

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

This issue is caused by allowing serverGlobalParams.featureCompatibility.isSchemaVersion36 to be set to false after the featureCompatibilityVersion document has been updated as part of FeatureCompatibilityVersion::set(). Consider the following sequence of events with two threads when the server starts out in featureCompatibilityVersion=3.6. Thread in {setFCV: "3.4"} Thread in {setFCV: "3.6"} | | | | FCV::set() called | | | fCV document changed to "3.4" | | | fCV global set to "3.4" via OpObserver | | | isSchemaVersion36 global set to false | via OpObserver | | | | | | FCV::set() called | | | fCV document changed to "3.6" | | | fCV global set to "3.6" via OpObserver | | | isSchemaVersion36 global set to true | via OpObserver | | | | isSchemaVersion36 global set to false | via setFCV |

Top User Comments

esha.maharishi@10gen.com commented on Mon, 9 Oct 2017 15:18:41 +0000: Confirmed that this issue was fixed by SERVER-31209 and continued not to repro after SERVER-30793. geert.bosch commented on Thu, 5 Oct 2017 18:30:04 +0000: Per Max recommendation assigning to you for closing as duplicate. No need for additional regression testing, as existing tests are sufficient. Just manually run Max' test case when SERVER-30793 is fixed. esha.maharishi@10gen.com commented on Thu, 5 Oct 2017 18:29:35 +0000: I think we can run the repro_server31017.js after the changes from SERVER-30793 go in and confirm that the issue has been resolved. max.hirschhorn, sounds good. I'll link SERVER-30793 as related so we don't forget. max.hirschhorn@10gen.com commented on Thu, 5 Oct 2017 18:14:10 +0000: Thanks esha.maharishi, I wasn't sure whether SERVER-30793 would only impact the config servers or whether it would be for all usages of the "setFeatureCompatibilityVersion" command. I think we can run the repro_server31017.js after the changes from SERVER-30793 go in and confirm that the issue has been resolved. It also refactors the setFCV command so that isSchemaVersion36 is not set directly by the command. I suspect it will as a result of that change. esha.maharishi@10gen.com commented on Thu, 5 Oct 2017 18:11:43 +0000: max.hirschhorn if you agree, feel free to close this as a duplicate. Thanks louis.williams for finding this. esha.maharishi@10gen.com commented on Thu, 5 Oct 2017 18:08:13 +0000: I believe this problem will go away once SERVER-30793 is in. For one, that patch makes setFCV take an exclusive lock, so only one instance of it can run at a time. It also refactors the setFCV command so that isSchemaVersion36 is not set directly by the command.

Additional Resources / Links

Share:

BugZero Risk Score

Coming soon

Status

Closed

Have you been affected by this bug?

cost-cta-background

Do you know how much operational outages are costing you?

Understand the cost to your business and how BugZero can help you reduce those costs.

Discussion

Login to read and write comments.

Have you ever...

had your data corrupted from a

VMware

bug?

Search:

...