Skip to content

Commit

Permalink
fix(readPostingList): Return error instead of panic (#5877) (#5908)
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

(cherry picked from commit f2773c8)

Co-authored-by: parasssh <paras@dgraph.io>
  • Loading branch information
Ibrahim Jarif and parasssh committed Jul 13, 2020
1 parent 7e6e2f3 commit 4e31555
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 @@ -190,7 +190,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 4e31555

Please sign in to comment.