diff options
author | matt dannenberg <matt.dannenberg@10gen.com> | 2014-07-30 09:30:21 -0400 |
---|---|---|
committer | matt dannenberg <matt.dannenberg@10gen.com> | 2014-08-05 04:54:29 -0400 |
commit | 87fbf90ba0096550a32f6f9967f5daa44398e8c6 (patch) | |
tree | f7b468a27f500d6574f8a36f6240927b6de4df63 /src/mongo/db/repl/replset_commands.cpp | |
parent | 6b534d4275b913eb8eaa31ffdacc7e25b5494afa (diff) | |
download | mongo-87fbf90ba0096550a32f6f9967f5daa44398e8c6.tar.gz |
SERVER-14616 replace BSONObj with HandshakeArgs and eliminate redundant handshake method
Diffstat (limited to 'src/mongo/db/repl/replset_commands.cpp')
-rw-r--r-- | src/mongo/db/repl/replset_commands.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mongo/db/repl/replset_commands.cpp b/src/mongo/db/repl/replset_commands.cpp index 7b421ed06a0..98523e5e7ac 100644 --- a/src/mongo/db/repl/replset_commands.cpp +++ b/src/mongo/db/repl/replset_commands.cpp @@ -368,12 +368,21 @@ namespace repl { // we have received a handshake, not an update message // handshakes are done here to ensure the receiving end supports the update command + HandshakeArgs handshake; + status = handshake.initialize(cmdObj["handshake"].embeddedObject()); + if (!status.isOK()) + return appendCommandStatus(result, status); + + if (!handshake.hasMemberId()) { + return appendCommandStatus( + result, + Status(ErrorCodes::NoSuchKey, + "replSetUpdatePosition handshake was missing 'member' field")); + } + return appendCommandStatus( result, - getGlobalReplicationCoordinator()->processReplSetUpdatePositionHandshake( - txn, - cmdObj["handshake"].embeddedObject(), - &result)); + getGlobalReplicationCoordinator()->processHandshake(txn, handshake)); } uassert(16888, "optimes field should be an array with an object for each secondary", |