[SERVER-20651] mongos should warn when connecting to a 3.0 mongod (or older) Created: 25/Sep/15  Updated: 25/Nov/15  Resolved: 19/Nov/15

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.1.8
Fix Version/s: 3.2.0-rc4

Type: Bug Priority: Major - P3
Reporter: Adam Midvidy Assignee: Misha Tyulenev
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 C (11/20/15), Sharding D (12/11/15)
Participants:

 Description   

Given that we have changed the upgrade order for the 3.2 series, we should have mongos warn() when connecting to a 3.0 shard. This can trivially be detected from the wireVersion.



 Comments   
Comment by Githook User [ 19/Nov/15 ]

Author:

{u'username': u'mikety', u'name': u'Misha Tyulenev', u'email': u'misha@mongodb.com'}

Message: SERVER-20651 do not allow mongos connect to mongod if mongod does not support COMMAND protocol
Branch: master
https://github.com/mongodb/mongo/commit/6ff0dce6e092f618f83d73f5a815c2b0cd766bcb

Comment by J Rassi [ 28/Sep/15 ]

Also, when we last spoke about this Andy Schwerin, you said that we shouldn't actually break anything if a 3.2 mongos talks to a 3.0 mongod, as it would probably do more harm than good.

I was under the impression that 3.2 mongos connects to shards with ScopedDbConnection and communicates operation-level shard version information, which 3.0 shards won't understand. In addition, 3.2 mongos runs all query operations with the find command, which 3.0 shards won't understand.

Comment by Adam Midvidy [ 28/Sep/15 ]

A 3.0 mongod has maxWireVersion of 3 (RELEASE_2_7_7) and a minWireVersion of 0.

A 3.2 mongos (with CSRS enabled) will have maxWireVersion of 4 (Find Command). If we bump minWireVersion to 4 as well, then the mongos should refuse to connect to a 3.0 mongod as the two ranges would have no overlap.

This has two problems:
(1) - it doesn't look like we currently reject connections with mismatched wireVersions, although this would be trivial to implement
(2) - it would break old drivers that don't support wireVersion 4.

Also, when we last spoke about this schwerin, you said that we shouldn't actually break anything if a 3.2 mongos talks to a 3.0 mongod, as it would probably do more harm than good. In that case, we shouldn't do any of this - the wireVersion idea was just a way of making such connections fail in a relatively clean way.

Comment by Andy Schwerin [ 28/Sep/15 ]

adam.midvidy, can you clarify how bumping minWireVersion achieves the goal of this ticket or something equivalent?

Comment by Adam Midvidy [ 26/Sep/15 ]

Maybe what we actually want to do is bump minWireVersion on mongos to FIND_COMMAND. (Which would accomplish what you want jason.rassi)

Comment by J Rassi [ 25/Sep/15 ]

Instead, I think we should consider treating this event as a connection failure or an operation failure. Due to the lack of OP_COMMAND on 3.0, can any operation be run successfully on these connections?

Generated at Thu Feb 08 03:54:51 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.