Skip to content

Commit 05ad4cb

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 fbc73a7 commit 05ad4cb

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
@@ -455,7 +455,7 @@ subtest notice_on_ttl_default_rate_limit
455455
query T noticetrace
456456
SET CLUSTER SETTING sql.ttl.default_delete_rate_limit = 90;
457457
----
458-
NOTICE: The TTL rate limit is per leaseholder per table.
458+
NOTICE: The TTL rate limit is per node per table.
459459
DETAIL: See the documentation for additional details: https://www.cockroachlabs.com/docs/dev/row-level-ttl#ttl-storage-parameters
460460

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

470470
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
@@ -906,7 +906,7 @@ CREATE TABLE tbl_set_ttl_params (
906906
ttl_disable_changefeed_replication = true
907907
)
908908
----
909-
NOTICE: The TTL rate limit is per leaseholder per table.
909+
NOTICE: The TTL rate limit is per node per table.
910910
DETAIL: See the documentation for additional details: https://www.cockroachlabs.com/docs/dev/row-level-ttl#ttl-storage-parameters
911911

912912
onlyif config schema-locked-disabled
@@ -933,7 +933,7 @@ skipif config local-read-committed local-repeatable-read
933933
query T noticetrace
934934
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')
935935
----
936-
NOTICE: The TTL rate limit is per leaseholder per table.
936+
NOTICE: The TTL rate limit is per node per table.
937937
DETAIL: See the documentation for additional details: https://www.cockroachlabs.com/docs/dev/row-level-ttl#ttl-storage-parameters
938938

939939
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
@@ -234,6 +234,10 @@ func (t *ttlProcessor) work(ctx context.Context, output execinfra.RowReceiver) e
234234
// involved in a TTL job.
235235
log.Dev.Infof(ctx, "TTL processor started processorID=%d tableID=%d", t.ProcessorID, tableID)
236236

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

0 commit comments

Comments
 (0)