diff --git a/posting/list.go b/posting/list.go index 5c841971afa..6b51b18d73e 100644 --- a/posting/list.go +++ b/posting/list.go @@ -526,9 +526,12 @@ func (l *List) addMutationInternal(ctx context.Context, txn *Txn, t *pb.Directed // getMutation returns a marshaled version of posting list mutation stored internally. func (l *List) getMutation(startTs uint64) []byte { - l.RLock() - defer l.RUnlock() + l.Lock() + defer l.Unlock() if pl, ok := l.mutationMap[startTs]; ok { + for _, p := range pl.GetPostings() { + p.StartTs = 0 + } data, err := pl.Marshal() x.Check(err) return data @@ -596,6 +599,7 @@ func (l *List) pickPostings(readTs uint64) (uint64, []*pb.Posting) { deleteBelowTs = effectiveTs continue } + mpost.StartTs = startTs posts = append(posts, mpost) } }