From 64fc53cb7c750e7b776ace7fbc2cc3e35ff763fa Mon Sep 17 00:00:00 2001 From: Taras Veretilnyk Date: Wed, 13 May 2026 13:47:17 +0200 Subject: [PATCH] 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. --- conf/scylla.yaml | 4 ++++ db/config.cc | 3 +++ db/config.hh | 1 + 3 files changed, 8 insertions(+) diff --git a/conf/scylla.yaml b/conf/scylla.yaml index 5b0bcdd4ad..6fa9a2c50e 100644 --- a/conf/scylla.yaml +++ b/conf/scylla.yaml @@ -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 diff --git a/db/config.cc b/db/config.cc index f8e2577477..19edebc554 100644 --- a/db/config.cc +++ b/db/config.cc @@ -789,6 +789,9 @@ db::config::config(std::shared_ptr 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, diff --git a/db/config.hh b/db/config.hh index 8241b1ea38..c02a905eaf 100644 --- a/db/config.hh +++ b/db/config.hh @@ -226,6 +226,7 @@ public: named_value compaction_large_row_warning_threshold_mb; named_value compaction_large_cell_warning_threshold_mb; named_value large_partition_fail_threshold_mb; + named_value rows_count_fail_threshold; named_value compaction_rows_count_warning_threshold; named_value compaction_collection_elements_count_warning_threshold; named_value compaction_large_data_records_per_sstable;