Skip to content

Commit

Permalink
clusterversion,kv: remove ReplicaVersions
Browse files Browse the repository at this point in the history
Partially addresses cockroachdb#66544 by removing a cluster version and its associated
dependencies which, for any cluster whose version is at least 21.1, is certain
to be active.

Release justification: cluster version cleanup
  • Loading branch information
nvanbenschoten committed Sep 2, 2021
1 parent 99157d9 commit 10d10e8
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 55 deletions.
6 changes: 0 additions & 6 deletions pkg/clusterversion/cockroach_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ const (
//
// Start21_1 demarcates work towards CockroachDB v21.1.
Start21_1
// ReplicaVersions enables the versioning of Replica state.
ReplicaVersions
// replacedTruncatedAndRangeAppliedStateMigration stands in for
// TruncatedAndRangeAppliedStateMigration which was re-introduced after the
// migration job was introduced. This is necessary because the jobs
Expand Down Expand Up @@ -359,10 +357,6 @@ var versionsSingleton = keyedVersions{
Key: Start21_1,
Version: roachpb.Version{Major: 20, Minor: 2, Internal: 2},
},
{
Key: ReplicaVersions,
Version: roachpb.Version{Major: 20, Minor: 2, Internal: 12},
},
{
Key: replacedTruncatedAndRangeAppliedStateMigration,
Version: roachpb.Version{Major: 20, Minor: 2, Internal: 14},
Expand Down
85 changes: 42 additions & 43 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: 1 addition & 6 deletions pkg/kv/kvserver/store_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"io"
"time"

"github.com/cockroachdb/cockroach/pkg/clusterversion"
"github.com/cockroachdb/cockroach/pkg/keys"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/raftentry"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/rditer"
Expand Down Expand Up @@ -924,10 +923,6 @@ func SendEmptySnapshot(
return err
}

var replicaVersion roachpb.Version
if st.Version.IsActive(ctx, clusterversion.ReplicaVersions) {
replicaVersion = st.Version.ActiveVersionOrEmpty(ctx).Version
}
ms, err = stateloader.WriteInitialReplicaState(
ctx,
eng,
Expand All @@ -936,7 +931,7 @@ func SendEmptySnapshot(
roachpb.Lease{},
hlc.Timestamp{}, // gcThreshold
stateloader.TruncatedStateUnreplicated,
replicaVersion,
st.Version.ActiveVersionOrEmpty(ctx).Version,
)
if err != nil {
return err
Expand Down

0 comments on commit 10d10e8

Please sign in to comment.