Skip to content

Commit

Permalink
fix(readPostingList): Return error instead of panic (dgraph-io#5877)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Ibrahim Jarif authored and dna2github committed Jul 18, 2020
1 parent fdd637b commit c4b6b0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion posting/mvcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,9 @@ func ReadPostingList(key []byte, it *badger.Iterator) (*List, error) {
case BitDeltaPosting:
err := item.Value(func(val []byte) error {
pl := &pb.PostingList{}
x.Check(pl.Unmarshal(val))
if err := pl.Unmarshal(val); err != nil {
return err
}
pl.CommitTs = item.Version()
for _, mpost := range pl.Postings {
// commitTs, startTs are meant to be only in memory, not
Expand Down

0 comments on commit c4b6b0e

Please sign in to comment.