Skip to content

Commit 2bd4025

Browse files
committed
fix(store): handle decodeValue error in scanProcessKey
1 parent 94f7eaf commit 2bd4025

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

store/lsm_store.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,12 @@ func (s *pebbleStore) scanProcessKey(iter *pebble.Iterator, ts uint64, lastUserK
273273

274274
if version <= ts {
275275
valBytes := iter.Value()
276-
sv, _ := decodeValue(valBytes)
276+
sv, err := decodeValue(valBytes)
277+
if err != nil {
278+
s.log.Error("failed to decode value", slog.Any("error", err), slog.String("key", string(k)))
279+
iter.Next()
280+
return nil, true // continue loop
281+
}
277282

278283
*lastUserKey = append([]byte(nil), userKey...)
279284

0 commit comments

Comments
 (0)