[SERVER-25518] verify that shardVersion not sent on any commands sent from mongos to a shard before shard is sharding aware Created: 09/Aug/16  Updated: 03/Sep/16  Resolved: 02/Sep/16

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Esha Maharishi (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2016-08-29, Sharding 2016-09-19
Participants:

 Description   

Example:

3.2 mongos adds 3.4 --shardsvr mongod.

The shardIdentity is inserted asynchronously on the mongod through the config.

The mongos immediately starts using the new shard, though the shard may not have received its shardIdentity (and thus enabled its sharding state) yet.

Make sure any commands that the mongos can send before a command that performs setShardVersion (moveChunk, splitChunk, etc) do not include shardVersion info. If they do, the mongod will massert:

https://github.com/mongodb/mongo/blob/9a1688ba6c07117405c46cc6fb1275cb1fcbb4cf/src/mongo/db/commands/dbcommands.cpp#L1377-L1391



 Comments   
Comment by Esha Maharishi (Inactive) [ 02/Sep/16 ]

The massert was replaced with a uassert in this commit:

https://github.com/mongodb/mongo/commit/5b6ca35994ae865db7ea3a036cd53aa43a62d2c5

If the shard is running with --shardsvr but is not yet shard aware, it will now correctly return an error status to mongos.

Comment by Esha Maharishi (Inactive) [ 11/Aug/16 ]

spencer, I don't, but if it isn't, it will have been passing silently so far, so wanted to double-check.

Comment by Spencer Brody (Inactive) [ 10/Aug/16 ]

esha.maharishi, do you have reason to believe this isn't the case currently?

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