Skip to content

Commit e1ecaeb

Browse files
committed
sql/ttl: clarify TTL rate limiter notice
The TTL rate limiter notice incorrectly stated it applies "per leaseholder per table", when it actually applies "per node per table". This updates the message for accuracy. Fixes #144463 Epic: none Release note: none
1 parent 2c3ff15 commit e1ecaeb

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

pkg/sql/logictest/testdata/logic_test/cluster_settings

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ subtest notice_on_ttl_default_rate_limit
454454
query T noticetrace
455455
SET CLUSTER SETTING sql.ttl.default_delete_rate_limit = 90;
456456
----
457-
NOTICE: The TTL rate limit is per leaseholder per table.
457+
NOTICE: The TTL rate limit is per node per table.
458458
DETAIL: See the documentation for additional details: https://www.cockroachlabs.com/docs/v25.2/row-level-ttl#ttl-storage-parameters
459459

460460
statement ok
@@ -463,7 +463,7 @@ SET CLUSTER SETTING sql.ttl.default_delete_rate_limit = 100;
463463
query T noticetrace
464464
SET CLUSTER SETTING sql.ttl.default_select_rate_limit = 100;
465465
----
466-
NOTICE: The TTL rate limit is per leaseholder per table.
466+
NOTICE: The TTL rate limit is per node per table.
467467
DETAIL: See the documentation for additional details: https://www.cockroachlabs.com/docs/v25.2/row-level-ttl#ttl-storage-parameters
468468

469469
statement ok

pkg/sql/logictest/testdata/logic_test/row_level_ttl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -810,7 +810,7 @@ CREATE TABLE tbl_set_ttl_params (
810810
ttl_disable_changefeed_replication = true
811811
)
812812
----
813-
NOTICE: The TTL rate limit is per leaseholder per table.
813+
NOTICE: The TTL rate limit is per node per table.
814814
DETAIL: See the documentation for additional details: https://www.cockroachlabs.com/docs/v25.2/row-level-ttl#ttl-storage-parameters
815815

816816
query T
@@ -826,7 +826,7 @@ skipif config local-read-committed local-repeatable-read
826826
query T noticetrace
827827
ALTER TABLE tbl_set_ttl_params SET (ttl_select_batch_size = 110, ttl_delete_batch_size = 120, ttl_select_rate_limit = 130, ttl_delete_rate_limit = 140, ttl_row_stats_poll_interval = '2m0s')
828828
----
829-
NOTICE: The TTL rate limit is per leaseholder per table.
829+
NOTICE: The TTL rate limit is per node per table.
830830
DETAIL: See the documentation for additional details: https://www.cockroachlabs.com/docs/v25.2/row-level-ttl#ttl-storage-parameters
831831

832832
onlyif config local-read-committed local-repeatable-read

pkg/sql/set_cluster_setting.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ func printTTLRateLimitNotice(ctx context.Context, p eval.ClientNoticeSender) {
252252
p.BufferClientNotice(
253253
ctx,
254254
errors.WithDetail(
255-
pgnotice.Newf("The TTL rate limit is per leaseholder per table."),
255+
pgnotice.Newf("The TTL rate limit is per node per table."),
256256
ttlDocDetail,
257257
),
258258
)

pkg/sql/ttl/ttljob/ttljob_processor.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ func (t *ttlProcessor) work(ctx context.Context) error {
142142
// involved in a TTL job.
143143
log.Infof(ctx, "TTL processor started processorID=%d tableID=%d", t.ProcessorID, tableID)
144144

145+
// Each node sets up two rate limiters (one for SELECT, one for DELETE) per
146+
// table. The limiters apply to all ranges assigned to this processor, whether
147+
// or not the node is the leaseholder for those ranges.
148+
145149
selectRateLimit := ttlSpec.SelectRateLimit
146150
// Default 0 value to "unlimited" in case job started on node <= v23.2.
147151
// todo(sql-foundations): Remove this in 25.1 for consistency with

0 commit comments

Comments
 (0)