Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

storage: enable usage of RocksDB DeleteRange by default #14391

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions pkg/storage/replica_raftstorage.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import (
"github.com/cockroachdb/cockroach/pkg/storage/engine"
"github.com/cockroachdb/cockroach/pkg/storage/engine/enginepb"
"github.com/cockroachdb/cockroach/pkg/storage/storagebase"
"github.com/cockroachdb/cockroach/pkg/util/envutil"
"github.com/cockroachdb/cockroach/pkg/util/hlc"
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/cockroachdb/cockroach/pkg/util/timeutil"
Expand Down Expand Up @@ -516,8 +515,6 @@ const (
snapTypePreemptive = "preemptive"
)

var fastClearRange = envutil.EnvOrDefaultBool("COCKROACH_ENABLE_FAST_CLEAR_RANGE", false)

func clearRangeData(desc *roachpb.RangeDescriptor, eng engine.Engine, batch engine.Batch) error {
iter := eng.NewIterator(false)
defer iter.Close()
Expand All @@ -527,7 +524,7 @@ func clearRangeData(desc *roachpb.RangeDescriptor, eng engine.Engine, batch engi
// The metadata ranges have a relatively small number of keys making usage
// of range tombstones (as created by ClearRange) a pessimization.
var err error
if i < metadataRanges || !fastClearRange {
if i < metadataRanges {
err = batch.ClearIterRange(iter, keyRange.start, keyRange.end)
} else {
err = batch.ClearRange(keyRange.start, keyRange.end)
Expand Down