-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
93906: sql/schemachanger: create function declarative r=chengxiong-ruan a=chengxiong-ruan **sql/schemachanger: rename UpdateBackReferencesInSequences** Rename UpdateBackReferencesInSequences to UpdateTableBackReferencesInSequences since it's fits more specifically for tables referencing sequences. **sql/schemachanger: resolve schema should check required privilege** Previously, we require current user's ownership on a schema descriptor when resolving a schema in declarative shcema changer. This was true because we only support `DROP SCHEMA`. But this won't be true if we want to support `CREATE`s because we'd only require `CREATE` privilege on the schema. This pr adds a new `RequireOwnership` flag to `ResolveParam` since there is no `OWNER` privilege kind. **sql/schemachanger: Add default privileges elements and grant option field** This commit adds a new element for default privileges. Also adds a grant option field to UserPrivielges element. **sql/schemachanger: add id generator and references provider interface** This commit adds `ReferenceProviderFactory` and `DescIDGenerator` interfaces to help doing CREATEs within declarative schema changer. **sql/schemachanger: make builder able to work with new descriptors** Previously, builder always try to read descriptors because we assume all descriptors already exist. This is not true anymore for `CREATE` statements. This commit adds a new id set to the builder so it knows when to read a descriptor to initilize the cache or not. **sql/schemachanger: create function declarative** This commits implements CREATE FUNCTION statements in the declarative schema changer. It introduces a few new things: (1) A new `DESCRIPTOR_ADDING` state for a newly created descritpor. In this state the descriptor is visible only in a cache of `mutationVisitorState` so that other operations in the same statement can see the new descriptor. At this state, descriptor is not written to collection and storage yet. (2) Introduce operations to update `ObjectParent`, `Owner` and `UserPrivileges` elements. (3) add helper to able to create user privileges from default privileges of database and schemas. The rest of the commit is mainly implementing the business logic. Fixes: #83228 96233: rpc,*: don't panic in `rpc.NewServerEx` r=erikgrinaker a=knz Found while working on #96226. Prior to this patch, the function `rpc.NewServerEx()` would panic if it was unable to loads its TLS settings. This is incorrect - we want to report a simple operational error in that case, since the problem is actionable. The reason why this problem does not seem to directly impact production clusters is that there is another check in `server.NewServer()` that asserts the TLS settings are valid before constructing the rpc server. This check was incomplete however, because there is a small race condition in between the two where the files could be removed after `server.NewServer()` finds them, and before `rpc.NewServer()` needs them. We do not generally like `panic()` calls in production code, so this needed an improvement anyway. Release note: None Epic: CRDB-14537 96271: logictest: skip flaky test in ranges r=mgartner a=mgartner Informs #96136 Epic: None Release note: None 96293: schemachanger: disable KV tracing in statement phase execution r=postamar a=postamar This commit fixes a bug in which the declarative schema changer logged KV operations to the KV trace which were never actually run. Fixes #95903. Release note: None Co-authored-by: Chengxiong Ruan <[email protected]> Co-authored-by: Raphael 'kena' Poss <[email protected]> Co-authored-by: Marcus Gartner <[email protected]> Co-authored-by: Marius Posta <[email protected]>
- Loading branch information
Showing
167 changed files
with
7,165 additions
and
420 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.