diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2016-02-29 13:52:54 -0500 |
---|---|---|
committer | Adam Midvidy <amidvidy@gmail.com> | 2016-02-29 15:44:19 -0500 |
commit | 0bf608d1c28503aef3f809efc52d9a64d9315bfe (patch) | |
tree | 7f0a6d7bed44c1cf5d4300613112a63dc54c382a /src/mongo/executor | |
parent | 215928e7a750dc39abda821b0da702fbceaeffa9 (diff) | |
download | mongo-0bf608d1c28503aef3f809efc52d9a64d9315bfe.tar.gz |
SERVER-22897 add additional logging if we fail to negotiate RPC protocols
Diffstat (limited to 'src/mongo/executor')
-rw-r--r-- | src/mongo/executor/network_interface_asio_auth.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mongo/executor/network_interface_asio_auth.cpp b/src/mongo/executor/network_interface_asio_auth.cpp index b9a341d13d6..bc937028e5a 100644 --- a/src/mongo/executor/network_interface_asio_auth.cpp +++ b/src/mongo/executor/network_interface_asio_auth.cpp @@ -43,6 +43,7 @@ #include "mongo/rpc/legacy_request_builder.h" #include "mongo/rpc/reply_interface.h" #include "mongo/stdx/memory.h" +#include "mongo/util/log.h" #include "mongo/util/net/sock.h" #include "mongo/util/net/ssl_manager.h" @@ -102,6 +103,20 @@ void NetworkInterfaceASIO::_runIsMaster(AsyncOp* op) { rpc::negotiate(op->connection().serverProtocols(), op->connection().clientProtocols()); if (!negotiatedProtocol.isOK()) { + // Add relatively verbose logging here, since this should not happen unless we are + // mongos and we try to connect to a node that doesn't support OP_COMMAND. + warning() << "failed to negotiate protocol with remote host: " << op->request().target; + warning() << "request was: " << op->request().cmdObj; + warning() << "response was: " << commandReply.data; + + auto clientProtos = rpc::toString(op->connection().clientProtocols()); + if (clientProtos.isOK()) { + warning() << "our (client) supported protocols: " << clientProtos.getValue(); + } + auto serverProtos = rpc::toString(op->connection().serverProtocols()); + if (serverProtos.isOK()) { + warning() << "remote server's supported protocols:" << serverProtos.getValue(); + } return _completeOperation(op, negotiatedProtocol.getStatus()); } |