Files
qdrant/lib
Arnaud Gourlay 1156d7ece1 fix(optimizer): defer source segment data destruction until durable
Optimizations copy-on-write move points out of their source segments in
memory; WAL replay can only re-derive those moves from the sources'
on-disk pre-images. Destroying the replaced segments' files right at the
swap breaks that: the moved copies may still sit unflushed in appendable
segments, so a restart before they are persisted loses the points.

Instead of dropping source data in finish_optimization, retire the
segments. Their files survive until a flush proves the durable waterline
covers the optimization, at which point flush_all destroys them. While
the files remain on disk the WAL acknowledge is capped at the wrapped
segment's persisted version, so every operation the files contradict
(deletions in particular) is replayed and re-applied on restart. A crash
in the meantime loads the retirees next to their replacement and
load-time deduplication resolves the overlap.

Optimizer tests that assert source files are gone now flush first to
mature the retirees before counting/asserting.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 14:04:46 +00:00
..
2026-04-21 00:20:02 +02:00
2026-06-12 22:24:23 +02:00
2026-04-24 11:44:21 +02:00