Skip to content

Commit

Permalink
Disable seek compaction (#1342)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmanc authored Mar 7, 2025
1 parent 1e556fc commit 1a23064
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion common/kvstore/leveldb/leveldb_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/prometheus/client_golang/prometheus"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/opt"
"github.com/syndtr/goleveldb/leveldb/util"
)

Expand All @@ -30,7 +31,10 @@ type levelDBStore struct {
// NewStore returns a new levelDBStore built using LevelDB.
// If reg is nil, metrics will not be collected.
func NewStore(logger logging.Logger, path string, reg *prometheus.Registry) (kvstore.Store[[]byte], error) {
levelDB, err := leveldb.OpenFile(path, nil)
opts := &opt.Options{
DisableSeeksCompaction: true, // Default is false (seeks trigger compaction)
}
levelDB, err := leveldb.OpenFile(path, opts)

if err != nil {
return nil, err
Expand Down

0 comments on commit 1a23064

Please sign in to comment.