[SERVER-79590] [Storage Execution EMEA] Audit v7.0 feature flag Created: 01/Aug/23  Updated: 31/Oct/23  Resolved: 11/Oct/23

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

Type: Task Priority: Major - P3
Reporter: Connie Chen Assignee: Haley Connelly
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-79330 Audit featureFlag usage in v7.0 branc... Backlog
Issue split
split from SERVER-79333 [Storage Execution NAMER] Audit v7.0 ... Closed
Related
related to SERVER-67246 Remove size multiple restriction on c... Closed
Assigned Teams:
Storage Execution EMEA
Backwards Compatibility: Fully Compatible
Sprint: Execution EMEA Team 2023-09-04, Execution EMEA Team 2023-09-18, Execution EMEA Team 2023-10-02, Execution EMEA Team 2023-10-16
Participants:

 Description   

Intial sync can temporarily reset the fcv value to uninitialized and sets the new value afterwards. This can cause call sites trying to inspect the fcv value to hit this invariant. We need to audit feature flag usage and determine which should do one of the following:

  • It can never be called when initial sync is running. So do nothing. Note that this can be tricky to prove as we once thought the catalog cache loader can never be run while initial sync is happening but it can.
  • It is safe to ignore fcv version so use isEnabledAndIgnoreFCVUnsafe instead
  • It is safe to turn off the feature anytime (even if feature flag is actually on) so use isEnabledUseDefaultFCVWhenUninitialized instead.
  • Special logic is needed if fcv is not initialized

gfeatureFlagCappedCollectionsRelaxedSize
gFeatureFlagGlobalIndexes



 Comments   
Comment by Haley Connelly [ 11/Oct/23 ]

gfeatureFlagCappedCollectionsRelaxedSize is checked in 2 places in 7.0

(1) adjustCappedSize() - OK as is, same behavior as using isEnabledUseDefaultFCVWhenUninitialized().

Before checking if the feature flag is enabled, it checks if FCV is initialized, thus it shouldn't hit the invariant. If the node is undergoing initial sync and FCV isn't set, a capped collection's maxSize wont be rounded to 256. This is fine, since the capped collection will be cloned from an existing node in the replica set - and thus abide by the sizing rules for the replica sets FCV. 

(2) _userCollectionsUassertsForDowngrade() - OK as is.

The feature flag is checked with isDisabledOnTargetFCVButEnabledOnOriginalFCV(originalVersion, requestedVersion). The 'originalVersion' passed in is generated at the start of _userCollectionsUassertsForDowngrade. The entire function would fail the isUpgradingOrDowngrading() invariant if the FCV version weren't initialized. Thus, the feature flag check is unreachable if the fcv is uninitialized when storing the 'originalVersion'. 

Comment by Haley Connelly [ 03/Oct/23 ]

gFeatureFlagGlobalIndexes isn't enabled and won't be until future projects (see this comment). For now, there isn't a direct risk of it causing an error in production. In later versions, it can be revisited when the feature flag is enabled. 

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