Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions posting/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,20 @@ func (l *List) Rollup(alloc *z.Allocator, readTs uint64) ([]*bpb.KV, error) {
kvs = append(kvs, kv)
}

// Retire removed parts at the parent's timestamp (+1 for finite readTs)
// so compaction preserves reads using the old parent.
for _, startUid := range l.plist.Splits {
if _, retained := out.parts[startUid]; retained {
continue
}
part, err := out.marshalPostingListPart(alloc, l.key, startUid, &pb.PostingList{})
if err != nil {
return nil, errors.Wrapf(err, "cannot marshal removed posting list part")
}
part.Version = kv.Version
kvs = append(kvs, part)
}

// Sort the KVs by their key so that the main part of the list is at the
// start of the list and all other parts appear in the order of their start UID.
sort.Slice(kvs, func(i, j int) bool {
Expand Down
Loading
Loading