Provide a less verbose way to check FCV-gated feature flags

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 8.2.0-rc0
    • Component/s: None
    • None
    • Catalog and Routing
    • 1
    • None
    • 3
    • TBD
    • 🟩 Routing and Topology
    • None
    • None
    • None
    • None
    • None
    • None
    • 0

      Since SERVER-99351, the FCV-gated feature flags API takes two required parameters:

      • A VersionContext&, which holds the Operation FCV of the operation, if any.
      • A snapshot of the server's global FCV, used when no Operation FCV is present.

       

      This makes the API for checking FCV-gated feature flags verbose. A typical check looks like:

      if (feature_flags::gFeatureFlagToaster.isEnabled(
              VersionContext::getDecoration(opCtx),
              serverGlobalParams.featureCompatibility.acquireFCVSnapshot())) {
          // The feature flag is enabled
      }
      

       

      We should provide a less verbose alternative. For example:

      if (feature_flags::gFeatureFlagToaster.isEnabled(
              VersionContext::getDecoration(opCtx)->withAcquiredFCVSnaphot())) {
          // The feature flag is enabled
      }
      

      Where VersionContext::withAcquiredFCVSnaphot returns a struct with both VersionContext and FCVSnapshot.

              Assignee:
              Unassigned
              Reporter:
              Joan Bruguera Micó
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: