mirror of
https://github.com/qdrant/qdrant.git
synced 2026-10-03 03:17:43 -05:00
* Make payload index creation durably self-contained (alternative to #9737) Flush the segment (serialized with the flush pipeline) before building a field index, and flush the built index before saving the config, so the synchronously written config never durably outruns the state the build observed or the index data it describes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Derive wipe_field_dirs candidates from PayloadIndexType exhaustively A hardcoded directory list silently misses new index types. Map each PayloadIndexType variant to its storage directory in an exhaustive match and iterate the enum, so a new variant does not compile until its directory is declared and is then wiped on rebuilds automatically. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> * Flush built index in build phase, not under the segment write lock apply_index runs under the segment write lock, and flushing a freshly built index there blocks reads for the duration of the flush. Move the flush into Segment::build_field_index, which runs under the upgradable read lock: searches keep flowing, durability ordering is unchanged (index data still becomes durable before the config lists it), and the not-yet-installed storages cannot overlap any captured flusher pass. Also validate the incompatible index type switch (keyword -> full-text) across a simulated crash. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>