summaryrefslogtreecommitdiff
path: root/src/mongo/rpc/protocol.cpp
diff options
context:
space:
mode:
authorDianna Hohensee <dianna.hohensee@10gen.com>2018-01-17 10:43:14 -0500
committerDianna Hohensee <dianna.hohensee@10gen.com>2018-02-16 16:30:44 -0500
commitd1c188b17167f0430f5a8d10e972c0d00a908ba2 (patch)
tree8ce4510c4ec7507a17a2ad6719cf6695f5149b4b /src/mongo/rpc/protocol.cpp
parent902b8552f11697308604823c19d6dbce661fc3d6 (diff)
downloadmongo-d1c188b17167f0430f5a8d10e972c0d00a908ba2.tar.gz
SERVER-32635 an old mongos server communicating with a fully upgraded cluster should crash
Diffstat (limited to 'src/mongo/rpc/protocol.cpp')
-rw-r--r--src/mongo/rpc/protocol.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/mongo/rpc/protocol.cpp b/src/mongo/rpc/protocol.cpp
index fe0f9cebfcc..8d4823da8e8 100644
--- a/src/mongo/rpc/protocol.cpp
+++ b/src/mongo/rpc/protocol.cpp
@@ -211,16 +211,14 @@ Status validateWireVersion(const WireVersionInfo client, const WireVersionInfo s
// We assert the invariant that min < max above.
if (!(client.minWireVersion <= server.maxWireVersion &&
client.maxWireVersion >= server.minWireVersion)) {
- return Status(ErrorCodes::IncompatibleServerVersion,
- str::stream() << "Server min and max wire version are incompatible ("
- << server.minWireVersion
- << ","
- << server.maxWireVersion
- << ") with client min wire version ("
- << client.minWireVersion
- << ","
- << client.maxWireVersion
- << ")");
+ std::string errmsg = str::stream()
+ << "Server min and max wire version (" << server.minWireVersion << ","
+ << server.maxWireVersion << ") is incompatible with client min wire version ("
+ << client.minWireVersion << "," << client.maxWireVersion << ").";
+ if (client.maxWireVersion < server.minWireVersion) {
+ return Status(ErrorCodes::IncompatibleWithUpgradedServer, errmsg);
+ }
+ return Status(ErrorCodes::IncompatibleServerVersion, errmsg);
}
return Status::OK();