Skip to content

Commit 97f0775

Browse files
authored
Merge pull request #152753 from spilchen/backport24.1-152738
release-24.1: sql/ttl: clarify TTL rate limiter notice
2 parents 602d77c + 5420e21 commit 97f0775

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
@@ -446,7 +446,7 @@ subtest notice_on_ttl_default_rate_limit
446446
query T noticetrace
447447
SET CLUSTER SETTING sql.ttl.default_delete_rate_limit = 90;
448448
----
449-
NOTICE: The TTL rate limit is per leaseholder per table.
449+
NOTICE: The TTL rate limit is per node per table.
450450
DETAIL: See the documentation for additional details: https://www.cockroachlabs.com/docs/v24.1/row-level-ttl#ttl-storage-parameters
451451

452452
statement ok
@@ -455,7 +455,7 @@ SET CLUSTER SETTING sql.ttl.default_delete_rate_limit = 100;
455455
query T noticetrace
456456
SET CLUSTER SETTING sql.ttl.default_select_rate_limit = 100;
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/v24.1/row-level-ttl#ttl-storage-parameters
460460

461461
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
@@ -798,7 +798,7 @@ CREATE TABLE tbl_set_ttl_params (
798798
ttl_disable_changefeed_replication = true
799799
)
800800
----
801-
NOTICE: The TTL rate limit is per leaseholder per table.
801+
NOTICE: The TTL rate limit is per node per table.
802802
DETAIL: See the documentation for additional details: https://www.cockroachlabs.com/docs/v24.1/row-level-ttl#ttl-storage-parameters
803803

804804
query T
@@ -814,7 +814,7 @@ skipif config local-read-committed local-repeatable-read
814814
query T noticetrace
815815
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')
816816
----
817-
NOTICE: The TTL rate limit is per leaseholder per table.
817+
NOTICE: The TTL rate limit is per node per table.
818818
DETAIL: See the documentation for additional details: https://www.cockroachlabs.com/docs/v24.1/row-level-ttl#ttl-storage-parameters
819819

820820
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
@@ -251,7 +251,7 @@ func printTTLRateLimitNotice(ctx context.Context, p eval.ClientNoticeSender) {
251251
p.BufferClientNotice(
252252
ctx,
253253
errors.WithDetail(
254-
pgnotice.Newf("The TTL rate limit is per leaseholder per table."),
254+
pgnotice.Newf("The TTL rate limit is per node per table."),
255255
ttlDocDetail,
256256
),
257257
)

pkg/sql/ttl/ttljob/ttljob_processor.go

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

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

0 commit comments

Comments
 (0)