summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2017-11-27 19:09:27 -0500
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2017-11-28 15:16:47 -0500
commitb7c69773419d69237f932ac7cc8b48661f593efe (patch)
tree957db4d5b2dc6cfbe7f828ddc7e212e36c3743ee
parent672cc4c67de8cba44901cf6db1cc346016848a35 (diff)
downloadmongo-b7c69773419d69237f932ac7cc8b48661f593efe.tar.gz
SERVER-21456 Only rely on isMaster to set kKeepOpen tag on transport sessions.
-rw-r--r--src/mongo/db/repl/repl_set_commands.cpp14
-rw-r--r--src/mongo/db/repl/repl_set_request_votes.cpp14
2 files changed, 0 insertions, 28 deletions
diff --git a/src/mongo/db/repl/repl_set_commands.cpp b/src/mongo/db/repl/repl_set_commands.cpp
index 3e1687500aa..5bc28841697 100644
--- a/src/mongo/db/repl/repl_set_commands.cpp
+++ b/src/mongo/db/repl/repl_set_commands.cpp
@@ -744,20 +744,6 @@ public:
return appendCommandStatus(result, status);
}
- /* we want to keep heartbeat connections open when relinquishing primary.
- tag them here. */
- auto session = opCtx->getClient()->session();
- if (session) {
- session->setTags(transport::Session::kKeepOpen);
- }
-
- // Unset the tag on block exit
- ON_BLOCK_EXIT([session]() {
- if (session) {
- session->unsetTags(transport::Session::kKeepOpen);
- }
- });
-
// Process heartbeat based on the version of request. The missing fields in mismatched
// version will be empty.
if (isHeartbeatRequestV1(cmdObj)) {
diff --git a/src/mongo/db/repl/repl_set_request_votes.cpp b/src/mongo/db/repl/repl_set_request_votes.cpp
index e0c28def452..903533f703e 100644
--- a/src/mongo/db/repl/repl_set_request_votes.cpp
+++ b/src/mongo/db/repl/repl_set_request_votes.cpp
@@ -62,20 +62,6 @@ private:
return appendCommandStatus(result, status);
}
- // We want to keep request vote connection open when relinquishing primary.
- // Tag it here.
- auto session = opCtx->getClient()->session();
- if (session) {
- session->setTags(transport::Session::kKeepOpen);
- }
-
- // Untag the connection on exit.
- ON_BLOCK_EXIT([session]() {
- if (session) {
- session->unsetTags(transport::Session::kKeepOpen);
- }
- });
-
ReplSetRequestVotesResponse response;
status = getGlobalReplicationCoordinator()->processReplSetRequestVotes(
opCtx, parsedArgs, &response);