From 8cf4252203ba2e2b8d650dc34579705417b16fcd Mon Sep 17 00:00:00 2001 From: Tyler Williams Date: Tue, 18 Jun 2024 16:01:32 -0700 Subject: [PATCH] Use pebble types and interfaces correctly --- internal/logdb/kv/pebble/kv_pebble.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/logdb/kv/pebble/kv_pebble.go b/internal/logdb/kv/pebble/kv_pebble.go index 1d73b950..15bec52c 100644 --- a/internal/logdb/kv/pebble/kv_pebble.go +++ b/internal/logdb/kv/pebble/kv_pebble.go @@ -165,7 +165,7 @@ func openPebbleDB(config config.LogDBConfig, callback kv.LogDBCallback, } }) blockSize := int(config.KVBlockSize) - writeBufferSize := int(config.KVWriteBufferSize) + writeBufferSize := uint64(config.KVWriteBufferSize) maxWriteBufferNumber := int(config.KVMaxWriteBufferNumber) l0FileNumCompactionTrigger := int(config.KVLevel0FileNumCompactionTrigger) l0StopWritesTrigger := int(config.KVLevel0StopWritesTrigger) @@ -277,7 +277,10 @@ func iteratorIsValid(iter *pebble.Iterator) bool { // IterateValue ... func (r *KV) IterateValue(fk []byte, lk []byte, inc bool, op func(key []byte, data []byte) (bool, error)) (err error) { - iter := r.db.NewIter(r.ro) + iter, err := r.db.NewIter(r.ro) + if err != nil { + return err + } defer func() { err = firstError(err, iter.Close()) }()