From 490f2eb0d6f10f9b85c36a7e952d132e0161342e Mon Sep 17 00:00:00 2001 From: jsteemann Date: Wed, 8 Sep 2021 16:59:47 +0200 Subject: [PATCH] Fix cluster-internal network protocol to HTTP/1 * Fix cluster-internal network protocol to HTTP/1 for now. Any other protocol selected via the startup option `--network.protocol` will automatically be switched to HTTP/1. The startup option `--network.protocol` is now deprecated and hidden by default. It will be removed in a future version of arangod. The rationale for this change is to move towards a single protocol for cluster-internal communication instead of 3 different ones. Note: we may move to a different protocol in the future, but this will then be an internal-only change. --- CHANGELOG | 7 +++++++ arangod/Network/NetworkFeature.cpp | 19 +++++++++++++++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index c8a0c43445bd..440ec23f2168 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,13 @@ devel ----- +* Fix cluster-internal network protocol to HTTP/1 for now. Any other protocol + selected via the startup option `--network.protocol` will automatically be + switched to HTTP/1. The startup option `--network.protocol` is now deprecated + and hidden by default. It will be removed in a future version of arangod. + The rationale for this change is to move towards a single protocol for + cluster-internal communication instead of 3 different ones. + * (EE only) Bug-fix: If you created a ArangoSearch view on Satellite- Collections only and then join with a collection only having a single shard the cluster-one-shard-rule was falsely applied and could lead to diff --git a/arangod/Network/NetworkFeature.cpp b/arangod/Network/NetworkFeature.cpp index d152a6c060e9..40c0b52cc5ba 100644 --- a/arangod/Network/NetworkFeature.cpp +++ b/arangod/Network/NetworkFeature.cpp @@ -133,9 +133,12 @@ void NetworkFeature::collectOptions(std::shared_ptr opt std::unordered_set protos = { "", "http", "http2", "h2", "vst"}; + // starting with 3.9, we will hard-code the protocol for cluster-internal communication options->addOption("--network.protocol", "network protocol to use for cluster-internal communication", - new DiscreteValuesParameter(&_protocol, protos)) - .setIntroducedIn(30700); + new DiscreteValuesParameter(&_protocol, protos), + options::makeDefaultFlags(options::Flags::Hidden)) + .setIntroducedIn(30700) + .setDeprecatedIn(30900); options ->addOption("--network.max-requests-in-flight", @@ -182,6 +185,11 @@ void NetworkFeature::prepare() { config.clusterInfo = ci; config.name = "ClusterComm"; + // using an internal network protocol other than HTTP/1 is + // not supported since 3.9. the protocol is always hard-coded + // to HTTP/1 from now on. + // note: we plan to upgrade the internal protocol to HTTP/2 at + // some point in the future config.protocol = fuerte::ProtocolType::Http; if (_protocol == "http" || _protocol == "h1") { config.protocol = fuerte::ProtocolType::Http; @@ -191,6 +199,13 @@ void NetworkFeature::prepare() { config.protocol = fuerte::ProtocolType::Vst; } + if (config.protocol != fuerte::ProtocolType::Http) { + LOG_TOPIC("6d221", WARN, Logger::CONFIG) + << "using `--network.protocol` is deprecated. " + << "the network protocol for cluster-internal requests is hard-coded to HTTP/1 in this version"; + config.protocol = fuerte::ProtocolType::Http; + } + _pool = std::make_unique(config); _poolPtr.store(_pool.get(), std::memory_order_relaxed);