Skip to content

Commit d8cef2a

Browse files
author
Harshil goel
committed
fixed stuff for ongoing transactions
1 parent c7ec011 commit d8cef2a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

posting/lists.go

+20
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,32 @@ func (lc *LocalCache) GetSinglePosting(key []byte) (*pb.PostingList, error) {
340340
return nil
341341
}
342342

343+
getList := func() *List {
344+
lc.RLock()
345+
defer lc.RUnlock()
346+
347+
return lc.plists[string(key)]
348+
}
349+
350+
getPostingFromList := func() *pb.PostingList {
351+
l := getList()
352+
if l != nil {
353+
return l.mutationMap[lc.startTs]
354+
}
355+
return nil
356+
}
357+
343358
getPostings := func() (*pb.PostingList, error) {
344359
pl := getDeltas()
345360
if pl != nil {
346361
return pl, nil
347362
}
348363

364+
pl = getPostingFromList()
365+
if pl != nil {
366+
return pl, nil
367+
}
368+
349369
pl = &pb.PostingList{}
350370
txn := pstore.NewTransactionAt(lc.startTs, false)
351371
item, err := txn.Get(key)

0 commit comments

Comments
 (0)