Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
111594: sql-telemetry: query_sampling.max_event_frequency public r=maryliag a=emilaleksanteri

Epic: none
Fixes: #108385

Release note (sql change): make max_event_frequency public for public documentation

111638: kvfollowerreadsccl: use `SystemVisible` for `kv.closed_timestamp.propagation_slack` r=erikgrinaker a=erikgrinaker

**changefeedccl: don't use `ALTER TENANT ALL` for closed timestamp setting**

This is no longer necessary with the `SystemVisible` class.

**kvfollowerreadsccl: use `SystemVisible` for `kv.closed_timestamp.propagation_slack`**

It doesn't make any sense to configure this individually per tenant.

Epic: none
Release note: None


Co-authored-by: Emil Lystimaki <emil@circularway.com>
Co-authored-by: Erik Grinaker <grinaker@cockroachlabs.com>
  • Loading branch information
3 people committed Oct 3, 2023
3 parents 20d0094 + 29e341d + 17513c2 commit 1268ef1
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/generated/settings/settings-for-tenants.txt
Expand Up @@ -295,6 +295,7 @@ sql.stats.system_tables.enabled boolean true when true, enables use of statistic
sql.stats.system_tables_autostats.enabled boolean true when true, enables automatic collection of statistics on system tables application
sql.telemetry.query_sampling.enabled boolean false when set to true, executed queries will emit an event on the telemetry logging channel application
sql.telemetry.query_sampling.internal.enabled boolean false when set to true, internal queries will be sampled in telemetry logging application
sql.telemetry.query_sampling.max_event_frequency integer 8 the max event frequency at which we sample executions for telemetry, note that it is recommended that this value shares a log-line limit of 10 logs per second on the telemetry pipeline with all other telemetry events. If sampling mode is set to 'transaction', all statements associated with a single transaction are counted as 1 unit. application
sql.temp_object_cleaner.cleanup_interval duration 30m0s how often to clean up orphaned temporary objects application
sql.temp_object_cleaner.wait_interval duration 30m0s how long after creation a temporary object will be cleaned up application
sql.log.all_statements.enabled boolean false set to true to enable logging of all executed statements application
Expand Down
1 change: 1 addition & 0 deletions docs/generated/settings/settings.html
Expand Up @@ -243,6 +243,7 @@
<tr><td><div id="setting-sql-stats-system-tables-autostats-enabled" class="anchored"><code>sql.stats.system_tables_autostats.enabled</code></div></td><td>boolean</td><td><code>true</code></td><td>when true, enables automatic collection of statistics on system tables</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
<tr><td><div id="setting-sql-telemetry-query-sampling-enabled" class="anchored"><code>sql.telemetry.query_sampling.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>when set to true, executed queries will emit an event on the telemetry logging channel</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
<tr><td><div id="setting-sql-telemetry-query-sampling-internal-enabled" class="anchored"><code>sql.telemetry.query_sampling.internal.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>when set to true, internal queries will be sampled in telemetry logging</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
<tr><td><div id="setting-sql-telemetry-query-sampling-max-event-frequency" class="anchored"><code>sql.telemetry.query_sampling.max_event_frequency</code></div></td><td>integer</td><td><code>8</code></td><td>the max event frequency at which we sample executions for telemetry, note that it is recommended that this value shares a log-line limit of 10 logs per second on the telemetry pipeline with all other telemetry events. If sampling mode is set to &#39;transaction&#39;, all statements associated with a single transaction are counted as 1 unit.</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
<tr><td><div id="setting-sql-temp-object-cleaner-cleanup-interval" class="anchored"><code>sql.temp_object_cleaner.cleanup_interval</code></div></td><td>duration</td><td><code>30m0s</code></td><td>how often to clean up orphaned temporary objects</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
<tr><td><div id="setting-sql-temp-object-cleaner-wait-interval" class="anchored"><code>sql.temp_object_cleaner.wait_interval</code></div></td><td>duration</td><td><code>30m0s</code></td><td>how long after creation a temporary object will be cleaned up</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
<tr><td><div id="setting-sql-trace-log-statement-execute" class="anchored"><code>sql.log.all_statements.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>set to true to enable logging of all executed statements</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
Expand Down
2 changes: 0 additions & 2 deletions pkg/ccl/changefeedccl/changefeed_test.go
Expand Up @@ -3912,7 +3912,6 @@ func TestChangefeedStopOnSchemaChange(t *testing.T) {
sysDB.Exec(t, "SET CLUSTER SETTING kv.closed_timestamp.target_duration = '50ms'")
sysDB.Exec(t, "SET CLUSTER SETTING kv.closed_timestamp.side_transport_interval = '50ms'")
sysDB.Exec(t, "SET CLUSTER SETTING kv.rangefeed.closed_timestamp_refresh_interval = '50ms'")
sysDB.Exec(t, "ALTER TENANT ALL SET CLUSTER SETTING kv.rangefeed.closed_timestamp_refresh_interval = '50ms'")

t.Run("add column not null", func(t *testing.T) {
sqlDB.Exec(t, `CREATE TABLE add_column_not_null (a INT PRIMARY KEY)`)
Expand Down Expand Up @@ -4047,7 +4046,6 @@ func TestChangefeedNoBackfill(t *testing.T) {
sysDB.Exec(t, "SET CLUSTER SETTING kv.closed_timestamp.target_duration = '50ms'")
sysDB.Exec(t, "SET CLUSTER SETTING kv.closed_timestamp.side_transport_interval = '10ms'")
sysDB.Exec(t, "SET CLUSTER SETTING kv.rangefeed.closed_timestamp_refresh_interval = '10ms'")
sysDB.Exec(t, "ALTER TENANT ALL SET CLUSTER SETTING kv.rangefeed.closed_timestamp_refresh_interval = '10ms'")

t.Run("add column not null", func(t *testing.T) {
sqlDB.Exec(t, `CREATE TABLE add_column_not_null (a INT PRIMARY KEY)`)
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/kvccl/kvfollowerreadsccl/followerreads.go
Expand Up @@ -36,7 +36,7 @@ import (
// measure of how long closed timestamp updates are supposed to take from the
// leaseholder to the followers.
var ClosedTimestampPropagationSlack = settings.RegisterDurationSetting(
settings.ApplicationLevel,
settings.SystemVisible,
"kv.closed_timestamp.propagation_slack",
"a conservative estimate of the amount of time expect for closed timestamps to "+
"propagate from a leaseholder to followers. This is taken into account by "+
Expand Down
1 change: 0 additions & 1 deletion pkg/ccl/kvccl/kvfollowerreadsccl/followerreads_test.go
Expand Up @@ -964,7 +964,6 @@ func TestSecondaryTenantFollowerReadsRouting(t *testing.T) {
systemSQL.Exec(t, `SET CLUSTER SETTING kv.closed_timestamp.target_duration = '0.1s'`)
systemSQL.Exec(t, `SET CLUSTER SETTING kv.closed_timestamp.side_transport_interval = '0.1s'`)
systemSQL.Exec(t, `SET CLUSTER SETTING kv.closed_timestamp.propagation_slack = '0.1s'`)
systemSQL.Exec(t, `ALTER TENANT ALL SET CLUSTER SETTING kv.closed_timestamp.propagation_slack = '0.1s'`)
// We're making assertions on traces collected by the tenant using log lines
// in KV so we must ensure they're not redacted.
systemSQL.Exec(t, `SET CLUSTER SETTING trace.redact_at_virtual_cluster_boundary.enabled = 'false'`)
Expand Down
1 change: 1 addition & 0 deletions pkg/sql/telemetry_logging.go
Expand Up @@ -37,6 +37,7 @@ var TelemetryMaxEventFrequency = settings.RegisterIntSetting(
"transaction are counted as 1 unit.",
defaultMaxEventFrequency,
settings.NonNegativeInt,
settings.WithPublic,
)

var telemetryInternalQueriesEnabled = settings.RegisterBoolSetting(
Expand Down

0 comments on commit 1268ef1

Please sign in to comment.