diff options
author | David Storch <david.storch@10gen.com> | 2016-10-18 10:05:14 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2016-10-20 16:06:07 -0400 |
commit | 81ea77ca8305f6a8783ba29e1a93cafa6be81a50 (patch) | |
tree | 2cc15cc7534df3b27e62316d9a0ae0e48ef8ac8c /src/mongo/db/wire_version.h | |
parent | 315f92405c5f5e5f4159ccbb55b0352cfe235852 (diff) | |
download | mongo-81ea77ca8305f6a8783ba29e1a93cafa6be81a50.tar.gz |
SERVER-26420 add internalClient information to isMaster handshake request
Diffstat (limited to 'src/mongo/db/wire_version.h')
-rw-r--r-- | src/mongo/db/wire_version.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/src/mongo/db/wire_version.h b/src/mongo/db/wire_version.h index de816c0ae1b..eeb4f41ef4f 100644 --- a/src/mongo/db/wire_version.h +++ b/src/mongo/db/wire_version.h @@ -29,6 +29,7 @@ #pragma once #include "mongo/base/disallow_copying.h" +#include "mongo/bson/bsonobjbuilder.h" namespace mongo { @@ -78,10 +79,26 @@ struct WireVersionInfo { struct WireSpec { MONGO_DISALLOW_COPYING(WireSpec); - static WireSpec& instance() { - static WireSpec instance; - return instance; - } + static WireSpec& instance(); + + /** + * Appends the min and max versions in 'wireVersionInfo' to 'builder' in the format expected for + * reporting information about the internal client. + * + * Intended for use as part of performing the isMaster handshake with a remote node. When an + * internal clients make a connection to another node in the cluster, it includes internal + * client information as a parameter to the isMaster command. This parameter has the following + * format: + * + * internalClient: { + * minWireVersion: <int>, + * maxWireVersion: <int> + * } + * + * This information can be used to ensure correctness during upgrade in mixed version clusters. + */ + static void appendInternalClientWireVersion(WireVersionInfo wireVersionInfo, + BSONObjBuilder* builder); // incoming.minWireVersion - Minimum version that the server accepts on incoming requests. We // should bump this whenever we don't want to allow incoming connections from clients that are |