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

fCV checks can be racy if fCV is uninitialized in between the checks

    • Replication
    • Fully Compatible
    • ALL
    • v7.2, v7.0, v6.0, v5.0, v4.4
    • Repl 2023-09-04, Repl 2023-10-30, Repl 2023-11-13
    • 153

      For places in the codebase where we check the FCV in multiple places, this can be racy. For example, in FeatureFlag::isEnabled,
      it performs a check here if fcv is initialized and tries to perform comparison later. However, it is possible for fcv to be reset in between causing the comparison to be perfomed while fcv is not initialized.

      And example case where fcv can be uninitialized is when intial sync temporarily resets the value to uninitialized and sets the new value afterwards.

      This also applies to FCVServerStatusMetrics::generateSection and other instances where we check if FCV is initialized and then another FCV check that re-gets the FCV.

            huayu.ouyang@mongodb.com Huayu Ouyang
            randolph@mongodb.com Randolph Tan
            0 Vote for this issue
            6 Start watching this issue