Skip to content

Fix WAL replay dropping points after delete_named_vector - #9105

Merged
agourlay merged 5 commits into
devfrom
delete-vector-name-wal-replay-repro
Jun 9, 2026
Merged

Fix WAL replay dropping points after delete_named_vector#9105
agourlay merged 5 commits into
devfrom
delete-vector-name-wal-replay-repro

Conversation

@agourlay

@agourlay agourlay commented May 20, 2026

Copy link
Copy Markdown
Member

An Upsert sitting in unflushed WAL when delete_named_vector(X) is called still references X.

On reopen, WAL replay rejects it (Not existing vector name error: X) and the target point is lost.

Fix: in LocalShard::load_from_wal, strip references to vector names not in the current collection config before applying each replayed op (CollectionUpdateOperations::retain_vector_names).

The point survives with its remaining vectors, matching live behavior.

Tests (lib/collection/src/tests/delete_vector_name_replay.rs):

  1. delete_named_vector_then_reload_loses_points — the repro; now passes with the fix.
  2. delete_named_vector_after_flush_survives_reload — flushing before the delete already closed the window.
  3. repeated_create_then_delete_vector_name_with_flush_survives_reload — the bug is the unflushed-Upsert variant, not any Create+Delete cycle.

Adds a #[cfg(test)] helper force_flush_local_for_test on ShardReplicaSet.

Note: scoped to the optimizer-off WAL-replay path. The optimizer-on proxy-segment schema race is separate and not addressed here.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@agourlay agourlay changed the title WAL replay reproducer for delete_named_vector Fix WAL replay dropping points after delete_named_vector Jun 3, 2026
@agourlay
agourlay marked this pull request as ready for review June 3, 2026 15:31
@agourlay
agourlay requested a review from timvisee June 3, 2026 15:33
@qdrant qdrant deleted a comment from coderabbitai Bot Jun 4, 2026
Comment thread lib/shard/src/operations/mod.rs
Comment thread lib/collection/src/shards/local_shard/mod.rs
@qdrant qdrant deleted a comment from coderabbitai Bot Jun 4, 2026
@agourlay
agourlay force-pushed the delete-vector-name-wal-replay-repro branch from f67b285 to c8b4f2c Compare June 8, 2026 15:56
@agourlay
agourlay requested a review from timvisee June 8, 2026 20:12
@qdrant qdrant deleted a comment from coderabbitai Bot Jun 9, 2026
Comment thread lib/collection/src/shards/local_shard/mod.rs
@agourlay
agourlay merged commit ad574a7 into dev Jun 9, 2026
15 checks passed
@agourlay
agourlay deleted the delete-vector-name-wal-replay-repro branch June 9, 2026 12:06
generall pushed a commit that referenced this pull request Aug 4, 2026
* WAL replay reproducer for delete_named_vector

* fix

* Update lib/shard/src/operations/mod.rs

Co-authored-by: Tim Visée <tim+github@visee.me>

* add vector name created

* track best-effort behavior

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants