db: add rows_count_fail_threshold config option

Reject writes targeting a partition whose on-disk row count already
exceeds this threshold.  Code default is 0 (disabled) for existing
clusters; scylla.yaml ships 200000 for new deployments.
This commit is contained in:
Taras Veretilnyk
2026-05-13 13:47:17 +02:00
parent c12b16603d
commit 64fc53cb7c
3 changed files with 8 additions and 0 deletions

View File

@@ -438,6 +438,10 @@ large_partition_fail_threshold_mb: 2000
# Log a warning when row number is larger than this value
# compaction_rows_count_warning_threshold: 100000
# Reject writes to partitions whose on-disk row count exceeds this threshold.
# Set to 0 to disable.
rows_count_fail_threshold: 200000
# Log a warning when writing a collection containing more elements than this value
# compaction_collection_elements_count_warning_threshold: 10000

View File

@@ -789,6 +789,9 @@ db::config::config(std::shared_ptr<db::extensions> exts)
, large_partition_fail_threshold_mb(this, "large_partition_fail_threshold_mb", liveness::LiveUpdate, value_status::Used, 0,
"Reject writes targeting a partition whose on-disk size already exceeds this threshold in MB, as recorded in any SSTable's large data records. "
"Set to 0 to disable.")
, rows_count_fail_threshold(this, "rows_count_fail_threshold", liveness::LiveUpdate, value_status::Used, 0,
"Reject writes targeting a partition whose on-disk row count already exceeds this threshold, as recorded in any SSTable's large data records. "
"Set to 0 to disable.")
, compaction_rows_count_warning_threshold(this, "compaction_rows_count_warning_threshold", liveness::LiveUpdate, value_status::Used, 100000,
"Log a warning when writing a number of rows larger than this value.")
, compaction_collection_elements_count_warning_threshold(this, "compaction_collection_elements_count_warning_threshold", liveness::LiveUpdate, value_status::Used, 10000,

View File

@@ -226,6 +226,7 @@ public:
named_value<uint32_t> compaction_large_row_warning_threshold_mb;
named_value<uint32_t> compaction_large_cell_warning_threshold_mb;
named_value<uint32_t> large_partition_fail_threshold_mb;
named_value<uint32_t> rows_count_fail_threshold;
named_value<uint32_t> compaction_rows_count_warning_threshold;
named_value<uint32_t> compaction_collection_elements_count_warning_threshold;
named_value<uint32_t> compaction_large_data_records_per_sstable;