mirror of
https://github.com/apache/doris.git
synced 2026-11-04 07:31:17 +00:00
Problem Summary: Versioned rowset reads add load metadata versions to the reader minimum before compact rowsets remove covered loads from the returned set. With loads L2[2,2]@80 and L3[3,3]@90 covered by A[2,3]@150, plus L4[4,4]@170, reading [2,4] returns A and L4 but records a minimum of 80. Later compaction logs can consequently retain successive compacted rowsets for a snapshot that only needs L2/L3. Keep each candidate's metadata Versionstamp alongside its rowset, then merge only the final returned candidates into the existing minimum after both scans succeed. The returned set, scan/coverage rules, snapshot bounds and error propagation are unchanged. Previous stats and other real dependencies remain tracked, and persisted historical logs are unchanged. The regression exercises two real MetaService compactions and the Recycler reference checker using MemTxnKv: snapshot@100 still protects the first log containing L2/L3, while the later log has min_timestamp=150 and is no longer protected by that snapshot. ### Release note Fix unnecessary retention of later compacted rowsets when snapshots protect older load rowsets already covered by compaction.