diff --git a/posting/lists.go b/posting/lists.go index 45aaa80ab87..769c73f69b4 100644 --- a/posting/lists.go +++ b/posting/lists.go @@ -340,12 +340,32 @@ func (lc *LocalCache) GetSinglePosting(key []byte) (*pb.PostingList, error) { return nil } + getList := func() *List { + lc.RLock() + defer lc.RUnlock() + + return lc.plists[string(key)] + } + + getPostingFromList := func() *pb.PostingList { + l := getList() + if l != nil { + return l.mutationMap[lc.startTs] + } + return nil + } + getPostings := func() (*pb.PostingList, error) { pl := getDeltas() if pl != nil { return pl, nil } + pl = getPostingFromList() + if pl != nil { + return pl, nil + } + pl = &pb.PostingList{} txn := pstore.NewTransactionAt(lc.startTs, false) item, err := txn.Get(key)