cql3: Move batch_size_warn_threshold_in_kb to cql_config

The batch_size_warn_threshold_in_kb option controls the batch size at
which a client warning is emitted during batch execution. It belongs in
cql_config rather than db::config as it directly governs CQL batch
statement behavior.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
Pavel Emelyanov
2026-04-09 15:58:45 +03:00
parent a3f097f100
commit 4d255cf533
2 changed files with 5 additions and 1 deletions

View File

@@ -23,12 +23,14 @@ struct cql_config {
utils::updateable_value<uint32_t> select_internal_page_size;
utils::updateable_value<db::tri_mode_restriction> strict_allow_filtering;
utils::updateable_value<bool> enable_parallelized_aggregation;
utils::updateable_value<uint32_t> batch_size_warn_threshold_in_kb;
explicit cql_config(const db::config& cfg)
: restrictions(cfg)
, select_internal_page_size(cfg.select_internal_page_size)
, strict_allow_filtering(cfg.strict_allow_filtering)
, enable_parallelized_aggregation(cfg.enable_parallelized_aggregation)
, batch_size_warn_threshold_in_kb(cfg.batch_size_warn_threshold_in_kb)
{}
struct default_tag{};
cql_config(default_tag)
@@ -36,6 +38,7 @@ struct cql_config {
, select_internal_page_size(10000)
, strict_allow_filtering(db::tri_mode_restriction(db::tri_mode_restriction_t::mode::WARN))
, enable_parallelized_aggregation(true)
, batch_size_warn_threshold_in_kb(128)
{}
};

View File

@@ -11,6 +11,7 @@
#include "cql3/util.hh"
#include "raw/batch_statement.hh"
#include "db/config.hh"
#include "cql3/cql_config.hh"
#include "db/consistency_level_validations.hh"
#include "data_dictionary/data_dictionary.hh"
#include <seastar/core/execution_stage.hh>
@@ -195,7 +196,7 @@ void batch_statement::verify_batch_size(query_processor& qp, const utils::chunke
return; // We only warn for batch spanning multiple mutations
}
size_t warn_threshold = qp.db().get_config().batch_size_warn_threshold_in_kb() * 1024;
size_t warn_threshold = qp.get_cql_config().batch_size_warn_threshold_in_kb() * 1024;
size_t fail_threshold = qp.db().get_config().batch_size_fail_threshold_in_kb() * 1024;
size_t size = 0;