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

_configsvrSetFeatureCompatibilityVersion should only set its own state if setFeatureCompatibilityVersion succeeded on all shards

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.3.14
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Fully Compatible
    • Query 2016-09-19

      The mongos implementation of setFeatureCompatibilityVersion works simply by calling the internal _configsvrSetFeatureCompatibilityVersion command on the primary shard of the config server replica set. In the implementation of this internal command, the config server does the following:

      // Set featureCompatibilityVersion on self.
      FeatureCompatibilityVersion::set(txn, version);
      
      // Forward to all shards.
      uassertStatusOK(Grid::get(txn)->catalogManager()->setFeatureCompatibilityVersionOnShards(txn, version));
      
      return true;
      

      Namely, it sets its own state and then forwards the sFCV() command to all shards, failing if any of the shards fail. This leads to the following problem scenario:

      1. Mongos sFCV("3.4") calls _configsvfSFCV("3.4") on the primary shard of the config server replica set.
      2. The config server successfully sets its own state to "3.4".
      3. Due to, say, a network problem, sFCV() on one of the shards fails.

      Now the config server primary will report "3.4" as its feature compatibility version, even if sFCV("3.4") did not succeed cluster-wide.

      In order to allow the config server primary to act as the cluster's source of truth for the current feature compatibility version, it should set its own state only after all shards have returned successfully from sFCV().

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: