Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-102086

Operation FCV parsing should reject "invalid" as an input

    • Type: Icon: Bug Bug
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 8.2.0-rc0
    • Component/s: None
    • None
    • Catalog and Routing
    • ALL
    • CAR Team 2025-04-28
    • 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@mongodb.com Robert Sander
            Reporter:
            joan.bruguera-mico@mongodb.com Joan Bruguera Micó
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: