diff --git a/pkg/clusterversion/cockroach_versions.go b/pkg/clusterversion/cockroach_versions.go index fd86da7d7f18..a038ec5a1ff3 100644 --- a/pkg/clusterversion/cockroach_versions.go +++ b/pkg/clusterversion/cockroach_versions.go @@ -210,10 +210,6 @@ const ( // are propagated across RPC boundaries independently of their verbosity setting. // This requires a version gate this violates implicit assumptions in v20.2. TracingVerbosityIndependentSemantics - // PriorReadSummaries introduces support for the use of read summary objects - // to ship information about reads on a range through lease changes and - // range merges. - PriorReadSummaries // NonVotingReplicas enables the creation of non-voting replicas. NonVotingReplicas // V21_1 is CockroachDB v21.1. It's used for all v21.1.x patch releases. @@ -375,10 +371,6 @@ var versionsSingleton = keyedVersions{ Key: TracingVerbosityIndependentSemantics, Version: roachpb.Version{Major: 20, Minor: 2, Internal: 28}, }, - { - Key: PriorReadSummaries, - Version: roachpb.Version{Major: 20, Minor: 2, Internal: 44}, - }, { Key: NonVotingReplicas, Version: roachpb.Version{Major: 20, Minor: 2, Internal: 46}, diff --git a/pkg/clusterversion/key_string.go b/pkg/clusterversion/key_string.go index 5a6c78be3e23..0a275a37f795 100644 --- a/pkg/clusterversion/key_string.go +++ b/pkg/clusterversion/key_string.go @@ -19,45 +19,44 @@ func _() { _ = x[TruncatedAndRangeAppliedStateMigration-8] _ = x[PostTruncatedAndRangeAppliedStateMigration-9] _ = x[TracingVerbosityIndependentSemantics-10] - _ = x[PriorReadSummaries-11] - _ = x[NonVotingReplicas-12] - _ = x[V21_1-13] - _ = x[Start21_1PLUS-14] - _ = x[Start21_2-15] - _ = x[JoinTokensTable-16] - _ = x[AcquisitionTypeInLeaseHistory-17] - _ = x[SerializeViewUDTs-18] - _ = x[ExpressionIndexes-19] - _ = x[DeleteDeprecatedNamespaceTableDescriptorMigration-20] - _ = x[FixDescriptors-21] - _ = x[SQLStatsTable-22] - _ = x[DatabaseRoleSettings-23] - _ = x[TenantUsageTable-24] - _ = x[SQLInstancesTable-25] - _ = x[NewRetryableRangefeedErrors-26] - _ = x[AlterSystemWebSessionsCreateIndexes-27] - _ = x[SeparatedIntentsMigration-28] - _ = x[PostSeparatedIntentsMigration-29] - _ = x[RetryJobsWithExponentialBackoff-30] - _ = x[RecordsBasedRegistry-31] - _ = x[AutoSpanConfigReconciliationJob-32] - _ = x[PreventNewInterleavedTables-33] - _ = x[EnsureNoInterleavedTables-34] - _ = x[DefaultPrivileges-35] - _ = x[ZonesTableForSecondaryTenants-36] - _ = x[UseKeyEncodeForHashShardedIndexes-37] - _ = x[DatabasePlacementPolicy-38] - _ = x[GeneratedAsIdentity-39] - _ = x[OnUpdateExpressions-40] - _ = x[SpanConfigurationsTable-41] - _ = x[BoundedStaleness-42] - _ = x[SQLStatsCompactionScheduledJob-43] - _ = x[DateAndIntervalStyle-44] + _ = x[NonVotingReplicas-11] + _ = x[V21_1-12] + _ = x[Start21_1PLUS-13] + _ = x[Start21_2-14] + _ = x[JoinTokensTable-15] + _ = x[AcquisitionTypeInLeaseHistory-16] + _ = x[SerializeViewUDTs-17] + _ = x[ExpressionIndexes-18] + _ = x[DeleteDeprecatedNamespaceTableDescriptorMigration-19] + _ = x[FixDescriptors-20] + _ = x[SQLStatsTable-21] + _ = x[DatabaseRoleSettings-22] + _ = x[TenantUsageTable-23] + _ = x[SQLInstancesTable-24] + _ = x[NewRetryableRangefeedErrors-25] + _ = x[AlterSystemWebSessionsCreateIndexes-26] + _ = x[SeparatedIntentsMigration-27] + _ = x[PostSeparatedIntentsMigration-28] + _ = x[RetryJobsWithExponentialBackoff-29] + _ = x[RecordsBasedRegistry-30] + _ = x[AutoSpanConfigReconciliationJob-31] + _ = x[PreventNewInterleavedTables-32] + _ = x[EnsureNoInterleavedTables-33] + _ = x[DefaultPrivileges-34] + _ = x[ZonesTableForSecondaryTenants-35] + _ = x[UseKeyEncodeForHashShardedIndexes-36] + _ = x[DatabasePlacementPolicy-37] + _ = x[GeneratedAsIdentity-38] + _ = x[OnUpdateExpressions-39] + _ = x[SpanConfigurationsTable-40] + _ = x[BoundedStaleness-41] + _ = x[SQLStatsCompactionScheduledJob-42] + _ = x[DateAndIntervalStyle-43] } -const _Key_name = "Start20_2MinPasswordLengthCreateLoginPrivilegeHBAForNonTLSV20_2Start21_1replacedTruncatedAndRangeAppliedStateMigrationreplacedPostTruncatedAndRangeAppliedStateMigrationTruncatedAndRangeAppliedStateMigrationPostTruncatedAndRangeAppliedStateMigrationTracingVerbosityIndependentSemanticsPriorReadSummariesNonVotingReplicasV21_1Start21_1PLUSStart21_2JoinTokensTableAcquisitionTypeInLeaseHistorySerializeViewUDTsExpressionIndexesDeleteDeprecatedNamespaceTableDescriptorMigrationFixDescriptorsSQLStatsTableDatabaseRoleSettingsTenantUsageTableSQLInstancesTableNewRetryableRangefeedErrorsAlterSystemWebSessionsCreateIndexesSeparatedIntentsMigrationPostSeparatedIntentsMigrationRetryJobsWithExponentialBackoffRecordsBasedRegistryAutoSpanConfigReconciliationJobPreventNewInterleavedTablesEnsureNoInterleavedTablesDefaultPrivilegesZonesTableForSecondaryTenantsUseKeyEncodeForHashShardedIndexesDatabasePlacementPolicyGeneratedAsIdentityOnUpdateExpressionsSpanConfigurationsTableBoundedStalenessSQLStatsCompactionScheduledJobDateAndIntervalStyle" +const _Key_name = "Start20_2MinPasswordLengthCreateLoginPrivilegeHBAForNonTLSV20_2Start21_1replacedTruncatedAndRangeAppliedStateMigrationreplacedPostTruncatedAndRangeAppliedStateMigrationTruncatedAndRangeAppliedStateMigrationPostTruncatedAndRangeAppliedStateMigrationTracingVerbosityIndependentSemanticsNonVotingReplicasV21_1Start21_1PLUSStart21_2JoinTokensTableAcquisitionTypeInLeaseHistorySerializeViewUDTsExpressionIndexesDeleteDeprecatedNamespaceTableDescriptorMigrationFixDescriptorsSQLStatsTableDatabaseRoleSettingsTenantUsageTableSQLInstancesTableNewRetryableRangefeedErrorsAlterSystemWebSessionsCreateIndexesSeparatedIntentsMigrationPostSeparatedIntentsMigrationRetryJobsWithExponentialBackoffRecordsBasedRegistryAutoSpanConfigReconciliationJobPreventNewInterleavedTablesEnsureNoInterleavedTablesDefaultPrivilegesZonesTableForSecondaryTenantsUseKeyEncodeForHashShardedIndexesDatabasePlacementPolicyGeneratedAsIdentityOnUpdateExpressionsSpanConfigurationsTableBoundedStalenessSQLStatsCompactionScheduledJobDateAndIntervalStyle" -var _Key_index = [...]uint16{0, 9, 26, 46, 58, 63, 72, 118, 168, 206, 248, 284, 302, 319, 324, 337, 346, 361, 390, 407, 424, 473, 487, 500, 520, 536, 553, 580, 615, 640, 669, 700, 720, 751, 778, 803, 820, 849, 882, 905, 924, 943, 966, 982, 1012, 1032} +var _Key_index = [...]uint16{0, 9, 26, 46, 58, 63, 72, 118, 168, 206, 248, 284, 301, 306, 319, 328, 343, 372, 389, 406, 455, 469, 482, 502, 518, 535, 562, 597, 622, 651, 682, 702, 733, 760, 785, 802, 831, 864, 887, 906, 925, 948, 964, 994, 1014} func (i Key) String() string { if i < 0 || i >= Key(len(_Key_index)-1) { diff --git a/pkg/kv/kvserver/batcheval/cmd_end_transaction.go b/pkg/kv/kvserver/batcheval/cmd_end_transaction.go index 5ebd5bc3ef0f..90a2f5920bc1 100644 --- a/pkg/kv/kvserver/batcheval/cmd_end_transaction.go +++ b/pkg/kv/kvserver/batcheval/cmd_end_transaction.go @@ -1108,8 +1108,7 @@ func mergeTrigger( // directly in this method. The primary reason why these are different is // because the RHS's persistent read summary may not be up-to-date, as it is // not updated by the SubsumeRequest. - readSumActive := rec.ClusterSettings().Version.IsActive(ctx, clusterversion.PriorReadSummaries) - if merge.RightReadSummary != nil && readSumActive { + if merge.RightReadSummary != nil { mergedSum := merge.RightReadSummary.Clone() if priorSum, err := readsummary.Load(ctx, batch, rec.GetRangeID()); err != nil { return result.Result{}, err diff --git a/pkg/kv/kvserver/batcheval/cmd_lease.go b/pkg/kv/kvserver/batcheval/cmd_lease.go index 221695102b60..9776819400a6 100644 --- a/pkg/kv/kvserver/batcheval/cmd_lease.go +++ b/pkg/kv/kvserver/batcheval/cmd_lease.go @@ -145,8 +145,7 @@ func evalNewLease( // only ever updates in-mem state) but it's easy to get things wrong (in // which case they could easily take a catastrophic turn) and the benefit is // low. - readSumActive := rec.ClusterSettings().Version.IsActive(ctx, clusterversion.PriorReadSummaries) - if priorReadSum != nil && readSumActive { + if priorReadSum != nil { if err := readsummary.Set(ctx, readWriter, rec.GetRangeID(), ms, priorReadSum); err != nil { return newFailedLeaseTrigger(isTransfer), err } diff --git a/pkg/kv/kvserver/replica_command.go b/pkg/kv/kvserver/replica_command.go index 10d48087b433..3e85d053a7bd 100644 --- a/pkg/kv/kvserver/replica_command.go +++ b/pkg/kv/kvserver/replica_command.go @@ -19,7 +19,6 @@ import ( "time" "github.com/cockroachdb/cockroach/pkg/base" - "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/keys" "github.com/cockroachdb/cockroach/pkg/kv" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/kvserverbase" @@ -562,13 +561,6 @@ func (r *Replica) AdminMerge( log.Event(ctx, "merge txn begins") txn.SetDebugName(mergeTxnName) - // If we aren't certain that all possible nodes in the cluster support a - // range merge transaction refreshing its reads while the RHS range is - // subsumed, observe the commit timestamp to force a client-side retry. - if !r.ClusterSettings().Version.IsActive(ctx, clusterversion.PriorReadSummaries) { - _ = txn.CommitTimestamp() - } - // Pipelining might send QueryIntent requests to the RHS after the RHS has // noticed the merge and started blocking all traffic. This causes the merge // transaction to deadlock. Just turn pipelining off; the structure of the diff --git a/pkg/sql/sem/tree/BUILD.bazel b/pkg/sql/sem/tree/BUILD.bazel index 02a06230070f..325d87281de0 100644 --- a/pkg/sql/sem/tree/BUILD.bazel +++ b/pkg/sql/sem/tree/BUILD.bazel @@ -116,7 +116,6 @@ go_library( visibility = ["//visibility:public"], deps = [ "//pkg/base", - "//pkg/clusterversion", "//pkg/geo", "//pkg/geo/geopb", "//pkg/keys", diff --git a/pkg/sql/sem/tree/as_of.go b/pkg/sql/sem/tree/as_of.go index 9a96f19b9b4c..641fd61e5eb5 100644 --- a/pkg/sql/sem/tree/as_of.go +++ b/pkg/sql/sem/tree/as_of.go @@ -18,7 +18,6 @@ import ( "time" "github.com/cockroachdb/apd/v2" - "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgcode" "github.com/cockroachdb/cockroach/pkg/sql/pgwire/pgerror" "github.com/cockroachdb/cockroach/pkg/sql/sessiondata" @@ -227,9 +226,7 @@ func DatumToHLC(evalCtx *EvalContext, stmtTimestamp time.Time, d Datum) (hlc.Tim s := string(*d) // Parse synthetic flag. syn := false - if strings.HasSuffix(s, "?") && evalCtx.Settings.Version.IsActive(evalCtx.Context, clusterversion.PriorReadSummaries) { - // NOTE: we don't parse this in mixed-version clusters because v20.2 - // nodes will not know how to handle synthetic timestamps. + if strings.HasSuffix(s, "?") { s = s[:len(s)-1] syn = true }