Skip to content

Commit 95d292c

Browse files
author
Ibrahim Jarif
committed
fix(readPostingList): Return error instead of panic (#5877)
We've seen some panics like "proto: illegal wireType 6" on trying to read the posting lists. We haven't found the fix yet. The issue could be because badger is returning incorrect values for the posting list. Since we haven't been able to reproduce it, this is a stop-gap solution to return an error instead of crashing dgraph. This is not the fix, this will return an error instead of causing a panic. Fixes DGRAPH-1778 (cherry picked from commit f2773c8)
1 parent 0c25a21 commit 95d292c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

posting/mvcc.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,9 @@ func ReadPostingList(key []byte, it *badger.Iterator) (*List, error) {
300300
case BitDeltaPosting:
301301
err := item.Value(func(val []byte) error {
302302
pl := &pb.PostingList{}
303-
x.Check(pl.Unmarshal(val))
303+
if err := pl.Unmarshal(val); err != nil {
304+
return err
305+
}
304306
pl.CommitTs = item.Version()
305307
for _, mpost := range pl.Postings {
306308
// commitTs, startTs are meant to be only in memory, not

0 commit comments

Comments
 (0)