From d47ea66ec6127525d9fb99e026657aa33425f2da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Dziepak?= Date: Wed, 17 Apr 2019 15:43:18 +0100 Subject: [PATCH] messaging_service: add lz4_fragmented RPC compressor Seastar now supports two RPC compression algorithm: the original LZ4 one and LZ4_FRAGMENTED. The latter uses lz4 stream interface which allows it to process large messages without fully linearising them. Since, RPC requests used by Scylla often contain user-provided data that potentially could be very large, LZ4_FRAGMENTED is a better choice for the default compression algorithm. Message-Id: <20190417144318.27701-1-pdziepak@scylladb.com> --- message/messaging_service.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/message/messaging_service.cc b/message/messaging_service.cc index bf468331a2..f9334eb664 100644 --- a/message/messaging_service.cc +++ b/message/messaging_service.cc @@ -80,6 +80,7 @@ #include "idl/cache_temperature.dist.impl.hh" #include "idl/mutation.dist.impl.hh" #include +#include #include #include "idl/view.dist.impl.hh" #include "partition_range_compat.hh" @@ -129,8 +130,12 @@ using gossip_digest_ack2 = gms::gossip_digest_ack2; using rpc_protocol = rpc::protocol; using namespace std::chrono_literals; +static rpc::lz4_fragmented_compressor::factory lz4_fragmented_compressor_factory; static rpc::lz4_compressor::factory lz4_compressor_factory; -static rpc::multi_algo_compressor_factory compressor_factory(&lz4_compressor_factory); +static rpc::multi_algo_compressor_factory compressor_factory { + &lz4_fragmented_compressor_factory, + &lz4_compressor_factory, +}; struct messaging_service::rpc_protocol_wrapper : public rpc_protocol { using rpc_protocol::rpc_protocol; };