From a81416862a484dfdfd3b07b3e4d6d23446b8d99f Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 29 Jan 2025 07:42:03 +0800 Subject: [PATCH 1/2] config: start available options with '*' use '*' prefix for config option values instead of escape sequences The custom Sphinx extension that generates documentation from config.cc help messages has issues with C++ escape sequences. For example, "\tall: All traffic" renders incorrectly as "tall: All traffic" in HTML output. Instead of using escape sequences, switch to bullet-point style with '*' prefix which works better in both CLI and HTML rendering. This matches our existing documentation style for available option values in other configs. Note: This change puts type/default/liveness info in the same bullet list as option values. This limitation affects other similar config options and will need to be addressed comprehensively in a future change. Refs scylladb/scylladb#22423 Signed-off-by: Kefu Chai --- db/config.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/config.cc b/db/config.cc index f6f8352c2b..7ae10aa4d5 100644 --- a/db/config.cc +++ b/db/config.cc @@ -904,9 +904,9 @@ db::config::config(std::shared_ptr exts) "Sets the receiving socket buffer size in bytes for inter-node calls.") , internode_compression(this, "internode_compression", value_status::Used, "none", "Controls whether traffic between nodes is compressed. The valid values are:\n" - "\tall: All traffic is compressed.\n" - "\tdc : Traffic between data centers is compressed.\n" - "\tnone : No compression.") + "* all: All traffic is compressed.\n" + "* dc : Traffic between data centers is compressed.\n" + "* none : No compression.") , internode_compression_zstd_max_cpu_fraction(this, "internode_compression_zstd_max_cpu_fraction", liveness::LiveUpdate, value_status::Used, 0.000, "ZSTD compression of RPC will consume at most this fraction of each internode_compression_zstd_quota_refresh_period_ms time slice.\n" "If you wish to try out zstd for RPC compression, 0.05 is a reasonable starting point.") From 8d0cabb3924e9a2dddb2f16fb0320e5b2aa4d8af Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 29 Jan 2025 14:41:21 +0800 Subject: [PATCH 2/2] config: validate internode_compression option values Previously, the internode_compression option silently defaulted to 'none' for any unrecognized value instead of validating input. It only compared against 'all' and 'dc', making it error-prone. Add explicit validation for the three supported values: - all - dc - none This ensures invalid values are rejected both in command line and YAML configuration, providing better error messages to users. Signed-off-by: Kefu Chai --- db/config.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/config.cc b/db/config.cc index 7ae10aa4d5..79f9e494ac 100644 --- a/db/config.cc +++ b/db/config.cc @@ -906,7 +906,8 @@ db::config::config(std::shared_ptr exts) "Controls whether traffic between nodes is compressed. The valid values are:\n" "* all: All traffic is compressed.\n" "* dc : Traffic between data centers is compressed.\n" - "* none : No compression.") + "* none : No compression.", + {"all", "dc", "none"}) , internode_compression_zstd_max_cpu_fraction(this, "internode_compression_zstd_max_cpu_fraction", liveness::LiveUpdate, value_status::Used, 0.000, "ZSTD compression of RPC will consume at most this fraction of each internode_compression_zstd_quota_refresh_period_ms time slice.\n" "If you wish to try out zstd for RPC compression, 0.05 is a reasonable starting point.")