[SERVER-26715] mongo shell does not correctly initialize its own min and max wire version Created: 20/Oct/16 Updated: 19/Nov/16 Resolved: 08/Nov/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | None |
| Fix Version/s: | 3.4.0-rc3 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Storch | Assignee: | Jonathan Reams |
| Resolution: | Done | Votes: | 0 |
| Labels: | platforms-hocr | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Backwards Compatibility: | Fully Compatible | |||||||||||||||
| Operating System: | ALL | |||||||||||||||
| Steps To Reproduce: | Apply this patch and attempt to connect the shell to mongod:
It should fail with a message like this:
|
|||||||||||||||
| Sprint: | Platforms 2016-11-21 | |||||||||||||||
| Participants: |
| Description |
|
The wire_version library, which is linked into mongo, mongod, and mongos, has a static singleton instance of WireSpec, which defines the incoming and outgoing wire protocol versions of the process: Mongod and mongos both have code for initializing these wire versions: The mongo shell, however, has no such initialization. The object will be zero-initialized, which means that the shell's range of outgoing wire protocol versions is [0, 0]. This is incorrect, because the shell actually supports range [0, 5]. This bug has not yet manifested because all existing versions of mongod and mongos include 0 in their range of supported incoming wire versions. However, if a future version were to bump the minimum incoming wire version, older versions of the shell would refuse to connect. |
| Comments |
| Comment by Githook User [ 08/Nov/16 ] |
|
Author: {u'username': u'jbreams', u'name': u'Jonathan Reams', u'email': u'jbreams@mongodb.com'}Message: |
| Comment by Jonathan Reams [ 07/Nov/16 ] |
|
david.storch, do we want WireSpec to always default to min/max wireversion and not be zero-initialized, or do we want the shell to have a separate initWireSpec function? |