From 2e01a1ad187e8e868a29a9a70099b4f45e82c2b5 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Fri, 14 Oct 2022 19:30:28 +0000 Subject: [PATCH 1/3] clusterversion: mint 22.2 Release note: none. --- docs/generated/settings/settings-for-tenants.txt | 2 +- docs/generated/settings/settings.html | 2 +- .../testdata/logic_test/crdb_internal_tenant | 4 ++-- pkg/clusterversion/cockroach_versions.go | 10 +++++++++- pkg/clusterversion/key_string.go | 5 +++-- pkg/sql/logictest/testdata/logic_test/crdb_internal | 6 +++--- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/docs/generated/settings/settings-for-tenants.txt b/docs/generated/settings/settings-for-tenants.txt index 8dc8b830cb1a..3d74189ad450 100644 --- a/docs/generated/settings/settings-for-tenants.txt +++ b/docs/generated/settings/settings-for-tenants.txt @@ -300,4 +300,4 @@ trace.jaeger.agent string the address of a Jaeger agent to receive traces using trace.opentelemetry.collector string address of an OpenTelemetry trace collector to receive traces using the otel gRPC protocol, as :. If no port is specified, 4317 will be used. trace.span_registry.enabled boolean true if set, ongoing traces can be seen at https:///#/debug/tracez trace.zipkin.collector string the address of a Zipkin instance to receive traces, as :. If no port is specified, 9411 will be used. -version version 1000022.1-76 set the active cluster version in the format '.' +version version 1000022.2 set the active cluster version in the format '.' diff --git a/docs/generated/settings/settings.html b/docs/generated/settings/settings.html index c3f584a22988..a4ba58ed6f51 100644 --- a/docs/generated/settings/settings.html +++ b/docs/generated/settings/settings.html @@ -234,6 +234,6 @@ trace.opentelemetry.collectorstringaddress of an OpenTelemetry trace collector to receive traces using the otel gRPC protocol, as :. If no port is specified, 4317 will be used. trace.span_registry.enabledbooleantrueif set, ongoing traces can be seen at https:///#/debug/tracez trace.zipkin.collectorstringthe address of a Zipkin instance to receive traces, as :. If no port is specified, 9411 will be used. -versionversion1000022.1-76set the active cluster version in the format '.' +versionversion1000022.2set the active cluster version in the format '.' diff --git a/pkg/ccl/logictestccl/testdata/logic_test/crdb_internal_tenant b/pkg/ccl/logictestccl/testdata/logic_test/crdb_internal_tenant index 770f2a70bc9a..6d14ccb90af7 100644 --- a/pkg/ccl/logictestccl/testdata/logic_test/crdb_internal_tenant +++ b/pkg/ccl/logictestccl/testdata/logic_test/crdb_internal_tenant @@ -349,7 +349,7 @@ select crdb_internal.get_vmodule() query T select regexp_replace(regexp_replace(crdb_internal.node_executable_version()::string, '(-\d+)?$', ''), '10000', ''); ---- -22.1 +22.2 query ITTT colnames select node_id, component, field, regexp_replace(regexp_replace(value, '^\d+$', ''), e':\\d+', ':') as value from crdb_internal.node_runtime_info @@ -442,7 +442,7 @@ select * from crdb_internal.gossip_alerts query T select regexp_replace(regexp_replace(crdb_internal.node_executable_version()::string, '(-\d+)?$', ''), '10000', ''); ---- -22.1 +22.2 user root diff --git a/pkg/clusterversion/cockroach_versions.go b/pkg/clusterversion/cockroach_versions.go index 8be9069bc9fd..0ec341434a8a 100644 --- a/pkg/clusterversion/cockroach_versions.go +++ b/pkg/clusterversion/cockroach_versions.go @@ -306,6 +306,10 @@ const ( // heuristics to identify invalid table descriptors for userfile-related // descriptors. FixUserfileRelatedDescriptorCorruption + + // V22_2 is CockroachDB v22.2. It's used for all v22.2.x patch releases. + V22_2 + // ************************************************* // Step (1): Add new versions here. // Do not add new versions to a patch release. @@ -496,6 +500,10 @@ var rawVersionsSingleton = keyedVersions{ Key: FixUserfileRelatedDescriptorCorruption, Version: roachpb.Version{Major: 22, Minor: 1, Internal: 76}, }, + { + Key: V22_2, + Version: roachpb.Version{Major: 22, Minor: 2, Internal: 0}, + }, // ************************************************* // Step (2): Add new versions here. // Do not add new versions to a patch release. @@ -511,7 +519,7 @@ const ( // finalVersion should be set on a release branch to the minted final cluster // version key, e.g. to V22_2 on the release-22.2 branch once it is minted. // Setting it has the effect of ensuring no versions are subsequently added. - finalVersion = invalidVersionKey + finalVersion = V22_2 ) // devVersionsAbove is the version key above which all versions are offset to be diff --git a/pkg/clusterversion/key_string.go b/pkg/clusterversion/key_string.go index 977ec8f35af8..3ec95fb8bc9f 100644 --- a/pkg/clusterversion/key_string.go +++ b/pkg/clusterversion/key_string.go @@ -48,11 +48,12 @@ func _() { _ = x[EnableLeaseUpgrade-36] _ = x[SupportAssumeRoleAuth-37] _ = x[FixUserfileRelatedDescriptorCorruption-38] + _ = x[V22_2-39] } -const _Key_name = "invalidVersionKeyV22_1Start22_2LocalTimestampsPebbleFormatSplitUserKeysMarkedCompactedEnsurePebbleFormatVersionRangeKeysEnablePebbleFormatVersionRangeKeysTrigramInvertedIndexesRemoveGrantPrivilegeMVCCRangeTombstonesUpgradeSequenceToBeReferencedByIDSampledStmtDiagReqsAddSSTableTombstonesSystemPrivilegesTableEnablePredicateProjectionChangefeedAlterSystemSQLInstancesAddLocalitySystemExternalConnectionsTableAlterSystemStatementStatisticsAddIndexRecommendationsRoleIDSequenceAddSystemUserIDColumnSystemUsersIDColumnIsBackfilledSetSystemUsersUserIDColumnNotNullSQLSchemaTelemetryScheduledJobsSchemaChangeSupportsCreateFunctionDeleteRequestReturnKeyPebbleFormatPrePebblev1MarkedRoleOptionsTableHasIDColumnRoleOptionsIDColumnIsBackfilledSetRoleOptionsUserIDColumnNotNullUseDelRangeInGCJobWaitedForDelRangeInGCJobRangefeedUseOneStreamPerNodeNoNonMVCCAddSSTableGCHintInReplicaStateUpdateInvalidColumnIDsInSequenceBackReferencesTTLDistSQLPrioritizeSnapshotsEnableLeaseUpgradeSupportAssumeRoleAuthFixUserfileRelatedDescriptorCorruption" +const _Key_name = "invalidVersionKeyV22_1Start22_2LocalTimestampsPebbleFormatSplitUserKeysMarkedCompactedEnsurePebbleFormatVersionRangeKeysEnablePebbleFormatVersionRangeKeysTrigramInvertedIndexesRemoveGrantPrivilegeMVCCRangeTombstonesUpgradeSequenceToBeReferencedByIDSampledStmtDiagReqsAddSSTableTombstonesSystemPrivilegesTableEnablePredicateProjectionChangefeedAlterSystemSQLInstancesAddLocalitySystemExternalConnectionsTableAlterSystemStatementStatisticsAddIndexRecommendationsRoleIDSequenceAddSystemUserIDColumnSystemUsersIDColumnIsBackfilledSetSystemUsersUserIDColumnNotNullSQLSchemaTelemetryScheduledJobsSchemaChangeSupportsCreateFunctionDeleteRequestReturnKeyPebbleFormatPrePebblev1MarkedRoleOptionsTableHasIDColumnRoleOptionsIDColumnIsBackfilledSetRoleOptionsUserIDColumnNotNullUseDelRangeInGCJobWaitedForDelRangeInGCJobRangefeedUseOneStreamPerNodeNoNonMVCCAddSSTableGCHintInReplicaStateUpdateInvalidColumnIDsInSequenceBackReferencesTTLDistSQLPrioritizeSnapshotsEnableLeaseUpgradeSupportAssumeRoleAuthFixUserfileRelatedDescriptorCorruptionV22_2" -var _Key_index = [...]uint16{0, 17, 22, 31, 46, 86, 120, 154, 176, 196, 215, 248, 267, 287, 308, 343, 377, 407, 460, 474, 495, 526, 559, 590, 624, 646, 675, 702, 733, 766, 784, 808, 836, 855, 875, 921, 931, 950, 968, 989, 1027} +var _Key_index = [...]uint16{0, 17, 22, 31, 46, 86, 120, 154, 176, 196, 215, 248, 267, 287, 308, 343, 377, 407, 460, 474, 495, 526, 559, 590, 624, 646, 675, 702, 733, 766, 784, 808, 836, 855, 875, 921, 931, 950, 968, 989, 1027, 1032} func (i Key) String() string { i -= -1 diff --git a/pkg/sql/logictest/testdata/logic_test/crdb_internal b/pkg/sql/logictest/testdata/logic_test/crdb_internal index d5b4d00c469a..07cbeb77f6cd 100644 --- a/pkg/sql/logictest/testdata/logic_test/crdb_internal +++ b/pkg/sql/logictest/testdata/logic_test/crdb_internal @@ -534,7 +534,7 @@ select crdb_internal.get_vmodule() query T select regexp_replace(crdb_internal.node_executable_version()::string, '(-\d+)?$', ''); ---- -1000022.1 +1000022.2 query ITTT colnames select node_id, component, field, regexp_replace(regexp_replace(value, '^\d+$', ''), e':\\d+', ':') as value from crdb_internal.node_runtime_info @@ -693,7 +693,7 @@ select * from crdb_internal.node_inflight_trace_spans query T select regexp_replace(crdb_internal.node_executable_version()::string, '(-\d+)?$', ''); ---- -1000022.1 +1000022.2 user root @@ -1187,4 +1187,4 @@ true user root statement ok -REVOKE SYSTEM MODIFYCLUSTERSETTING FROM testuser \ No newline at end of file +REVOKE SYSTEM MODIFYCLUSTERSETTING FROM testuser From e8fcd992b5f37905213f537e50adca1d960b38f9 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 17 Oct 2022 15:29:53 +0000 Subject: [PATCH 2/3] clusterverion: start 23.1 dev versions Release note: none. Epic: none. --- docs/generated/settings/settings-for-tenants.txt | 2 +- docs/generated/settings/settings.html | 2 +- pkg/clusterversion/cockroach_versions.go | 10 +++++++++- pkg/clusterversion/key_string.go | 5 +++-- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/generated/settings/settings-for-tenants.txt b/docs/generated/settings/settings-for-tenants.txt index 3d74189ad450..7f3e73e5b22d 100644 --- a/docs/generated/settings/settings-for-tenants.txt +++ b/docs/generated/settings/settings-for-tenants.txt @@ -300,4 +300,4 @@ trace.jaeger.agent string the address of a Jaeger agent to receive traces using trace.opentelemetry.collector string address of an OpenTelemetry trace collector to receive traces using the otel gRPC protocol, as :. If no port is specified, 4317 will be used. trace.span_registry.enabled boolean true if set, ongoing traces can be seen at https:///#/debug/tracez trace.zipkin.collector string the address of a Zipkin instance to receive traces, as :. If no port is specified, 9411 will be used. -version version 1000022.2 set the active cluster version in the format '.' +version version 1000022.2-2 set the active cluster version in the format '.' diff --git a/docs/generated/settings/settings.html b/docs/generated/settings/settings.html index a4ba58ed6f51..53d8146bbc0e 100644 --- a/docs/generated/settings/settings.html +++ b/docs/generated/settings/settings.html @@ -234,6 +234,6 @@ trace.opentelemetry.collectorstringaddress of an OpenTelemetry trace collector to receive traces using the otel gRPC protocol, as :. If no port is specified, 4317 will be used. trace.span_registry.enabledbooleantrueif set, ongoing traces can be seen at https:///#/debug/tracez trace.zipkin.collectorstringthe address of a Zipkin instance to receive traces, as :. If no port is specified, 9411 will be used. -versionversion1000022.2set the active cluster version in the format '.' +versionversion1000022.2-2set the active cluster version in the format '.' diff --git a/pkg/clusterversion/cockroach_versions.go b/pkg/clusterversion/cockroach_versions.go index 0ec341434a8a..7157c2a95833 100644 --- a/pkg/clusterversion/cockroach_versions.go +++ b/pkg/clusterversion/cockroach_versions.go @@ -310,6 +310,10 @@ const ( // V22_2 is CockroachDB v22.2. It's used for all v22.2.x patch releases. V22_2 + // V23_1_Start demarcates the start of cluster versions stepped through during + // the process of upgrading from 22.2 to 23.1. + V23_1Start + // ************************************************* // Step (1): Add new versions here. // Do not add new versions to a patch release. @@ -504,6 +508,10 @@ var rawVersionsSingleton = keyedVersions{ Key: V22_2, Version: roachpb.Version{Major: 22, Minor: 2, Internal: 0}, }, + { + Key: V23_1Start, + Version: roachpb.Version{Major: 22, Minor: 2, Internal: 2}, + }, // ************************************************* // Step (2): Add new versions here. // Do not add new versions to a patch release. @@ -519,7 +527,7 @@ const ( // finalVersion should be set on a release branch to the minted final cluster // version key, e.g. to V22_2 on the release-22.2 branch once it is minted. // Setting it has the effect of ensuring no versions are subsequently added. - finalVersion = V22_2 + finalVersion = invalidVersionKey ) // devVersionsAbove is the version key above which all versions are offset to be diff --git a/pkg/clusterversion/key_string.go b/pkg/clusterversion/key_string.go index 3ec95fb8bc9f..0e7c1b0a1c6e 100644 --- a/pkg/clusterversion/key_string.go +++ b/pkg/clusterversion/key_string.go @@ -49,11 +49,12 @@ func _() { _ = x[SupportAssumeRoleAuth-37] _ = x[FixUserfileRelatedDescriptorCorruption-38] _ = x[V22_2-39] + _ = x[V23_1Start-40] } -const _Key_name = "invalidVersionKeyV22_1Start22_2LocalTimestampsPebbleFormatSplitUserKeysMarkedCompactedEnsurePebbleFormatVersionRangeKeysEnablePebbleFormatVersionRangeKeysTrigramInvertedIndexesRemoveGrantPrivilegeMVCCRangeTombstonesUpgradeSequenceToBeReferencedByIDSampledStmtDiagReqsAddSSTableTombstonesSystemPrivilegesTableEnablePredicateProjectionChangefeedAlterSystemSQLInstancesAddLocalitySystemExternalConnectionsTableAlterSystemStatementStatisticsAddIndexRecommendationsRoleIDSequenceAddSystemUserIDColumnSystemUsersIDColumnIsBackfilledSetSystemUsersUserIDColumnNotNullSQLSchemaTelemetryScheduledJobsSchemaChangeSupportsCreateFunctionDeleteRequestReturnKeyPebbleFormatPrePebblev1MarkedRoleOptionsTableHasIDColumnRoleOptionsIDColumnIsBackfilledSetRoleOptionsUserIDColumnNotNullUseDelRangeInGCJobWaitedForDelRangeInGCJobRangefeedUseOneStreamPerNodeNoNonMVCCAddSSTableGCHintInReplicaStateUpdateInvalidColumnIDsInSequenceBackReferencesTTLDistSQLPrioritizeSnapshotsEnableLeaseUpgradeSupportAssumeRoleAuthFixUserfileRelatedDescriptorCorruptionV22_2" +const _Key_name = "invalidVersionKeyV22_1Start22_2LocalTimestampsPebbleFormatSplitUserKeysMarkedCompactedEnsurePebbleFormatVersionRangeKeysEnablePebbleFormatVersionRangeKeysTrigramInvertedIndexesRemoveGrantPrivilegeMVCCRangeTombstonesUpgradeSequenceToBeReferencedByIDSampledStmtDiagReqsAddSSTableTombstonesSystemPrivilegesTableEnablePredicateProjectionChangefeedAlterSystemSQLInstancesAddLocalitySystemExternalConnectionsTableAlterSystemStatementStatisticsAddIndexRecommendationsRoleIDSequenceAddSystemUserIDColumnSystemUsersIDColumnIsBackfilledSetSystemUsersUserIDColumnNotNullSQLSchemaTelemetryScheduledJobsSchemaChangeSupportsCreateFunctionDeleteRequestReturnKeyPebbleFormatPrePebblev1MarkedRoleOptionsTableHasIDColumnRoleOptionsIDColumnIsBackfilledSetRoleOptionsUserIDColumnNotNullUseDelRangeInGCJobWaitedForDelRangeInGCJobRangefeedUseOneStreamPerNodeNoNonMVCCAddSSTableGCHintInReplicaStateUpdateInvalidColumnIDsInSequenceBackReferencesTTLDistSQLPrioritizeSnapshotsEnableLeaseUpgradeSupportAssumeRoleAuthFixUserfileRelatedDescriptorCorruptionV22_2V23_1Start" -var _Key_index = [...]uint16{0, 17, 22, 31, 46, 86, 120, 154, 176, 196, 215, 248, 267, 287, 308, 343, 377, 407, 460, 474, 495, 526, 559, 590, 624, 646, 675, 702, 733, 766, 784, 808, 836, 855, 875, 921, 931, 950, 968, 989, 1027, 1032} +var _Key_index = [...]uint16{0, 17, 22, 31, 46, 86, 120, 154, 176, 196, 215, 248, 267, 287, 308, 343, 377, 407, 460, 474, 495, 526, 559, 590, 624, 646, 675, 702, 733, 766, 784, 808, 836, 855, 875, 921, 931, 950, 968, 989, 1027, 1032, 1042} func (i Key) String() string { i -= -1 From c2e366eeba7bc2466f8646a2cc2ccd9d30a12006 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Mon, 17 Oct 2022 15:48:42 +0000 Subject: [PATCH 3/3] clusterversion: define 23.1 placeholder key Release note: none. Epic: none. --- pkg/clusterversion/cockroach_versions.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/clusterversion/cockroach_versions.go b/pkg/clusterversion/cockroach_versions.go index 7157c2a95833..a25f9c098f8b 100644 --- a/pkg/clusterversion/cockroach_versions.go +++ b/pkg/clusterversion/cockroach_versions.go @@ -558,6 +558,14 @@ var versionsSingleton = func() keyedVersions { return rawVersionsSingleton }() +// V23_1 is a placeholder that will eventually be replaced by the actual 23.1 +// version Key, but in the meantime it points to the latest Key. The placeholder +// is defined so that it can be referenced in code that simply wants to check if +// a cluster is running 23.1 and has completed all associated migrations; most +// version gates can use this instead of defining their own version key if all +// simply need to check is that the cluster has upgraded to 23.1. +var V23_1 = versionsSingleton[len(versionsSingleton)-1].Key + // TODO(irfansharif): clusterversion.binary{,MinimumSupported}Version // feels out of place. A "cluster version" and a "binary version" are two // separate concepts.