sql: add feature flag for CREATE STATISTICS/ANALYZE#57076
Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom Nov 24, 2020
Merged
sql: add feature flag for CREATE STATISTICS/ANALYZE#57076craig[bot] merged 1 commit intocockroachdb:masterfrom
craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
Member
otan
approved these changes
Nov 24, 2020
Contributor
otan
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @angelapwen and @otan)
pkg/sql/create_stats.go, line 63 at r1 (raw file):
featureStatsEnabled, &p.ExecCfg().Settings.SV, "ANALYZE/CREATE STATISTICS"); err != nil {
nit: , and new line after this one, i.e.
if err := featureflag.CheckEnabled(
featureStatsEnabled,
&p.ExecCfg().Settings.SV,
"ANALYZE/CREATE STATISTICS",
); err != nil {
(makes git lbame easier)
129d720 to
3cac9bb
Compare
Author
|
pkg/sql/create_stats.go, line 63 at r1 (raw file): Previously, otan (Oliver Tan) wrote…
Thanks! Addressed |
This change adds a feature flag for the CREATE STATISTICS command as well as ANALYZE, which is syntactic sugar for the former. The feature is being added to address a CockroachCloud SRE use case: needing to disable certain features, such as this, in case of cluster failure. Release note (sql change): Adds a feature flag via cluster settings for the CREATE STATISTICS and ANALYZE feature. If a user attempts to use the command while disabled, an error indicating that the database administrator had disabled the feature is surfaced. Example usage for the database administrator: SET CLUSTER SETTING feature.stats.enabled = FALSE; SET CLUSTER SETITNG feature.stats.enabled = TRUE;
3cac9bb to
721af02
Compare
otan
approved these changes
Nov 24, 2020
Contributor
otan
left a comment
There was a problem hiding this comment.
lets go
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @angelapwen and @otan)
Author
|
bors r=otan |
Contributor
|
Build succeeded: |
37 tasks
craig bot
pushed a commit
that referenced
this pull request
Nov 25, 2020
57040: sql, featureflag: add schema change feature flag r=otan a=angelapwen The following features have been tested and act as expected: - [x] ALTER DATABASE OWNER - [x] ALTER DATABASE ADD REGION - [x] ALTER DATABASE DROP REGION - [x] ALTER DATABASE SURVIVE - [x] ALTER TABLE REGIONAL AFFINITY - [x] ALTER TABLE SET SCHEMA - [x] ALTER SCHEMA - [x] ALTER TYPE - [x] ALTER SEQUENCE RENAME - [x] ALTER SEQUENCE SET SCHEMA - [x] CREATE DATABASE - [x] CREATE INDEX - [x] CREATE SCHEMA - [x] CREATE TABLE - [x] CREATE TYPE - [x] CREATE VIEW - [x] CREATE SEQUENCE - [x] DROP DATABASE - [x] DROP INDEX - [x] DROP TABLE - [x] DROP VIEW - [x] DROP SEQUENCE - [x] DROP TYPE - [x] DROP SCHEMA - [x] REASSIGN OWNED BY - [x] DROP OWNED BY - [x] RENAME DATABASE - [x] REPARENT DATABASE - [x] RENAME INDEX - [x] RENAME TABLE - [x] RENAME COLUMN - [x] COMMENT ON COLUMN - [x] COMMENT ON DATABASE - [x] COMMENT ON INDEX - [x] COMMENT ON TABLE - [x] ALTER INDEX CONFIGURE ZONE - [x] ALTER TABLE CONFIGURE ZONE See #51643 for background. ANALYZE/CREATE STATISTICS will not be considered a schema change and were added in a separate PR, #57076 The SPLIT/UNSPLIT features will also be resolved in a separate PR, as the execution path is different from the schema changes addressed in this PR. ---Commit message--- This change adds a feature flag via cluster setting for all designated features that perform schema changes or DDLs. The feature is being introduced to address a Cockroach Cloud SRE use case: needing to disable certain categories of features, such as schema changes, in case of cluster failure. Release note (sql change): Adds a feature flag via cluster setting for all schema change-related features. If a user attempts to use these features while they are disabled, an error indicating that the database administrator has disabled the feature is surfaced. Example usage for the database administrator: SET CLUSTER SETTING feature.schemachange.enabled = FALSE; SET CLUSTER SETTING feature.schemachange.enabled = TRUE; Co-authored-by: angelapwen <angelaw@cockroachlabs.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See #51643 for background.
---Commit message---
This change adds a feature flag for the CREATE STATISTICS command
as well as ANALYZE, which is syntactic sugar for the former. The
feature is being added to address a CockroachCloud SRE use case:
needing to disable certain features, such as this, in case of
cluster failure.
Release note (sql change): Adds a feature flag via cluster settings
for the CREATE STATISTICS and ANALYZE feature. If a user attempts
to use the command while disabled, an error indicating that the
database administrator had disabled the feature is surfaced.
Example usage for the database administrator:
SET CLUSTER SETTING feature.stats.enabled = FALSE;
SET CLUSTER SETITNG feature.stats.enabled = TRUE;