[SERVER-79330] Audit featureFlag usage in v7.0 branch in mongod binary Created: 25/Jul/23  Updated: 12/Dec/23

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

Type: Task Priority: Major - P3
Reporter: Randolph Tan Assignee: Backlog - Cluster Scalability
Resolution: Unresolved Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-79333 [Storage Execution NAMER] Audit v7.0 ... Closed
depends on SERVER-79590 [Storage Execution EMEA] Audit v7.0 f... Closed
Related
related to SERVER-82044 Add a method for checking if a featur... Closed
related to SERVER-80902 Audit gFeatureFlagTelemetry Closed
is related to SERVER-79317 Provide more documentation and helper... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
SERVER-79939 [Sharding EMEA] featureFlag audit v7.... Sub-task Backlog Backlog - Catalog and Routing  
SERVER-79940 [Sharding 2] featureFlag audit v7.0 b... Sub-task Backlog Backlog - Cluster Scalability  
SERVER-79941 [Sharding 3] featureFlag audit v7.0 b... Sub-task Backlog Backlog - Cluster Scalability  
Assigned Teams:
Cluster Scalability
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 if the feature flag check can be run during initial sync:

If it can never be called when initial sync is running, 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.

If it might get run during initial sync, this could be the case if the feature is run during initial sync itself, if the feature is in a background thread that runs during initial sync, or if the feature is run in a command that is allowed during initial sync, such as hello, serverStatus, etc. In this case, use one of these options:

  • Use isEnabledUseLastLTSFCVWhenUninitialized. It checks against the last LTS FCV version if the FCV version is unset, but note that this could result in the feature not being turned on even though the FCV will be set to latest once initial sync is complete.
  • Use isEnabledUseLatestFCVWhenUninitialized. This instead checks against the latest FCV version if the FCV version is unset, but note that this could result in the feature being turned on even though the FCV has not been upgraded yet and will be set to lastLTS once initial sync is complete.
  • Write your own special logic to avoid the invariant (for example, waiting for the FCV to become initialized before checking isEnabled, or uasserting instead of invariant-ing)

See this section of the README

List of feature flags from "git grep -ni featureflag src/ | grep "isEnabled(" | grep -v _test"

gFeatureFlagBucketUnpackWithSort
gFeatureFlagBulkWriteCommand
gfeatureFlagCappedCollectionsRelaxedSize
gFeatureFlagCatalogShard
gFeatureFlagChangeStreamsFurtherEnrichedEvents
gFeatureFlagColumnstoreIndexes
gFeatureFlagCommonQueryFramework
gFeatureFlagCompoundWildcardIndexes
gFeatureFlagConfigurableX509ClusterAuthn
gFeatureFlagAuditConfigClusterParameter
gFeatureFlagFLE2CompactForProtocolV2
gFeatureFlagFLE2Range
gFeatureFlagGlobalIndexes
gFeatureFlagHealthMonitoring
gFeatureFlagInternalWritesAreReplicatedTransactionally
gFeatureFlagServerlessChangeStreams
gFeatureFlagTelemetry
gFeatureFlagRequireTenantID
gFeatureFlagResharding
gFeatureFlagShardedTimeSeries
gFeatureFlagUpdateDocumentShardKeyUsingTransactionApi
gFeatureFlagUpdateOneWithoutShardKey
gFeatureFlagUserRoles
gGlobalIndexesShardingCatalog


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