[SERVER-26087] _configsvrSetFeatureCompatibilityVersion should only set its own state if setFeatureCompatibilityVersion succeeded on all shards Created: 13/Sep/16  Updated: 19/Nov/16  Resolved: 14/Sep/16

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 3.3.14

Type: Improvement Priority: Major - P3
Reporter: David Storch Assignee: David Storch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Query 2016-09-19
Participants:

 Description   

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().



 Comments   
Comment by Githook User [ 14/Sep/16 ]

Author:

{u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}

Message: SERVER-26087 make config server only set its own featureCompatibilityVersion if all shards report success
Branch: master
https://github.com/mongodb/mongo/commit/63582d3c291235d11e7597d659bdfe365bdac158

Comment by David Storch [ 13/Sep/16 ]

milkie, this would be nice, but I'm not sure if it would be worthwhile to invest the engineering effort. The user can re-run sFCV() against the mongos whenever it fails in order to obtain a consistent state across the cluster.

Comment by Eric Milkie [ 13/Sep/16 ]

If setting the feature version fails on one of the shards, should the code attempt to undo the setting on the rest of the cluster? Otherwise you might be left with an unclean state across shards.

Generated at Thu Feb 08 04:11:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.