-
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.
sql: Allow restart savepoint to be renamed
Currently, the only allowable savepoint names are those beginning with `cockroach_restart` which triggers a Cockroach-specific transaction-retry flow. This creates compatibility issues with certain integration scenarios (e.g. apps using Spring ORM) that can take advantage of restartable transactions, but which assume than an arbitrary savepoint identifier may be used. This patch introduces a new session variable `force_savepoint_restart` which allows the user to customize the savepoint name to any valid identifier, while always triggering a restartable transaction. Telemetry: * Unimplemented-feature error now includes reference to #10735. * `sql.force_savepoint_restart` event recorded when enabled. Resolves #30588 (customize `SAVEPOINT` name) Relates to #15012 (possible change for detecting "empty" transactions) Release note (sql change): Users can customize the auto-retry savepoint name used by the `SAVEPOINT` command by setting the `force_savepoint_restart` session variable. For example: `SET force_savepoint_restart=true; BEGIN; SAVEPOINT foo` will now function as desired. This session variable may also be supplied as part of a connection string to support existing code that assumes that arbitrary savepoint names may be used. Release note (sql change): The names supplied to a `SAVEPOINT` command are now properly treated as SQL identifiers. That is `SAVEPOINT foo` and `SAVEPOINT FOO` are now equivalent statements.
- Loading branch information
Showing
16 changed files
with
208 additions
and
57 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
Oops, something went wrong.