Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
93067: sql: add support for collecting partial statistics automatically r=Uzair5162 a=faizaanmadhani

We previously triggered full stat refreshes when approximately 20% of a table's rows were changed. This commit introduces additional partial statistic 'at extremes' refreshes that occur automatically in new `TypeAutoCreatePartialStats` jobs when roughly 5% of rows change.

Various new cluster and table settings to configure the frequency of auto partial stats collections have been introduced, which mimic existing settings for automatic full stats collection (see release note for details).

Table settings take precedence over their corresponding cluster settings if set. Partial stats will never be collected automatically in cases where automatic full stats wouldn't happen, such as when auto full stat collection settings are disabled or tables on which auto stats collections aren't allowed.

Automatic partial stat refreshes follow a probability-based model similar to automatic full stats to approximate the desired refresh frequency. We previously decided to trigger a full stat refresh with a probability proportional to the number of rows affected by mutations on a table. This has been extended to make a second decision on whether to trigger a partial stat refresh with a higher likelihood whenever we decide not to trigger a full refresh.

Unlike auto full stats, multiple `TypeAutoCreatePartialStats` jobs can run at once in a cluster, as long as they are on different tables. We don't start these jobs if any manual stat collection job (full or partial), any auto full stat collection job, or an auto partial stat collection job on the same table is running. We also don't stop any new stats jobs from running if there is an auto partial stats job running in the cluster (except for new auto partial stats jobs on the same table as one that is running).

Epic: CRDB-19449

Release note (sql change): Partial statistics can now be automatically collected at the extremes of indexes when a certain fraction and minimum number of rows are stale (5% and 100 by default). These can be configured with new table and cluster settings, and the feature is disabled by default. The new cluster and table settings are:

- `sql.stats.automatic_partial_collection.enabled`/`sql_stats_automatic_partial_collection_enabled`
  - Defaults to `false`
- `sql.stats.automatic_partial_collection.min_stale_rows`/`sql_stats_automatic_partial_collection_min_stale_rows`
  - Defaults to `100`
- `sql.stats.automatic_partial_collection.fraction_stale_rows`/`sql_stats_automatic_partial_collection_fraction_stale_rows`
  - Defaults to `0.05`

126128: schemachanger: support idx zone config r=spilchen,fqazi a=annrpom

### scpb: modify IndexZoneConfig element
This commit modifies the IndexZoneConfig element
that will become relevant for supporting
`ALTER INDEX ... CONFIGURE ZONE` in the DSC.

Release note: None

---

### schemachanger/scexec: add support for writing subzone configs
This patch adds support for writing subzone configs.

Informs: #117574
Fixes: #128594
Release note: None

---

### schemachanger: support idx zone config
This patch adds the functionality to configure
a zone configuration on an index.

Informs: #117574
Release note: None

128413: sql: add syntax for supporting security definer r=rafiss,mgartner a=annrpom

This patch adds the syntax needed for supporting security
definer. Right now, if a routine is specified with
`[EXTERNAL] SECURITY {INVOKER | DEFINER}`, it is a no-op.
If the security mode is not specified, the default is
`SECURITY INVOKER`.

This also means that syntax for altering a function
supports the above options as well:
```
alter function f(int) external security definer;
```

Fixes: #128844
Epic: [CRDB-37477](https://cockroachlabs.atlassian.net/browse/CRDB-37477)

Release note: None

128938: server: allow VIEWACTIVITY users access to /_admin/v1/stmtbundle r=xinhaoz a=xinhaoz

This commit gives users with the VIEWACTIVITY system grant access to `/_admin/v1/stmtbundle` on the admin server. This allows these users to download stmt bundles via DB console.

Epic: none
Part of: #121301

Release note (ui change): Users with VIEWACTIVITY can download stmt bundles from DB console.

129478: crosscluster/logical: reduce log spam from replanning r=msbutler a=stevendanna

Epic: none
Release note: None

Co-authored-by: Uzair Ahmad <[email protected]>
Co-authored-by: Annie Pompa <[email protected]>
Co-authored-by: Xin Hao Zhang <[email protected]>
Co-authored-by: Steven Danna <[email protected]>
  • Loading branch information
5 people committed Aug 22, 2024
6 parents 0e4a971 + 6ac3f39 + c865624 + c90aa92 + 1c81dc3 + 2bb9773 commit 4625d8b
Show file tree
Hide file tree
Showing 123 changed files with 4,479 additions and 1,273 deletions.
12 changes: 12 additions & 0 deletions docs/generated/metrics/metrics.html
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,18 @@
<tr><td>APPLICATION</td><td>jobs.auto_config_task.resume_completed</td><td>Number of auto_config_task jobs which successfully resumed to completion</td><td>jobs</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_config_task.resume_failed</td><td>Number of auto_config_task jobs which failed with a non-retriable error</td><td>jobs</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_config_task.resume_retry_error</td><td>Number of auto_config_task jobs which failed with a retriable error</td><td>jobs</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_partial_stats.currently_idle</td><td>Number of auto_create_partial_stats jobs currently considered Idle and can be freely shut down</td><td>jobs</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_partial_stats.currently_paused</td><td>Number of auto_create_partial_stats jobs currently considered Paused</td><td>jobs</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_partial_stats.currently_running</td><td>Number of auto_create_partial_stats jobs currently running in Resume or OnFailOrCancel state</td><td>jobs</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_partial_stats.expired_pts_records</td><td>Number of expired protected timestamp records owned by auto_create_partial_stats jobs</td><td>records</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_partial_stats.fail_or_cancel_completed</td><td>Number of auto_create_partial_stats jobs which successfully completed their failure or cancelation process</td><td>jobs</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_partial_stats.fail_or_cancel_failed</td><td>Number of auto_create_partial_stats jobs which failed with a non-retriable error on their failure or cancelation process</td><td>jobs</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_partial_stats.fail_or_cancel_retry_error</td><td>Number of auto_create_partial_stats jobs which failed with a retriable error on their failure or cancelation process</td><td>jobs</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_partial_stats.protected_age_sec</td><td>The age of the oldest PTS record protected by auto_create_partial_stats jobs</td><td>seconds</td><td>GAUGE</td><td>SECONDS</td><td>AVG</td><td>NONE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_partial_stats.protected_record_count</td><td>Number of protected timestamp records held by auto_create_partial_stats jobs</td><td>records</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_partial_stats.resume_completed</td><td>Number of auto_create_partial_stats jobs which successfully resumed to completion</td><td>jobs</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_partial_stats.resume_failed</td><td>Number of auto_create_partial_stats jobs which failed with a non-retriable error</td><td>jobs</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_partial_stats.resume_retry_error</td><td>Number of auto_create_partial_stats jobs which failed with a retriable error</td><td>jobs</td><td>COUNTER</td><td>COUNT</td><td>AVG</td><td>NON_NEGATIVE_DERIVATIVE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_stats.currently_idle</td><td>Number of auto_create_stats jobs currently considered Idle and can be freely shut down</td><td>jobs</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_stats.currently_paused</td><td>Number of auto_create_stats jobs currently considered Paused</td><td>jobs</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
<tr><td>APPLICATION</td><td>jobs.auto_create_stats.currently_running</td><td>Number of auto_create_stats jobs currently running in Resume or OnFailOrCancel state</td><td>jobs</td><td>GAUGE</td><td>COUNT</td><td>AVG</td><td>NONE</td></tr>
Expand Down
3 changes: 3 additions & 0 deletions docs/generated/settings/settings-for-tenants.txt
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,9 @@ sql.stats.activity.persisted_rows.max integer 200000 maximum number of rows of s
sql.stats.automatic_collection.enabled boolean true automatic statistics collection mode application
sql.stats.automatic_collection.fraction_stale_rows float 0.2 target fraction of stale rows per table that will trigger a statistics refresh application
sql.stats.automatic_collection.min_stale_rows integer 500 target minimum number of stale rows per table that will trigger a statistics refresh application
sql.stats.automatic_partial_collection.enabled boolean false automatic partial statistics collection mode application
sql.stats.automatic_partial_collection.fraction_stale_rows float 0.05 target fraction of stale rows per table that will trigger a partial statistics refresh application
sql.stats.automatic_partial_collection.min_stale_rows integer 100 target minimum number of stale rows per table that will trigger a partial statistics refresh application
sql.stats.cleanup.recurrence string @hourly cron-tab recurrence for SQL Stats cleanup job application
sql.stats.flush.enabled boolean true if set, SQL execution statistics are periodically flushed to disk application
sql.stats.flush.interval duration 10m0s the interval at which SQL execution statistics are flushed to disk, this value must be less than or equal to 1 hour application
Expand Down
3 changes: 3 additions & 0 deletions docs/generated/settings/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@
<tr><td><div id="setting-sql-stats-automatic-collection-enabled" class="anchored"><code>sql.stats.automatic_collection.enabled</code></div></td><td>boolean</td><td><code>true</code></td><td>automatic statistics collection mode</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
<tr><td><div id="setting-sql-stats-automatic-collection-fraction-stale-rows" class="anchored"><code>sql.stats.automatic_collection.fraction_stale_rows</code></div></td><td>float</td><td><code>0.2</code></td><td>target fraction of stale rows per table that will trigger a statistics refresh</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
<tr><td><div id="setting-sql-stats-automatic-collection-min-stale-rows" class="anchored"><code>sql.stats.automatic_collection.min_stale_rows</code></div></td><td>integer</td><td><code>500</code></td><td>target minimum number of stale rows per table that will trigger a statistics refresh</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
<tr><td><div id="setting-sql-stats-automatic-partial-collection-enabled" class="anchored"><code>sql.stats.automatic_partial_collection.enabled</code></div></td><td>boolean</td><td><code>false</code></td><td>automatic partial statistics collection mode</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
<tr><td><div id="setting-sql-stats-automatic-partial-collection-fraction-stale-rows" class="anchored"><code>sql.stats.automatic_partial_collection.fraction_stale_rows</code></div></td><td>float</td><td><code>0.05</code></td><td>target fraction of stale rows per table that will trigger a partial statistics refresh</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
<tr><td><div id="setting-sql-stats-automatic-partial-collection-min-stale-rows" class="anchored"><code>sql.stats.automatic_partial_collection.min_stale_rows</code></div></td><td>integer</td><td><code>100</code></td><td>target minimum number of stale rows per table that will trigger a partial statistics refresh</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
<tr><td><div id="setting-sql-stats-cleanup-recurrence" class="anchored"><code>sql.stats.cleanup.recurrence</code></div></td><td>string</td><td><code>@hourly</code></td><td>cron-tab recurrence for SQL Stats cleanup job</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
<tr><td><div id="setting-sql-stats-flush-enabled" class="anchored"><code>sql.stats.flush.enabled</code></div></td><td>boolean</td><td><code>true</code></td><td>if set, SQL execution statistics are periodically flushed to disk</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
<tr><td><div id="setting-sql-stats-flush-interval" class="anchored"><code>sql.stats.flush.interval</code></div></td><td>duration</td><td><code>10m0s</code></td><td>the interval at which SQL execution statistics are flushed to disk, this value must be less than or equal to 1 hour</td><td>Serverless/Dedicated/Self-Hosted</td></tr>
Expand Down
2 changes: 1 addition & 1 deletion docs/generated/sql/bnf/alter_func_stmt.bnf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
alter_func_stmt ::=
( 'ALTER' 'FUNCTION' function_with_paramtypes ( ( ( 'CALLED' 'ON' 'NULL' 'INPUT' | 'RETURNS' 'NULL' 'ON' 'NULL' 'INPUT' | 'STRICT' | 'IMMUTABLE' | 'STABLE' | 'VOLATILE' | 'LEAKPROOF' | 'NOT' 'LEAKPROOF' ) ) ( ( ( 'CALLED' 'ON' 'NULL' 'INPUT' | 'RETURNS' 'NULL' 'ON' 'NULL' 'INPUT' | 'STRICT' | 'IMMUTABLE' | 'STABLE' | 'VOLATILE' | 'LEAKPROOF' | 'NOT' 'LEAKPROOF' ) ) )* ) ( 'RESTRICT' | ) )
( 'ALTER' 'FUNCTION' function_with_paramtypes ( ( ( 'CALLED' 'ON' 'NULL' 'INPUT' | 'RETURNS' 'NULL' 'ON' 'NULL' 'INPUT' | 'STRICT' | 'IMMUTABLE' | 'STABLE' | 'VOLATILE' | 'EXTERNAL' 'SECURITY' 'DEFINER' | 'EXTERNAL' 'SECURITY' 'INVOKER' | 'SECURITY' 'DEFINER' | 'SECURITY' 'INVOKER' | 'LEAKPROOF' | 'NOT' 'LEAKPROOF' ) ) ( ( ( 'CALLED' 'ON' 'NULL' 'INPUT' | 'RETURNS' 'NULL' 'ON' 'NULL' 'INPUT' | 'STRICT' | 'IMMUTABLE' | 'STABLE' | 'VOLATILE' | 'EXTERNAL' 'SECURITY' 'DEFINER' | 'EXTERNAL' 'SECURITY' 'INVOKER' | 'SECURITY' 'DEFINER' | 'SECURITY' 'INVOKER' | 'LEAKPROOF' | 'NOT' 'LEAKPROOF' ) ) )* ) ( 'RESTRICT' | ) )
| ( 'ALTER' 'FUNCTION' function_with_paramtypes 'RENAME' 'TO' function_new_name )
| ( 'ALTER' 'FUNCTION' function_with_paramtypes 'OWNER' 'TO' role_spec )
| ( 'ALTER' 'FUNCTION' function_with_paramtypes 'SET' 'SCHEMA' schema_name )
Expand Down
4 changes: 2 additions & 2 deletions docs/generated/sql/bnf/create_func.bnf
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
create_func_stmt ::=
'CREATE' ( 'OR' 'REPLACE' | ) 'FUNCTION' routine_create_name '(' ( ( ( ( routine_param | routine_param | routine_param ) ) ( ( ',' ( routine_param | routine_param | routine_param ) ) )* ) | ) ')' 'RETURNS' ( 'SETOF' | ) routine_return_type ( ( ( ( 'AS' routine_body_str | 'LANGUAGE' ('SQL' | 'PLPGSQL') | ( 'CALLED' 'ON' 'NULL' 'INPUT' | 'RETURNS' 'NULL' 'ON' 'NULL' 'INPUT' | 'STRICT' | 'IMMUTABLE' | 'STABLE' | 'VOLATILE' | 'LEAKPROOF' | 'NOT' 'LEAKPROOF' ) ) ) ( ( ( 'AS' routine_body_str | 'LANGUAGE' ('SQL' | 'PLPGSQL') | ( 'CALLED' 'ON' 'NULL' 'INPUT' | 'RETURNS' 'NULL' 'ON' 'NULL' 'INPUT' | 'STRICT' | 'IMMUTABLE' | 'STABLE' | 'VOLATILE' | 'LEAKPROOF' | 'NOT' 'LEAKPROOF' ) ) ) )* ) | )
| 'CREATE' ( 'OR' 'REPLACE' | ) 'FUNCTION' routine_create_name '(' ( ( ( ( routine_param | routine_param | routine_param ) ) ( ( ',' ( routine_param | routine_param | routine_param ) ) )* ) | ) ')' ( ( ( ( 'AS' routine_body_str | 'LANGUAGE' ('SQL' | 'PLPGSQL') | ( 'CALLED' 'ON' 'NULL' 'INPUT' | 'RETURNS' 'NULL' 'ON' 'NULL' 'INPUT' | 'STRICT' | 'IMMUTABLE' | 'STABLE' | 'VOLATILE' | 'LEAKPROOF' | 'NOT' 'LEAKPROOF' ) ) ) ( ( ( 'AS' routine_body_str | 'LANGUAGE' ('SQL' | 'PLPGSQL') | ( 'CALLED' 'ON' 'NULL' 'INPUT' | 'RETURNS' 'NULL' 'ON' 'NULL' 'INPUT' | 'STRICT' | 'IMMUTABLE' | 'STABLE' | 'VOLATILE' | 'LEAKPROOF' | 'NOT' 'LEAKPROOF' ) ) ) )* ) | )
'CREATE' ( 'OR' 'REPLACE' | ) 'FUNCTION' routine_create_name '(' ( ( ( ( routine_param | routine_param | routine_param ) ) ( ( ',' ( routine_param | routine_param | routine_param ) ) )* ) | ) ')' 'RETURNS' ( 'SETOF' | ) routine_return_type ( ( ( ( 'AS' routine_body_str | 'LANGUAGE' ('SQL' | 'PLPGSQL') | ( 'CALLED' 'ON' 'NULL' 'INPUT' | 'RETURNS' 'NULL' 'ON' 'NULL' 'INPUT' | 'STRICT' | 'IMMUTABLE' | 'STABLE' | 'VOLATILE' | 'EXTERNAL' 'SECURITY' 'DEFINER' | 'EXTERNAL' 'SECURITY' 'INVOKER' | 'SECURITY' 'DEFINER' | 'SECURITY' 'INVOKER' | 'LEAKPROOF' | 'NOT' 'LEAKPROOF' ) ) ) ( ( ( 'AS' routine_body_str | 'LANGUAGE' ('SQL' | 'PLPGSQL') | ( 'CALLED' 'ON' 'NULL' 'INPUT' | 'RETURNS' 'NULL' 'ON' 'NULL' 'INPUT' | 'STRICT' | 'IMMUTABLE' | 'STABLE' | 'VOLATILE' | 'EXTERNAL' 'SECURITY' 'DEFINER' | 'EXTERNAL' 'SECURITY' 'INVOKER' | 'SECURITY' 'DEFINER' | 'SECURITY' 'INVOKER' | 'LEAKPROOF' | 'NOT' 'LEAKPROOF' ) ) ) )* ) | )
| 'CREATE' ( 'OR' 'REPLACE' | ) 'FUNCTION' routine_create_name '(' ( ( ( ( routine_param | routine_param | routine_param ) ) ( ( ',' ( routine_param | routine_param | routine_param ) ) )* ) | ) ')' ( ( ( ( 'AS' routine_body_str | 'LANGUAGE' ('SQL' | 'PLPGSQL') | ( 'CALLED' 'ON' 'NULL' 'INPUT' | 'RETURNS' 'NULL' 'ON' 'NULL' 'INPUT' | 'STRICT' | 'IMMUTABLE' | 'STABLE' | 'VOLATILE' | 'EXTERNAL' 'SECURITY' 'DEFINER' | 'EXTERNAL' 'SECURITY' 'INVOKER' | 'SECURITY' 'DEFINER' | 'SECURITY' 'INVOKER' | 'LEAKPROOF' | 'NOT' 'LEAKPROOF' ) ) ) ( ( ( 'AS' routine_body_str | 'LANGUAGE' ('SQL' | 'PLPGSQL') | ( 'CALLED' 'ON' 'NULL' 'INPUT' | 'RETURNS' 'NULL' 'ON' 'NULL' 'INPUT' | 'STRICT' | 'IMMUTABLE' | 'STABLE' | 'VOLATILE' | 'EXTERNAL' 'SECURITY' 'DEFINER' | 'EXTERNAL' 'SECURITY' 'INVOKER' | 'SECURITY' 'DEFINER' | 'SECURITY' 'INVOKER' | 'LEAKPROOF' | 'NOT' 'LEAKPROOF' ) ) ) )* ) | )
4 changes: 4 additions & 0 deletions docs/generated/sql/bnf/stmt_block.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -3553,6 +3553,10 @@ common_routine_opt_item ::=
| 'IMMUTABLE'
| 'STABLE'
| 'VOLATILE'
| 'EXTERNAL' 'SECURITY' 'DEFINER'
| 'EXTERNAL' 'SECURITY' 'INVOKER'
| 'SECURITY' 'DEFINER'
| 'SECURITY' 'INVOKER'
| 'LEAKPROOF'
| 'NOT' 'LEAKPROOF'

Expand Down
4 changes: 4 additions & 0 deletions pkg/ccl/backupccl/testdata/backup-restore/plpgsql_procedures
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ SELECT create_statement FROM [SHOW CREATE PROCEDURE sc1.p1]
----
CREATE PROCEDURE sc1.p1(a sc1.enum1)
LANGUAGE plpgsql
SECURITY INVOKER
AS $$
DECLARE
foobar sc1.enum1;
Expand Down Expand Up @@ -134,6 +135,7 @@ SELECT create_statement FROM [SHOW CREATE PROCEDURE sc1.p1]
----
CREATE PROCEDURE sc1.p1(a sc1.enum1)
LANGUAGE plpgsql
SECURITY INVOKER
AS $$
DECLARE
foobar sc1.enum1;
Expand Down Expand Up @@ -300,6 +302,7 @@ SELECT create_statement FROM [SHOW CREATE PROCEDURE sc1.p1]
----
CREATE PROCEDURE sc1.p1(a sc1.enum1)
LANGUAGE plpgsql
SECURITY INVOKER
AS $$
DECLARE
foobar sc1.enum1;
Expand Down Expand Up @@ -341,6 +344,7 @@ SELECT create_statement FROM [SHOW CREATE PROCEDURE sc1.p1]
----
CREATE PROCEDURE sc1.p1(a sc1.enum1)
LANGUAGE plpgsql
SECURITY INVOKER
AS $$
DECLARE
foobar sc1.enum1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ CREATE FUNCTION sc1.f1(a sc1.enum1)
NOT LEAKPROOF
CALLED ON NULL INPUT
LANGUAGE plpgsql
SECURITY INVOKER
AS $$
DECLARE
x INT8 := 0;
Expand All @@ -140,6 +141,7 @@ CREATE FUNCTION sc2.f2()
NOT LEAKPROOF
CALLED ON NULL INPUT
LANGUAGE plpgsql
SECURITY INVOKER
AS $$
DECLARE
x INT8;
Expand Down Expand Up @@ -176,6 +178,7 @@ CREATE FUNCTION sc1.f1(a sc1.enum1)
NOT LEAKPROOF
CALLED ON NULL INPUT
LANGUAGE plpgsql
SECURITY INVOKER
AS $$
DECLARE
x INT8 := 0;
Expand All @@ -196,6 +199,7 @@ CREATE FUNCTION sc2.f2()
NOT LEAKPROOF
CALLED ON NULL INPUT
LANGUAGE plpgsql
SECURITY INVOKER
AS $$
DECLARE
x INT8;
Expand Down Expand Up @@ -366,6 +370,7 @@ CREATE FUNCTION sc1.f1(a sc1.enum1)
NOT LEAKPROOF
CALLED ON NULL INPUT
LANGUAGE plpgsql
SECURITY INVOKER
AS $$
DECLARE
x INT8;
Expand Down Expand Up @@ -409,6 +414,7 @@ CREATE FUNCTION sc1.f1(a sc1.enum1)
NOT LEAKPROOF
CALLED ON NULL INPUT
LANGUAGE plpgsql
SECURITY INVOKER
AS $$
DECLARE
x INT8;
Expand Down
4 changes: 4 additions & 0 deletions pkg/ccl/backupccl/testdata/backup-restore/procedures
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ SELECT create_statement FROM [SHOW CREATE PROCEDURE sc1.p1]
----
CREATE PROCEDURE sc1.p1(a sc1.enum1)
LANGUAGE SQL
SECURITY INVOKER
AS $$
SELECT a FROM db1.sc1.tbl1;
SELECT 'Good':::sc1.enum1;
Expand Down Expand Up @@ -124,6 +125,7 @@ SELECT create_statement FROM [SHOW CREATE PROCEDURE sc1.p1]
----
CREATE PROCEDURE sc1.p1(a sc1.enum1)
LANGUAGE SQL
SECURITY INVOKER
AS $$
SELECT a FROM db1_new.sc1.tbl1;
SELECT 'Good':::sc1.enum1;
Expand Down Expand Up @@ -280,6 +282,7 @@ SELECT create_statement FROM [SHOW CREATE PROCEDURE sc1.p1]
----
CREATE PROCEDURE sc1.p1(a sc1.enum1)
LANGUAGE SQL
SECURITY INVOKER
AS $$
SELECT a FROM db1.sc1.tbl1;
SELECT 'Good':::sc1.enum1;
Expand Down Expand Up @@ -317,6 +320,7 @@ SELECT create_statement FROM [SHOW CREATE PROCEDURE sc1.p1]
----
CREATE PROCEDURE sc1.p1(a sc1.enum1)
LANGUAGE SQL
SECURITY INVOKER
AS $$
SELECT a FROM db1.sc1.tbl1;
SELECT 'Good':::sc1.enum1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ CREATE FUNCTION sc1.f1(a sc1.enum1)
NOT LEAKPROOF
CALLED ON NULL INPUT
LANGUAGE SQL
SECURITY INVOKER
AS $$
SELECT a FROM db1.sc1.tbl1;
SELECT 'Good':::sc1.enum1;
Expand Down Expand Up @@ -127,6 +128,7 @@ CREATE FUNCTION sc1.f1(a sc1.enum1)
NOT LEAKPROOF
CALLED ON NULL INPUT
LANGUAGE SQL
SECURITY INVOKER
AS $$
SELECT a FROM db1_new.sc1.tbl1;
SELECT 'Good':::sc1.enum1;
Expand Down Expand Up @@ -275,6 +277,7 @@ CREATE FUNCTION sc1.f1(a sc1.enum1)
NOT LEAKPROOF
CALLED ON NULL INPUT
LANGUAGE SQL
SECURITY INVOKER
AS $$
SELECT a FROM db1.sc1.tbl1;
SELECT 'Good':::sc1.enum1;
Expand Down Expand Up @@ -312,6 +315,7 @@ CREATE FUNCTION sc1.f1(a sc1.enum1)
NOT LEAKPROOF
CALLED ON NULL INPUT
LANGUAGE SQL
SECURITY INVOKER
AS $$
SELECT a FROM db1.sc1.tbl1;
SELECT 'Good':::sc1.enum1;
Expand Down
2 changes: 1 addition & 1 deletion pkg/ccl/crosscluster/logical/logical_replication_dist.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func constructLogicalReplicationWriterSpecs(
destID := matcher.FindMatch(candidate.ClosestDestIDs)
partition := candidate.Partition

log.Infof(ctx, "logical replication src-dst pair candidate: %s (locality %s) - %d ("+
log.VInfof(ctx, 2, "logical replication src-dst pair candidate: %s (locality %s) - %d ("+
"locality %s)",
partition.ID,
partition.SrcLocality,
Expand Down
Loading

0 comments on commit 4625d8b

Please sign in to comment.