summaryrefslogtreecommitdiff
path: root/src/mongo/executor
diff options
context:
space:
mode:
authorLouis Williams <louis.williams@mongodb.com>2017-09-11 17:20:33 -0400
committerLouis Williams <louis.williams@mongodb.com>2017-09-19 15:55:50 -0400
commitb35c6fc183c26bc8a6d7cdfc8f5b970f90d60b56 (patch)
tree6035945d2cda2e8226b7576a06489a74f3435652 /src/mongo/executor
parent614cbd5a16c483df81f421f94fcdfdd995f8cc71 (diff)
downloadmongo-b35c6fc183c26bc8a6d7cdfc8f5b970f90d60b56.tar.gz
SERVER-29428 Fail gracefully in mongod when featureCompatibilityVersion is incompatibile
Diffstat (limited to 'src/mongo/executor')
-rw-r--r--src/mongo/executor/network_interface_asio_auth.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mongo/executor/network_interface_asio_auth.cpp b/src/mongo/executor/network_interface_asio_auth.cpp
index 3070de706c5..1dec3c902e8 100644
--- a/src/mongo/executor/network_interface_asio_auth.cpp
+++ b/src/mongo/executor/network_interface_asio_auth.cpp
@@ -38,6 +38,7 @@
#include "mongo/db/auth/authorization_manager_global.h"
#include "mongo/db/auth/internal_user_auth.h"
#include "mongo/db/commands.h"
+#include "mongo/db/commands/feature_compatibility_version_command_parser.h"
#include "mongo/db/server_options.h"
#include "mongo/db/wire_version.h"
#include "mongo/rpc/factory.h"
@@ -46,8 +47,10 @@
#include "mongo/rpc/metadata/client_metadata.h"
#include "mongo/rpc/reply_interface.h"
#include "mongo/stdx/memory.h"
+#include "mongo/util/exit.h"
#include "mongo/util/log.h"
#include "mongo/util/net/ssl_manager.h"
+#include "mongo/util/quick_exit.h"
#include "mongo/util/version.h"
namespace mongo {
@@ -112,9 +115,19 @@ void NetworkInterfaceASIO::_runIsMaster(AsyncOp* op) {
auto validateStatus =
rpc::validateWireVersion(WireSpec::instance().outgoing, protocolSet.getValue().version);
if (!validateStatus.isOK()) {
- warning() << "remote host has incompatible wire version: " << validateStatus;
- return _completeOperation(op, validateStatus);
+ if (WireSpec::instance().isInternalClient) {
+ severe() << "remote host has incompatible wire version: " << validateStatus;
+ severe() << "Please consult the documentation for upgrading this server: "
+ << feature_compatibility_version::kDochubLink;
+
+ // Exit if mongod should be upgraded.
+ quickExit(EXIT_NEED_UPGRADE);
+ } else {
+ warning() << "remote host has incompatible wire version: " << validateStatus;
+
+ return _completeOperation(op, validateStatus);
+ }
}
op->connection().setServerProtocols(protocolSet.getValue().protocolSet);