[SERVER-46791] Fix incorrect FCV initialisation check to allow compound hashed index Created: 11/Mar/20  Updated: 29/Oct/23  Resolved: 12/Mar/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.3.4
Fix Version/s: 4.4.0-rc0, 4.7.0

Type: Bug Priority: Minor - P4
Reporter: Arun Banala Assignee: Arun Banala
Resolution: Fixed Votes: 0
Labels: qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Sprint: Query 2020-03-23
Participants:

 Description   

The current implementation allows creating compound hashed index if featureCompatibility.isVersionInitialized() evaluates to false. This might cause issues if FeatureCompatibilityVersion object ever gets uninitialized.
We need to change this code to

const auto isFeatureDisabled =
                (!featureCompatibility.isVersionInitialized() || featureCompatibility.getVersion() <   ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo44);        



 Comments   
Comment by Githook User [ 12/Mar/20 ]

Author:

{'username': 'banarun', 'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com'}

Message: SERVER-46791 Fix incorrect FCV initialisation check to allow compound hashed index

(cherry picked from commit a9a2bc2fcc4c7b5cd9a01282cd7dded84b888183)
Branch: v4.4
https://github.com/mongodb/mongo/commit/bf0d7423121375eb43836581d26e42212b92e234

Comment by Githook User [ 12/Mar/20 ]

Author:

{'username': 'banarun', 'name': 'Arun Banala', 'email': 'arun.banala@mongodb.com'}

Message: SERVER-46791 Fix incorrect FCV initialisation check to allow compound hashed index
Branch: master
https://github.com/mongodb/mongo/commit/4bb92a5c30b8eb9619afa2e1d6ddb5a03b4c696d

Comment by Bernard Gorman [ 11/Mar/20 ]

I don't believe this code will ever actually be exercised while the FCV is unset, but out of an abundance of caution we should eliminate the logical bug here.

Comment by Daniel Gottlieb (Inactive) [ 11/Mar/20 ]

FWIW, featureCompatibility.getVersion() will invariant if FCV is not initialized; omitting the call to isVersionInitialized entirely is often preferable. If this code can legitimately be exercised when FCV is unset (typically only very early at startup), it might be worth documenting.

Generated at Thu Feb 08 05:12:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.