Skip to content

Commit

Permalink
batcheval: write new GCHint fields under version gate
Browse files Browse the repository at this point in the history
Epic: none
Release note (general change): set the default behaviour for
`kv.gc.sticky_hint.enabled` cluster setting to enabled since 23.2. The
setting is deprecated in 23.2 going forward.
  • Loading branch information
pav-kv committed Oct 24, 2023
1 parent aab9af1 commit 829cb6d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/kv/kvserver/batcheval/cmd_delete_range.go
Expand Up @@ -14,6 +14,7 @@ import (
"context"
"time"

"github.com/cockroachdb/cockroach/pkg/clusterversion"
"github.com/cockroachdb/cockroach/pkg/keys"
"github.com/cockroachdb/cockroach/pkg/kv/kvpb"
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/batcheval/result"
Expand Down Expand Up @@ -146,7 +147,10 @@ func DeleteRange(
}

updated := false
if enableStickyGCHint.Get(&cArgs.EvalCtx.ClusterSettings().SV) {
// TODO(pavelkalinnikov): deprecate the cluster setting and call
// ScheduleGCFor unconditionally when min supported version is 23.2.
if cArgs.EvalCtx.ClusterSettings().Version.IsActive(ctx, clusterversion.V23_2) ||
enableStickyGCHint.Get(&cArgs.EvalCtx.ClusterSettings().SV) {
// Add the timestamp to GCHint to guarantee that GC eventually clears it.
updated = hint.ScheduleGCFor(h.Timestamp)
}
Expand Down

0 comments on commit 829cb6d

Please sign in to comment.