8000 Fix cluster-internal network protocol to HTTP/1 by jsteemann · Pull Request #14749 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Fix cluster-internal network protocol to HTTP/1 #14749

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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.

* Disable RTTI when compiling Snappy. RTTI used to be disabled previously,
up until some Merkle tree improvement PR was merged about one month ago,
which turned on RTTI for compiling Snappy.
Expand Down
19 changes: 17 additions & 2 deletions arangod/Network/NetworkFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,12 @@ void NetworkFeature::collectOptions(std::shared_ptr<options::ProgramOptions> opt
std::unordered_set<std::string> protos = {
"", "http", "http2", "h2", "vst"};

// starting with 3.9, we will hard-code the protocol for cluster-internal communication
options->addOption("--network 8000 .protocol", "network protocol to use for cluster-internal communication",
new DiscreteValuesParameter<StringParameter>(&_protocol, protos))
.setIntroducedIn(30700);
new DiscreteValuesParameter<StringParameter>(&_protocol, protos),
options::makeDefaultFlags(options::Flags::Hidden))
.setIntroducedIn(30700)
.setDeprecatedIn(30900);

options
->addOption("--network.max-requests-in-flight",
Expand Down Expand Up @@ -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;
Expand All @@ -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<network::ConnectionPool>(config);
_poolPtr.store(_pool.get(), std::memory_order_relaxed);

Expand Down
0