-
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: backward-compat for
SHOW RANGES
/ `crdb_internal.ranges{,_no_l…
…eases}` TLDR: the pre-v23.1 behavior of SHOW RANGES and `crdb_internal.ranges{_no_leases}` is made available conditional on a new cluster setting `sql.show_ranges_deprecated_behavior.enabled`. It is set to true by default in v23.1, however any use of the feature will prompt a SQL notice with the following message: ``` NOTICE: attention! the pre-23.1 behavior of SHOW RANGES and crdb_internal.ranges{,_no_leases} is deprecated! HINT: Consider enabling the new functionality by setting 'sql.show_ranges_deprecated_behavior.enabled' to 'false'. The new SHOW RANGES statement has more options. Refer to the online documentation or execute 'SHOW RANGES ??' for details. ``` The deprecated behavior is also disabled in the test suite and in `cockroach demo`, i.e. the tests continue to exercise the new behavior. cf. doc for new package `deprecatedshowranges`: ``` // Package deprecatedshowranges exists to smoothen the transition // between the pre-v23.1 semantics of SHOW RANGES and // crdb_internal.ranges{_no_leases}, and the new semantics introduced // in v23.1. // // The pre-v23.1 semantics are deprecated as of v23.1. At the end of // the deprecation cycle (hopefully for v23.2) we expect to delete // this package entirely and all the other code in the SQL layer that // hangs off the EnableDeprecatedBehavior() conditional defined below. // // The mechanism to control the behavior is as follows: // // - In any case, an operator can override the behavior using an env // var, "COCKROACH_FORCE_DEPRECATED_SHOW_RANGE_BEHAVIOR". // If set (to a boolean), the value of the env var is used in // all cases. // We use this env var to force the _new_ behavior through out // test suite, regardless of the other conditions. This allows // us to avoid maintaining two sets of outputs in tests. // // - If the env var is not set, the cluster setting // `sql.show_ranges_deprecated_behavior.enabled` is used. It // defaults to true in v23.1 (the "smoothening" part). // // - If the deprecated behavior is chosen by any of the above // mechanisms, and _the range coalescing cluster setting_ is set // to true, a loud warning will be reported in various places. // This will nudge users who wish to opt into range coalescing // to adapt their use of the range inspection accordingly. ``` Release note: None
- Loading branch information
Showing
25 changed files
with
707 additions
and
42 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
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.