Skip to content

Commit

Permalink
clusterversions: remove RowLevelTTL version
Browse files Browse the repository at this point in the history
Release note: None
  • Loading branch information
rafiss committed Aug 16, 2022
1 parent 4561f22 commit 4710f62
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 82 deletions.
6 changes: 0 additions & 6 deletions pkg/clusterversion/cockroach_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,6 @@ const (
// ChangefeedIdleness is the version where changefeed aggregators forward
// idleness-related information alnog with resolved spans to the frontier
ChangefeedIdleness
// RowLevelTTL is the version where we allow row level TTL tables.
RowLevelTTL
// EnableNewStoreRebalancer enables the new store rebalancer introduced in
// 22.1.
EnableNewStoreRebalancer
Expand Down Expand Up @@ -396,10 +394,6 @@ var versionsSingleton = keyedVersions{
Key: ChangefeedIdleness,
Version: roachpb.Version{Major: 21, Minor: 2, Internal: 82},
},
{
Key: RowLevelTTL,
Version: roachpb.Version{Major: 21, Minor: 2, Internal: 88},
},
{
Key: EnableNewStoreRebalancer,
Version: roachpb.Version{Major: 21, Minor: 2, Internal: 96},
Expand Down
75 changes: 37 additions & 38 deletions pkg/clusterversion/key_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions pkg/sql/alter_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -1859,13 +1859,6 @@ func handleTTLStorageParamChange(
tableDesc *tabledesc.Mutable,
before, after *catpb.RowLevelTTL,
) error {

if before == nil && after != nil {
if err := checkTTLEnabledForCluster(params.ctx, params.p.ExecCfg().Settings); err != nil {
return err
}
}

// update existing config
if before != nil && after != nil {

Expand Down
13 changes: 0 additions & 13 deletions pkg/sql/create_table.go
Original file line number Diff line number Diff line change
Expand Up @@ -1475,9 +1475,6 @@ func NewTableDesc(

// Create the TTL automatic column (crdb_internal_expiration) if one does not already exist.
if ttl := desc.GetRowLevelTTL(); ttl != nil && ttl.HasDurationExpr() {
if err := checkTTLEnabledForCluster(ctx, st); err != nil {
return nil, err
}
hasRowLevelTTLColumn := false
for _, def := range n.Defs {
switch def := def.(type) {
Expand Down Expand Up @@ -2422,16 +2419,6 @@ func newRowLevelTTLScheduledJob(
return sj, nil
}

func checkTTLEnabledForCluster(ctx context.Context, st *cluster.Settings) error {
if !st.Version.IsActive(ctx, clusterversion.RowLevelTTL) {
return pgerror.Newf(
pgcode.FeatureNotSupported,
"row level TTL is only available once the cluster is fully upgraded",
)
}
return nil
}

func checkAutoStatsTableSettingsEnabledForCluster(ctx context.Context, st *cluster.Settings) error {
if !st.Version.IsActive(ctx, clusterversion.AutoStatsTableSettings) {
return pgerror.Newf(
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/sql/logictest/tests/local-mixed-21.2-22.1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ go_test(
"//c-deps:libgeos", # keep
"//pkg/sql/logictest:testdata", # keep
],
shard_count = 2,
shard_count = 1,
deps = [
"//pkg/build/bazel",
"//pkg/security/securityassets",
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4710f62

Please sign in to comment.