diff --git a/docs/generated/settings/settings-for-tenants.txt b/docs/generated/settings/settings-for-tenants.txt index 3dc7a1e5b030..53dc2c1b5d66 100644 --- a/docs/generated/settings/settings-for-tenants.txt +++ b/docs/generated/settings/settings-for-tenants.txt @@ -298,4 +298,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-4 set the active cluster version in the format '.' +version version 1000022.2-6 set the active cluster version in the format '.' diff --git a/docs/generated/settings/settings.html b/docs/generated/settings/settings.html index 2e2e52c98de2..f9bfd37c3c74 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.2-4set the active cluster version in the format '.' +versionversion1000022.2-6set the active cluster version in the format '.' diff --git a/pkg/clusterversion/cockroach_versions.go b/pkg/clusterversion/cockroach_versions.go index fe39c4017bc4..b844d0676e0a 100644 --- a/pkg/clusterversion/cockroach_versions.go +++ b/pkg/clusterversion/cockroach_versions.go @@ -318,6 +318,11 @@ const ( // TenantNames adds a name column to system.tenants. V23_1TenantNames + // V23_1EnableGCClearRange allows GC to fill and send ClearRange portions of + // GC Requests to request removal of multiple keys using pebble tombstones + // when applicable. + V23_1EnableGCClearRange + // ************************************************* // Step (1): Add new versions here. // Do not add new versions to a patch release. @@ -520,6 +525,10 @@ var rawVersionsSingleton = keyedVersions{ Key: V23_1TenantNames, Version: roachpb.Version{Major: 22, Minor: 2, Internal: 4}, }, + { + Key: V23_1EnableGCClearRange, + Version: roachpb.Version{Major: 22, Minor: 2, Internal: 6}, + }, // ************************************************* // Step (2): Add new versions here. diff --git a/pkg/clusterversion/key_string.go b/pkg/clusterversion/key_string.go index 447372178995..84229a0e773b 100644 --- a/pkg/clusterversion/key_string.go +++ b/pkg/clusterversion/key_string.go @@ -51,11 +51,12 @@ func _() { _ = x[V22_2-39] _ = x[V23_1Start-40] _ = x[V23_1TenantNames-41] + _ = x[V23_1EnableGCClearRange-42] } -const _Key_name = "invalidVersionKeyV22_1V22_2StartV22_2LocalTimestampsV22_2PebbleFormatSplitUserKeysMarkedCompactedV22_2EnsurePebbleFormatVersionRangeKeysV22_2EnablePebbleFormatVersionRangeKeysV22_2TrigramInvertedIndexesV22_2RemoveGrantPrivilegeV22_2MVCCRangeTombstonesV22_2UpgradeSequenceToBeReferencedByIDV22_2SampledStmtDiagReqsV22_2AddSSTableTombstonesV22_2SystemPrivilegesTableV22_2EnablePredicateProjectionChangefeedV22_2AlterSystemSQLInstancesAddLocalityV22_2SystemExternalConnectionsTableV22_2AlterSystemStatementStatisticsAddIndexRecommendationsV22_2RoleIDSequenceV22_2AddSystemUserIDColumnV22_2SystemUsersIDColumnIsBackfilledV22_2SetSystemUsersUserIDColumnNotNullV22_2SQLSchemaTelemetryScheduledJobsV22_2SchemaChangeSupportsCreateFunctionV22_2DeleteRequestReturnKeyV22_2PebbleFormatPrePebblev1MarkedV22_2RoleOptionsTableHasIDColumnV22_2RoleOptionsIDColumnIsBackfilledV22_2SetRoleOptionsUserIDColumnNotNullV22_2UseDelRangeInGCJobV22_2WaitedForDelRangeInGCJobV22_2RangefeedUseOneStreamPerNodeV22_2NoNonMVCCAddSSTableV22_2GCHintInReplicaStateV22_2UpdateInvalidColumnIDsInSequenceBackReferencesV22_2TTLDistSQLV22_2PrioritizeSnapshotsV22_2EnableLeaseUpgradeV22_2SupportAssumeRoleAuthV22_2FixUserfileRelatedDescriptorCorruptionV22_2V23_1StartV23_1TenantNames" +const _Key_name = "invalidVersionKeyV22_1V22_2StartV22_2LocalTimestampsV22_2PebbleFormatSplitUserKeysMarkedCompactedV22_2EnsurePebbleFormatVersionRangeKeysV22_2EnablePebbleFormatVersionRangeKeysV22_2TrigramInvertedIndexesV22_2RemoveGrantPrivilegeV22_2MVCCRangeTombstonesV22_2UpgradeSequenceToBeReferencedByIDV22_2SampledStmtDiagReqsV22_2AddSSTableTombstonesV22_2SystemPrivilegesTableV22_2EnablePredicateProjectionChangefeedV22_2AlterSystemSQLInstancesAddLocalityV22_2SystemExternalConnectionsTableV22_2AlterSystemStatementStatisticsAddIndexRecommendationsV22_2RoleIDSequenceV22_2AddSystemUserIDColumnV22_2SystemUsersIDColumnIsBackfilledV22_2SetSystemUsersUserIDColumnNotNullV22_2SQLSchemaTelemetryScheduledJobsV22_2SchemaChangeSupportsCreateFunctionV22_2DeleteRequestReturnKeyV22_2PebbleFormatPrePebblev1MarkedV22_2RoleOptionsTableHasIDColumnV22_2RoleOptionsIDColumnIsBackfilledV22_2SetRoleOptionsUserIDColumnNotNullV22_2UseDelRangeInGCJobV22_2WaitedForDelRangeInGCJobV22_2RangefeedUseOneStreamPerNodeV22_2NoNonMVCCAddSSTableV22_2GCHintInReplicaStateV22_2UpdateInvalidColumnIDsInSequenceBackReferencesV22_2TTLDistSQLV22_2PrioritizeSnapshotsV22_2EnableLeaseUpgradeV22_2SupportAssumeRoleAuthV22_2FixUserfileRelatedDescriptorCorruptionV22_2V23_1StartV23_1TenantNamesV23_1EnableGCClearRange" -var _Key_index = [...]uint16{0, 17, 22, 32, 52, 97, 136, 175, 202, 227, 251, 289, 313, 338, 364, 404, 443, 478, 536, 555, 581, 617, 655, 691, 730, 757, 791, 823, 859, 897, 920, 949, 982, 1006, 1031, 1082, 1097, 1121, 1144, 1170, 1213, 1218, 1228, 1244} +var _Key_index = [...]uint16{0, 17, 22, 32, 52, 97, 136, 175, 202, 227, 251, 289, 313, 338, 364, 404, 443, 478, 536, 555, 581, 617, 655, 691, 730, 757, 791, 823, 859, 897, 920, 949, 982, 1006, 1031, 1082, 1097, 1121, 1144, 1170, 1213, 1218, 1228, 1244, 1267} func (i Key) String() string { i -= -1 diff --git a/pkg/kv/kvserver/mvcc_gc_queue.go b/pkg/kv/kvserver/mvcc_gc_queue.go index fcc4cfe12496..6c9b4119a361 100644 --- a/pkg/kv/kvserver/mvcc_gc_queue.go +++ b/pkg/kv/kvserver/mvcc_gc_queue.go @@ -18,6 +18,7 @@ import ( "sync/atomic" "time" + "github.com/cockroachdb/cockroach/pkg/clusterversion" "github.com/cockroachdb/cockroach/pkg/kv" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/gc" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/intentresolver" @@ -681,7 +682,10 @@ func (mgcq *mvccGCQueue) process( maxIntentsPerCleanupBatch := gc.MaxIntentsPerCleanupBatch.Get(&repl.store.ClusterSettings().SV) maxIntentKeyBytesPerCleanupBatch := gc.MaxIntentKeyBytesPerCleanupBatch.Get(&repl.store.ClusterSettings().SV) txnCleanupThreshold := gc.TxnCleanupThreshold.Get(&repl.store.ClusterSettings().SV) - minKeyNumberForClearRange := gc.ClearRangeMinKeys.Get(&repl.store.ClusterSettings().SV) + var clearRangeMinKeys int64 = 0 + if repl.store.ClusterSettings().Version.IsActive(ctx, clusterversion.V23_1EnableGCClearRange) { + clearRangeMinKeys = gc.ClearRangeMinKeys.Get(&repl.store.ClusterSettings().SV) + } info, err := gc.Run(ctx, desc, snap, gcTimestamp, newThreshold, gc.RunOptions{ @@ -691,7 +695,7 @@ func (mgcq *mvccGCQueue) process( TxnCleanupThreshold: txnCleanupThreshold, MaxTxnsPerIntentCleanupBatch: intentresolver.MaxTxnsPerIntentCleanupBatch, IntentCleanupBatchTimeout: mvccGCQueueIntentBatchTimeout, - ClearRangeMinKeys: minKeyNumberForClearRange, + ClearRangeMinKeys: clearRangeMinKeys, }, conf.TTL(), &replicaGCer{