Skip to content

Commit 660e5a9

Browse files
committed
fix: delete existing plists when doing a single UID update
1 parent 1f0621e commit 660e5a9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

posting/list.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,12 @@ func (l *List) updateMutationLayer(mpost *pb.Posting, singleUidUpdate, hasCountI
773773
// Add the deletions in the existing plist because those postings are not picked
774774
// up by iterating. Not doing so would result in delete operations that are not
775775
// applied when the transaction is committed.
776-
l.mutationMap.currentEntries = &pb.PostingList{}
776+
for _, post := range l.mutationMap.currentEntries.Postings {
777+
if post.Op == Del && post.Uid != mpost.Uid {
778+
newPlist.Postings = append(newPlist.Postings, post)
779+
}
780+
}
781+
777782
err := l.iterate(mpost.StartTs, 0, func(obj *pb.Posting) error {
778783
// Ignore values which have the same uid as they will get replaced
779784
// by the current value.

0 commit comments

Comments
 (0)