diff options
author | Jonathan Reams <jbreams@mongodb.com> | 2016-11-07 15:00:15 -0500 |
---|---|---|
committer | Jonathan Reams <jbreams@mongodb.com> | 2016-11-08 13:03:08 -0500 |
commit | 96686d8572eea8316eab9675d2dfa3dfce5b998e (patch) | |
tree | 4a633a61d0d72ba0a9b7862b4cf35e87173b53c0 /src/mongo/db | |
parent | 807d098fa8f41d318ffb5559ce8438c4e8372a84 (diff) | |
download | mongo-96686d8572eea8316eab9675d2dfa3dfce5b998e.tar.gz |
SERVER-26715 Set default values for WireSpec min/max values
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/db.cpp | 6 | ||||
-rw-r--r-- | src/mongo/db/wire_version.h | 8 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/mongo/db/db.cpp b/src/mongo/db/db.cpp index fde9d258edd..9e138fcf61d 100644 --- a/src/mongo/db/db.cpp +++ b/src/mongo/db/db.cpp @@ -507,12 +507,6 @@ void repairDatabasesAndCheckVersion(OperationContext* txn) { void _initWireSpec() { WireSpec& spec = WireSpec::instance(); - // accept from any version - spec.incoming.minWireVersion = RELEASE_2_4_AND_BEFORE; - spec.incoming.maxWireVersion = COMMANDS_ACCEPT_WRITE_CONCERN; - // connect to any version - spec.outgoing.minWireVersion = RELEASE_2_4_AND_BEFORE; - spec.outgoing.maxWireVersion = COMMANDS_ACCEPT_WRITE_CONCERN; spec.isInternalClient = true; } diff --git a/src/mongo/db/wire_version.h b/src/mongo/db/wire_version.h index 2b33b8c5578..4dbab63f778 100644 --- a/src/mongo/db/wire_version.h +++ b/src/mongo/db/wire_version.h @@ -66,6 +66,10 @@ enum WireVersion { // Supports all write commands take a write concern. COMMANDS_ACCEPT_WRITE_CONCERN = 5, + + // Set this to the highest value in this enum - it will be the default maxWireVersion for + // the WireSpec values. + LATEST_WIRE_VERSION = COMMANDS_ACCEPT_WRITE_CONCERN, }; /** @@ -106,14 +110,14 @@ struct WireSpec { // incoming.maxWireVersion - Latest version that the server accepts on incoming requests. This // should always be at the latest entry in WireVersion. - WireVersionInfo incoming; + WireVersionInfo incoming = {RELEASE_2_4_AND_BEFORE, LATEST_WIRE_VERSION}; // outgoing.minWireVersion - Minimum version allowed on remote nodes when the server sends // requests. We should bump this whenever we don't want to connect to clients that are too old. // outgoing.maxWireVersion - Latest version allowed on remote nodes when the server sends // requests. - WireVersionInfo outgoing; + WireVersionInfo outgoing = {RELEASE_2_4_AND_BEFORE, LATEST_WIRE_VERSION}; // Set to true if the client is internal to the cluster---this is a mongod or mongos connecting // to another mongod. |