-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
68128: sql: settings from ALTER ROLE ... SET apply on session init r=RichardJCai a=rafiss Fixes #21151 The default settings are applied when creating a new pgwire session. The information is cached alongside authentication info to reduce the latency of establishing a connection and minimize the chance of a login availability hit. Release note (sql change): Default session variable settings configured by `ALTER ROLE ... SET` are now supported. The following order of precedence is used for variable settings: 1. settings specified in the connection URL as a query parameter. 2. per-role and per-database setting configured by ALTER ROLE. 3. per-role and all-database setting configured by ALTER ROLE. 4. all-role and per-database setting configured by ALTER ROLE. 5. all-role and all-database setting configured by ALTER ROLE. RESET does not validate the setting name. SET validates both the name and the proposed default value. Note that the default settings for a role are not inherited if one role is a member of another role that has default settings. Also, the defaults _only_ apply during session initialization. Using `SET DATABASE` to change databases does not apply default settings for that database. The `public`, `admin`, and `root` roles cannot have default session variables configured. The `root` role also will never use the "all-role" default settings. This is so that `root` has fewer dependencies during session initialization and to make it less likely for `root` authentication to become unavailable during the loss of a node. Changing the default settings for a role requires the role running the ALTER command to either be an ADMIN or to have the CREATEROLE role option. Only ADMINs can edit the default settings for another admin. Futhermore, changing the default settings for `ALL` roles is _only_ allowed for ADMINs. Roles without ADMIN or CREATEROLE _cannot_ change the default settings for themselves. 68284: cli/zip: avoid quadratic behavior in SQL schema retrieval r=ajwerner a=knz Fixes #67515. Prior to this patch, the `debug zip` command would issue a `DatabaseDetails` request over the network for each database in turn, and also `TableDetails` for each table. Server-side, each of these individual requests would cause all descriptors to be loaded into memory first. The overall behavior was thus quadratic in performance, and was resulting in unacceptable delays on large clusters with thousands of descriptors. It turns out, none of this is necessary since we already collect the descriptor details via `system.descriptors` and can collect the CREATE statements trivially using the `crdb_internal.create_statements` vtable, which also has linear performance. Release note (cli change): `cockroach debug zip` no longer retrieves database and table details into separate files. The schema information is collected by means of `system.descriptors` and `crdb_internal.create_statements`. 68295: sql: add cluster setting to preserve subquery and cte ordering r=DrewKimball a=DrewKimball This patch adds an experimental cluster setting `propagate_input_ordering` that indicates whether subqueries and CTEs should propagate their orderings to their parent scopes, when the parent scope is unordered. As an example, the following two queries should produce the following result when the cluster setting is true: ``` select * from (select * from generate_series(1, 10) i order by i % 5 asc, i asc) tmp; with tmp as (select * from generate_series(1, 10) i order by i % 5 asc, i asc) select * from tmp; ---- 5 10 1 6 2 7 3 8 4 9 ``` This allows cockroach to imitate postgres behavior - while postgres does not guarantee to maintain ordering on subqueries, it does in practice. Some existing applications take advantage of this fact, and so the ability to toggle this setting can help resolve incompatibilities in some cases. Fixes #68211 Release note: None 68459: sql: refactor default privileges for all roles r=arulajmani a=RichardJCai Default privileges for all roles are refactored to be more in line with regular roles. Simplifies some code. Release note: None 68514: dev: rip recording logic out of `dev` datadriven tests r=rail a=rickystewart This feature isn't used by anyone that currently works on `dev`, and manually updating the recording files seems to be the most convenient way to work on these tests. In the future we may consider migrating to a proper mocking framework for `dev`, but for now this structure is fine. Also rename recorder -> recording for accuracy. Release note: None 68526: *: update to lib/pq v1.10.2 r=knz a=rafiss Fixes #65320 This gets us off the cockroachdb/pq fork. This revealed a bug in some of the tests and `debug` code: they were not calling rows.Close() after querying the database. The new version of lib/pq is more strict about requiring this. Additionally, logic tests were not checking `NextResultSet()`, which is a bug if the test executes multiple queries at once. Release note: none Co-authored-by: Rafi Shamim <[email protected]> Co-authored-by: Raphael 'kena' Poss <[email protected]> Co-authored-by: Drew Kimball <[email protected]> Co-authored-by: richardjcai <[email protected]> Co-authored-by: Ricky Stewart <[email protected]>
- Loading branch information
Showing
75 changed files
with
2,069 additions
and
1,624 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,8 @@ debug zip --concurrency=1 --cpu-profile-duration=0s /dev/null | |
[cluster] retrieving SQL data for system.descriptor... writing output: debug/system.descriptor.txt... done | ||
[cluster] retrieving SQL data for system.namespace... writing output: debug/system.namespace.txt... done | ||
[cluster] retrieving SQL data for system.scheduled_jobs... writing output: debug/system.scheduled_jobs.txt... done | ||
[cluster] retrieving SQL data for "".crdb_internal.create_statements... writing output: debug/crdb_internal.create_statements.txt... done | ||
[cluster] retrieving SQL data for "".crdb_internal.create_type_statements... writing output: debug/crdb_internal.create_type_statements.txt... done | ||
[cluster] retrieving SQL data for crdb_internal.kv_node_liveness... writing output: debug/crdb_internal.kv_node_liveness.txt... done | ||
[cluster] retrieving SQL data for crdb_internal.kv_node_status... writing output: debug/crdb_internal.kv_node_status.txt... done | ||
[cluster] retrieving SQL data for crdb_internal.kv_store_status... writing output: debug/crdb_internal.kv_store_status.txt... done | ||
|
@@ -272,49 +274,5 @@ debug zip --concurrency=1 --cpu-profile-duration=0s /dev/null | |
[node 3] writing range 40... converting to JSON... writing binary output: debug/nodes/3/ranges/40.json... done | ||
[node 3] writing range 41... converting to JSON... writing binary output: debug/nodes/3/ranges/41.json... done | ||
[node 3] writing range 42... converting to JSON... writing binary output: debug/nodes/3/ranges/42.json... done | ||
[cluster] doctor examining cluster...... writing binary output: debug/reports/doctor.txt... done | ||
[cluster] requesting list of SQL databases... received response... done | ||
[cluster] 3 databases found | ||
[cluster] [database: defaultdb] requesting database details... received response... converting to JSON... writing binary output: debug/schema/[email protected]... done | ||
[cluster] [database: defaultdb] 0 tables found | ||
[cluster] [database: postgres] requesting database details... received response... converting to JSON... writing binary output: debug/schema/[email protected]... done | ||
[cluster] [database: postgres] 0 tables found | ||
[cluster] [database: system] requesting database details... received response... converting to JSON... writing binary output: debug/schema/[email protected]... done | ||
[cluster] [database: system] 35 tables found | ||
[cluster] [database: system] [table: public.comments] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_comments.json... done | ||
[cluster] [database: system] [table: public.database_role_settings] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_database_role_settings.json... done | ||
[cluster] [database: system] [table: public.descriptor] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_descriptor.json... done | ||
[cluster] [database: system] [table: public.eventlog] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_eventlog.json... done | ||
[cluster] [database: system] [table: public.jobs] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_jobs.json... done | ||
[cluster] [database: system] [table: public.join_tokens] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_join_tokens.json... done | ||
[cluster] [database: system] [table: public.lease] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_lease.json... done | ||
[cluster] [database: system] [table: public.locations] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_locations.json... done | ||
[cluster] [database: system] [table: public.migrations] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_migrations.json... done | ||
[cluster] [database: system] [table: public.namespace] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_namespace.json... done | ||
[cluster] [database: system] [table: public.protected_ts_meta] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_protected_ts_meta.json... done | ||
[cluster] [database: system] [table: public.protected_ts_records] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_protected_ts_records.json... done | ||
[cluster] [database: system] [table: public.rangelog] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_rangelog.json... done | ||
[cluster] [database: system] [table: public.replication_constraint_stats] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_replication_constraint_stats.json... done | ||
[cluster] [database: system] [table: public.replication_critical_localities] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_replication_critical_localities.json... done | ||
[cluster] [database: system] [table: public.replication_stats] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_replication_stats.json... done | ||
[cluster] [database: system] [table: public.reports_meta] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_reports_meta.json... done | ||
[cluster] [database: system] [table: public.role_members] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_role_members.json... done | ||
[cluster] [database: system] [table: public.role_options] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_role_options.json... done | ||
[cluster] [database: system] [table: public.scheduled_jobs] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_scheduled_jobs.json... done | ||
[cluster] [database: system] [table: public.settings] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_settings.json... done | ||
[cluster] [database: system] [table: public.sql_instances] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_sql_instances.json... done | ||
[cluster] [database: system] [table: public.sqlliveness] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_sqlliveness.json... done | ||
[cluster] [database: system] [table: public.statement_bundle_chunks] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_statement_bundle_chunks.json... done | ||
[cluster] [database: system] [table: public.statement_diagnostics] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_statement_diagnostics.json... done | ||
[cluster] [database: system] [table: public.statement_diagnostics_requests] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_statement_diagnostics_requests.json... done | ||
[cluster] [database: system] [table: public.statement_statistics] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_statement_statistics.json... done | ||
[cluster] [database: system] [table: public.table_statistics] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_table_statistics.json... done | ||
[cluster] [database: system] [table: public.tenant_usage] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_tenant_usage.json... done | ||
[cluster] [database: system] [table: public.tenants] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_tenants.json... done | ||
[cluster] [database: system] [table: public.transaction_statistics] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_transaction_statistics.json... done | ||
[cluster] [database: system] [table: public.ui] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_ui.json... done | ||
[cluster] [database: system] [table: public.users] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_users.json... done | ||
[cluster] [database: system] [table: public.web_sessions] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_web_sessions.json... done | ||
[cluster] [database: system] [table: public.zones] requesting table details... received response... converting to JSON... writing binary output: debug/schema/system/public_zones.json... done | ||
[cluster] pprof summary script... writing binary output: debug/pprof-summary.sh... done | ||
[cluster] hot range summary script... writing binary output: debug/hot-ranges.sh... done |
Oops, something went wrong.