Operation FCV parsing should reject "invalid" as an input

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.2.0-rc0
    • Affects Version/s: 8.2.0-rc0
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • CAR Team 2025-04-28, CAR Team 2025-05-12
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      SERVER-99545 introduced the initial definition of Operation FCV along with logic to parse it, validating that is one of the following values:

      • GenericFCV::kLatest
      • GenericFCV::kLastContinuous
      • GenericFCV::kLastLTS
      • GenericFCV::kUpgradingFromLastLTSToLatest
      • GenericFCV::kDowngradingFromLatestToLastLTS
      • GenericFCV::kUpgradingFromLastContinuousToLatest
      • GenericFCV::kDowngradingFromLatestToLastContinuous
      • GenericFCV::kUpgradingFromLastLTSToLastContinuous

      However, this logic has a flaw: When LastLTS == LastContinuous, then GenericFCV::kUpgradingFromLastLTSToLastContinuous is an alias for FeatureCompatibilityVersion::kInvalid. This makes the parser accept the string "invalid" as a valid OFCV value.

      Furthermore, kUpgradingFromLastLTSToLatest and kUpgradingFromLastContinuousToLatest may be aliases, which makes the returned message contain duplicate values:

      {
      	"ok" : 0,
      	"errmsg" : "Invalid feature compatibility version value 'asdas'. Expected one of the following versions: ''8.1', '8.0', '8.0', 'upgrading from 8.0 to 8.1', 'downgrading from 8.1 to 8.0', 'upgrading from 8.0 to 8.1', 'downgrading from 8.1 to 8.0', 'invalid'",
      	"code" : 2,
      	"codeName" : "BadValue"
      }
      

              Assignee:
              Robert Sander
              Reporter:
              Joan Bruguera Micó
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: