summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands
diff options
context:
space:
mode:
authorMaria van Keulen <maria@mongodb.com>2018-02-18 20:02:26 -0500
committerMaria van Keulen <maria@mongodb.com>2018-02-28 13:05:14 -0500
commitd1ba78a5a83b58275aed657d71b58a57847e7027 (patch)
treec869a71d7b5974a895695354ace12b28f67c60c5 /src/mongo/db/commands
parentede0928eac1966b5be0a77f2579832242cea7b10 (diff)
downloadmongo-d1ba78a5a83b58275aed657d71b58a57847e7027.tar.gz
SERVER-32636 Close outgoing connections to earlier binVersion servers
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r--src/mongo/db/commands/feature_compatibility_version.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/mongo/db/commands/feature_compatibility_version.cpp b/src/mongo/db/commands/feature_compatibility_version.cpp
index c0edc6a028e..b64a072dc4b 100644
--- a/src/mongo/db/commands/feature_compatibility_version.cpp
+++ b/src/mongo/db/commands/feature_compatibility_version.cpp
@@ -43,6 +43,7 @@
#include "mongo/db/storage/storage_engine.h"
#include "mongo/db/wire_version.h"
#include "mongo/db/write_concern_options.h"
+#include "mongo/executor/egress_tag_closer_manager.h"
#include "mongo/rpc/get_status_from_command_result.h"
#include "mongo/transport/service_entry_point.h"
#include "mongo/util/log.h"
@@ -268,19 +269,21 @@ void FeatureCompatibilityVersion::onInsertOrUpdate(OperationContext* opCtx, cons
log() << "setting featureCompatibilityVersion to " << toString(newVersion);
}
- // On commit, update the server parameters, and close any incoming connections with a wire
- // version that is below the minimum.
+ // On commit, update the server parameters, and close any connections with a wire version that
+ // is below the minimum.
opCtx->recoveryUnit()->onCommit([opCtx, newVersion]() {
serverGlobalParams.featureCompatibility.setVersion(newVersion);
updateMinWireVersion();
- // Close all incoming connections from internal clients with binary versions lower than
- // ours. It would be desirable to close all outgoing connections to servers with lower
- // binary version, but it is not currently possible.
if (newVersion != ServerGlobalParams::FeatureCompatibility::Version::kFullyDowngradedTo36) {
+ // Close all incoming connections from internal clients with binary versions lower than
+ // ours.
opCtx->getServiceContext()->getServiceEntryPoint()->endAllSessions(
transport::Session::kLatestVersionInternalClientKeepOpen |
transport::Session::kExternalClientKeepOpen);
+ // Close all outgoing connections to servers with binary versions lower than ours.
+ executor::EgressTagCloserManager::get(opCtx->getServiceContext())
+ .dropConnections(transport::Session::kKeepOpen);
}
});
}