Commit Graph

4220 Commits

Author SHA1 Message Date
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
Luis Cossío
fe214bf44e [UIO] Batched OnDiskMapIndex::for_values_map (#9505)
* override `for_values_map` for `OnDiskMapIndex`

* refactor and apply to filter as id iterator

* add comment

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2026-06-22 09:50:37 -04:00
Luis Cossío
1fea74f536 [UIO] Batching for OnDiskMapIndex::values_iter (#9491) 2026-06-22 09:48:01 -04:00
Andrey Vasnetsov
852ca200b5 feat: feature-flagged segment manifest for LocalShard (#9530)
* feat: feature-flagged segment manifest for LocalShard

Add an on-disk segment manifest (`segments/manifest.json`) that lists a
shard's segments and their state, so out-of-process readers (e.g. a
read-only follower, possibly over object storage) can discover segments
without scanning the filesystem. Gated by the new `write_segment_manifest`
feature flag (off by default).

shard: define the structure + helpers (`SegmentsManifest`,
`SegmentManifestState`, `from_segment_holder`) in a new `segment_manifest`
module, plus the `SEGMENT_MANIFEST_FILE` constant and path helper. The
manifest is a flat `{ "<uuid>": "<state>" }` map; only `active` is written
today, with `under_construction`/`retiring` defined so the format can be
extended without breaking compatibility.

collection: LocalShard owns the writing logic. The manifest is persisted
via `SaveOnDisk<SegmentsManifest>`, initialized from the live segment set
on load/build and refreshed by the optimization worker whenever the
segment set changes (the helper re-derives from the holder and no-ops when
unchanged). No changes to `lib/shard/src/optimize.rs` internals.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Emj8TFxdtrf3K32eWhGgor

* feat: make append_only_mutations a proper feature flag

Replace the debug-only `QDRANT_APPEND_ONLY_MUTATIONS=1` env-var escape
hatch in segment construction with a `FeatureFlags::append_only_mutations`
flag, so it works in release builds and is configurable like the other
flags (config / `QDRANT__FEATURE_FLAGS__APPEND_ONLY_MUTATIONS`).

Deliberately left out of `FeatureFlags::all()`: it changes mutation
semantics and `all` is enabled in dev and e2e configs, so it stays
explicit opt-in.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Emj8TFxdtrf3K32eWhGgor

* upd openapi schema

* feat: register segments in manifest via must-use token, holder builder

Wire segment-manifest maintenance through the segment lifecycle so a
newly created segment is registered as soon as it exists on disk, and
construction can't silently skip it:

- build_segment now returns a #[must_use] NewSegmentToken carrying the
  new segment UUID; the lint forces callers to register or drop it.
- SegmentHolder owns the manifest and reconciles it on sync; new
  segments are registered ASAP (even before being added to the holder)
  via the token, before they can receive writes.
- SegmentHolderBuilder is the only way to obtain a shard's holder; its
  build() wires up the manifest, so it can't be forgotten. init/set
  manifest helpers are now private / test-only.
- Optimization registers the optimized segment before dropping the
  superseded segments' data; deletion is intentionally lenient.
- Document the consistency assumptions on SegmentsManifest: it is a
  superset-biased view that may list not-yet-finalized or already-deleted
  segments, which readers must tolerate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 12:51:57 +02:00
Andrey Vasnetsov
d1c5a22975 feat: config reload for read-only segments (#9528)
Add two-phase config reload to `ReadOnlySegment`, alongside the existing
live-reload:

- `config_reload_diff(&self, fs)` re-reads the on-disk config, diffs it
  against the in-memory config, and eagerly loads every new or changed
  component (dense/sparse vector storages, indexes, quantized vectors and
  payload field indexes) under a shared `&self` borrow, so the segment
  keeps serving reads while loading.
- `apply_config_reload(&mut self, diff)` installs the pre-loaded
  components and drops removed ones under `&mut self` — a cheap swap with
  no I/O, so the exclusive borrow is held only briefly.

A vector or field whose config changed is reloaded (drop + load). The
payload-index half lives on `ReadOnlyStructPayloadIndex` with the same
diff/apply split, plus register/unregister helpers for its `has_vector`
storage map.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 11:52:19 +02:00
Andrey Vasnetsov
7b52f04dae refactor: move version() from ReadSegmentEntry to StorageSegmentEntry (#9527)
`version()` is the segment's update version — only meaningful for the
mutable/storage path. Every real caller already reaches it through
`StorageSegmentEntry` (flush), `SegmentEntry` (update), or a concrete
`Segment`/`ProxySegment`; none use it through the read-only base trait.

Move the declaration down to `StorageSegmentEntry` and relocate the
`Segment`/`ProxySegment` impls accordingly. `ReadOnlySegment` no longer
needs it, so drop the method and the write-only `version`/`initial_version`
fields it carried (`live_reload` never refreshed `version`, and neither
field was ever read).

This leaves `ReadSegmentEntry` a clean read-only surface and stops a
read-only segment from exposing a meaningless (stale) version.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 15:05:29 +02:00
Daniel Boros
cea6e9f0cc feat: read-only segment live_reload (#9503)
* feat: immutable field index live_reload

* feat: read-only segment live_reload

* fix: linter

* fix: linter

* fix: review comments

* fix: linter

* feat: ReadOnlyVectorData::live_reload covering all components

Extract the per-vector reload into a dedicated method that destructures
`ReadOnlyVectorData` so storage, index and quantized vectors are all
covered. Adding a field without reloading it won't compile, which guards
against silently skipping a component. The segment orchestrator now just
delegates per named vector.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix: keep id-tracker delta pending until all reloads succeed

ReadOnlySegment::live_reload drained the id-tracker delta (which advances
tracker state and cannot be replayed) and only then ran the fallible
payload/vector reloads. On error the delta was lost, so un-updated
components drifted out of sync permanently.

Accumulate the delta into a new `pending_reload` field and clear it only
once every component has reloaded successfully. On a later reload the
tracker's fresh delta is folded in via `LiveReloadResult::merge` and the
union is replayed, so a partial failure self-heals. Offsets are monotonic,
so the only merge conflict is an inserted-but-unapplied offset later
deleted: it is dropped from `inserted` and kept in `deleted` so a
partially-applied component drops it on replay.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 11:48:40 +02:00
Luis Cossío
1bab9c8e9f Perf improvements for facets (#9457)
* feat(facet): add sampling strategy for high-cardinality fields

For approximate facet queries the current per-segment implementation
walks every distinct value in the field index — O(unique_values_count)
even when the user asks for a tiny top-K. On UUID-style fields with
millions of unique values this dominates the request latency even
after #9208 capped the cross-shard payload.

This commit adds a parallel sampling strategy that runs in O(limit)
instead of O(unique_values_count):

1. Phase 1 — iterative novelty sampling. Stream point IDs in random
   order (filtered if requested), look up each point's value via the
   facet index, and collect distinct values into a candidate set until
   `limit * 10` (min 1000) candidates have been gathered. Uses a
   batch size of 32 to amortise the inner `for_points_values` call,
   and bails out early after 128 consecutive empty batches when the
   long tail is too thin to keep finding novel values.

2. Phase 2 — exact-count post-pass. For each candidate value, compose
   `field == value` with the user filter and count via the payload
   index. This guarantees the returned counts are exact (matching the
   semantics of the full-scan path); only the *set* of returned values
   is approximate.

The two strategies live side by side; `SegmentReadView::approximate_facet`
picks between them per-request based on
`unique_values_count > limit * FACET_FULL_SCAN_FACTOR` (FACTOR = 4).
Below that, the existing scan path runs unchanged — it'd visit most of
the index either way, and the post-pass adds no value.

The Monte-Carlo simulation behind this design (see thread context for
Zipf-distributed fields with cardinality up to 10^5 in ~1000 samples,
and trivially-correct results on UUID-style fields where every value
has count 1.

Adds a new `unique_values_count` method on the `FacetIndex` trait
(implemented for `MapIndex`, `ReadOnlyMapIndex`, `BoolIndex`,
`ReadOnlyBoolIndex`, and the `FacetIndexEnum` dispatcher) so the
strategy switch can run without touching the index.

Co-authored-by: Cursor <cursoragent@cursor.com>

* [AI] simplify, use single file

[AI] better selection of filtering approach

fmt

[AI] simplify, use single file

* manual simplification

* [AI] implement candidate-based lookups

[AI] 🧹

* precollect filter into bitmap

* avoid sampling with restrictive filter

* fix rebase + clippy

* refactor tests

* no duplicate values in map index

* polish comments

---------

Co-authored-by: root <111755117+qdrant-cloud-bot@users.noreply.github.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-19 12:16:30 -04:00
Luis Cossío
8fc7b35d7a Explicit Populate in payload storage (and ` (#9514)
`GridstoreReader`)

- Make the entrypoint of payload storage choose the `Populate` variant
- Mutable payload indexes now populate gridstore blockingly before using
  it to load
- Propagate `Populate` into `flags` module
- Add `UniversalRead::populate_auto` to know whether a backend chooses
  to populate or not when `Populate::Auto`
2026-06-19 08:37:28 -04:00
Tim Visée
b9154713d7 Fix empty min_should with non-zero min_count matching everything (#9401)
* Empty match any with non-zero min count matches nothing

* Update description

* Validate that min_count is greater than 0
2026-06-19 13:28:51 +02:00
qdrant-cloud-bot
8c487a17e8 feat(bm25): explicit Disabled stemmer; deprecate language: "none" hack (#9376)
* feat(bm25): add explicit Disabled stemmer; deprecate language hack

Adds a `Disabled` variant to `StemmingAlgorithm` (`stemmer: {"type": "none"}`)
so stemming can be turned off explicitly in both the main engine and Edge,
instead of relying on the undocumented `language: "none"` footgun that
silently disabled both stemming and stopwords.

For language-neutral text processing the supported setup is now:
1. set the stemmer to disabled, and
2. configure an empty stopword set.

The main engine still tolerates unsupported languages (so existing
`language: "none"` configs keep working on upgrade) but now logs a
deprecation warning pointing users to the explicit setup. Edge continues
to reject unsupported languages, and now has a real way to disable stemming.

Refs: https://github.com/qdrant/qdrant/issues/9289
Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(edge-py): handle Disabled stemmer in python bindings; fix openapi schema

- Handle the new StemmingAlgorithm::Disabled variant in the qdrant-edge-py
  bindings (FromPyObject/IntoPyObject/Repr) and add a DisabledStemmer pyclass
  plus its .pyi stub entry.
- Match generator output for the StemmingAlgorithm OpenAPI schema (plain $ref
  in anyOf) so docs/redoc/master/openapi.json stays consistent.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(openapi): regenerate StemmingAlgorithm schema with generator output

Ran tools/generate_openapi_models.sh so docs/redoc/master/openapi.json
exactly matches generator output: DisabledStemmerParams/NoStemmer are placed
after SnowballLanguage, and the StemmingAlgorithm anyOf entry is a plain $ref
(the schema2openapi step flattens the allOf+description wrapper).

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(test): avoid wildcard enum match arm in bm25 sparse_len helper

clippy --all-targets flags `other => panic!()` as wildcard_enum_match_arm;
match the Dense/MultiDense variants explicitly instead.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix: issues

* fix: log::warn as call once

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Daniel Boros <dancixx@gmail.com>
2026-06-19 13:11:13 +02:00
Daniel Boros
562fa1ba0a feat: immutable field index live_reload (#9502) 2026-06-18 16:32:28 +02:00
qdrant-cloud-bot
ba2bcbdee3 test(model_testing): add basic Query API coverage (#9511)
* test(model_testing): add basic Query API coverage

Add an Op::Query variant that exercises the unified Query API with a
plain Nearest scoring query (ScoringQuery::Vector(QueryEnum::Nearest)),
routed through collection.query. Verification mirrors the existing
Search op: exact dense / multi-dense scans must return exactly the
top-k, sparse and approximate paths are an upper bound, and every
returned id must exist in the model with the queried vector populated
and matching the optional num filter.

Co-authored-by: Cursor <cursoragent@cursor.com>

* test(model_testing): unify Search/Query invariant check

Extract the shared candidate set, strict-vs-upper-bound decision,
per-result membership checks, and the rich diagnostic probes
(retrieve/count/scroll/retry) into helpers reused by both apply_search
and apply_query. apply_query now gets the same strict top-k check plus
failure diagnostics it previously lacked.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 16:25:16 +02:00
Tim Visée
122ef1595c Enable the single_file_mmap_vector_storage flag by default (#9332)
* Enable the `single_file_mmap_vector_storage` flag by default

* Update comment on when flag is enabled by default

* Update OpenAPI spec

* Fix tests
2026-06-18 16:24:03 +02:00
tellet-q
1f161b2e3f feat(model_testing): add --duration-sec to run for a fixed wall-clock time (#9506)
* feat(model_testing): add --duration-sec to run for a fixed wall-clock time

Bound the soak by wall-clock time instead of op count: when --duration-sec is set, the loop runs until the deadline (or Ctrl-C) and --op-num is ignored.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Fix clippy

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 15:28:37 +02:00
qdrant-cloud-bot
35a4c62d96 test(model_testing): add has_vector matcher to generated scroll filter (#9510)
Extend ScrollFilter with a HasVector variant so paginated scroll
exercises Condition::HasVector. The matcher targets an active vector
name, and the model verifier checks it against each point's populated
vector set (which varies via DeleteVectors / partial UpdateVectors),
restricting results to a known, model-checkable subset.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-18 14:57:37 +02:00
Arnaud Gourlay
0b642178e2 Buffer multi-dense offsets store to prevent reload corruption (#9501)
* Buffer multi-dense offsets store to prevent reload corruption

The appendable multi-dense storage flushes its `vectors` and `offsets`
chunked stores independently. Each flusher snapshots its `status.len` at
creation time but msyncs chunk bytes at execution time. A re-upsert that
grows a point past its reserved capacity rewrites the point's `offsets`
entry in place to a freshly-appended row region; if that lands in a
flush's creation-to-execution window, the relocated entry becomes durable
while the `vectors` store's recorded length still predates the rows it
references. On reload that point is unreadable and a WAL append reuses the
rows, clobbering another point.

Wrap the offsets store in a write-back buffer (`BufferedOffsets`) so the
durable offsets can never reference rows beyond the durable `vectors`
length. Offset writes stage in a pending overlay and only land in the
durable store while a flush executes; the flusher snapshots the pending
set at creation time, so any write after that stays buffered for the next
flush. Both flushers snapshot at the same instant, yielding a consistent
durable cut. Rows written after the cut are unreferenced garbage the next
append overwrites. This prevents the skew at the source instead of
patching it on reload, and also closes the residual offsets-length smear.

The buffer follows the Gridstore flusher convention: pending writes live
inside the single lock-guarded store, reads consult the overlay then the
durable bytes under one lock, and the durable msync runs after releasing
the write lock so it never stalls concurrent reads.

Enable the "m" multivector in the collection model test now that its
reload divergence is resolved.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Narrow offsets flush write-lock scope

Build and sort the pending snapshot before taking the write lock; only the
apply + reconcile need it. Shortens the lock hold so concurrent reads block
less. Addresses review feedback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-18 11:49:38 +02:00
Arnaud Gourlay
1fda60b38a perf: use Entry API to avoid redundant map double-lookups (#9500)
* perf: use Entry API to avoid redundant map double-lookups

Replace get_mut/contains_key followed by insert with the entry API
across several maps, collapsing two hash lookups into one. Limited to
sites where the key is Copy or already owned and moved, so no extra
key clone is added to any hot path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* More Entry API usage in mutable_geo_index

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-authored-by: xzfc <xzfcpw@gmail.com>
2026-06-18 09:56:31 +02:00
Daniel Boros
13fb4ade0a feat: ReadOnlySegment::open (S3-verified) (#9466)
* feat: ReadOnlyStructPayloadIndex::open

* use expect instead of allow

* fix: review comments

* fix: read immutable dense vector count through fs

* feat: ReadOnlySegment::open + read-only segment over S3 test

* fix: linter

* rename + TODO

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2026-06-17 21:31:47 +02:00
Daniel Boros
acfb979a6e feat: ReadOnlyStructPayloadIndex::open (#9465)
* feat: ReadOnlyStructPayloadIndex::open

* use expect instead of allow

* fix: review comments

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2026-06-17 18:23:17 +02:00
qdrant-cloud-bot
900e018001 test(model_testing): add has_id matcher to generated scroll filter (#9499)
* test(model_testing): add has_id matcher to generated scroll filter

Extend the ScrollPaged filter selector with a HasId variant so the
generated filter exercises a has_id matcher (restrict to an explicit
point-id set), in addition to the existing none / num / tag filters.

The id set mixes ids present in the model with ids drawn from the id pool
that may not be, so the matcher meaningfully restricts. The model mirrors
it with a set-membership predicate, and the existing paged-scroll
id-set assertion validates the engine result.

Co-authored-by: Cursor <cursoragent@cursor.com>

* chore: fix clippy lints (wildcard_enum_match_arm, from_iter_instead_of_collect)

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(model_testing): clamp has_id sample count to id_pool

Addresses CodeRabbit review: random_distinct_ids could spin forever when
the requested distinct count (up to 15) exceeds id_pool. Clamp to
id_pool.min(15). Only relevant for tiny --id-pool values; the default
pool (500) is far above 15.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 16:04:53 +02:00
xzfc
a1483e87a9 Remove callback-based ConditionChecker (#9487)
* Add BoolConditionChecker

* Add IsEmptyConditionChecker, IsNullConditionChecker

* Add RangeConditionChecker

* Add GeoConditionChecker

* MapIndexRead: move <'a> to the trait level

Reason: avoid repetetive `where N: 'a` in every method

* Add MapConditionChecker

* Add ConstantConditionChecker

* Add FullTextConditionChecker

* Add {Ids,HasVector,Payload}ConditionChecker

* Get rid of fn-based ConditionChecker
2026-06-17 13:10:48 +00:00
qdrant-cloud-bot
1ef71eb354 test(model_testing): cover paginated scroll (offset + limit) (#9497)
Add a ScrollPaged verification op that scrolls the (optionally filtered)
collection in pages of a small limit, following next_page_offset until
exhausted. The other scroll ops always read everything in one page
(offset: None, limit: usize::MAX), so the offset cursor and a real
(non-MAX) limit had no coverage.

Asserts each page holds at most `limit` points, no id repeats across
pages, and the union of all pages equals the model's expected id set for
the chosen filter (none / num == X / tag == X). Includes a page-count
guard against a stuck cursor.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 14:29:21 +02:00
Roman Titov
0fd361571a Fix abort resharding live-lock (#7849) 2026-06-17 13:51:07 +02:00
qdrant-cloud-bot
03c48f1278 test(model_testing): cover with_payload/with_vector selectors (#9495)
Add a RetrieveSelective verification op that exercises the
with_payload/with_vector selector forms, which the soak test previously
never used (every read passed Bool only).

- with_payload covers Bool, Fields, Selector::Include, Selector::Exclude.
- with_vector covers both Bool forms and Selector(names) over a subset of
  active vector names.

The verifier asserts the engine's returned payload equals the model entry
filtered by the engine's own PayloadSelector::process, and the returned
vectors equal the requested name subset that the point actually has
populated.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 12:34:11 +02:00
qdrant-cloud-bot
19c2d0c455 test(model_testing): cover SetPayloadOp.key (#9494)
Add a SetPayloadByKey op to the model_testing soak test so the keyed
set-payload path (SetPayloadOp.key) is exercised. Previously every
set-payload op passed key: None, leaving the key-scoped assignment path
(merge_by_key / JsonPath::value_set) uncovered.

The op samples existing point ids, a random payload, and a single
top-level schema field as the key. The model mirrors the engine via
Payload::merge_by_key (the same JsonPath::value_set the engine's
set_by_key uses), keeping model and engine in lockstep.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-17 11:35:05 +02:00
Tim Visée
463a305404 Add routing token for deterministic read routes (#9338)
* Add routing token structure

* Implement routing token in read operation executor as per design doc

* Add TODO to glue routing token to user requests

* Implement routing header for REST API

* Source routing token from request, not from JWT token

* Implement routing token in gRPC API

* Add test

* Review remarks

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Use lower case header name to prevent panic

* Rename header to X-Qdrant-Route-Affinity

* Assert routing consistency in test on all peers

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-06-17 10:59:46 +02:00
Daniel Boros
b7c913a97d fix: enable disk cache over a network (S3) remote (#9467)
* fix: disk cache maps logical (non-local) remote paths

* feat: derive Clone for BlobFile

* nits

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2026-06-16 22:23:40 +02:00
Daniel Boros
33b448d66d fix: read-only on-disk field index opens are non-writeable (#9468) 2026-06-16 21:47:04 +02:00
xzfc
f257b97356 Move trait ConditionChecker to common (#9486)
* Add DynConditionChecker type alias

* Add DynConditionChecker type alias (point_scorer.rs)

* Move trait ConditionChecker to `common`

Reason: will be used both in `segment` and `sparse` crates.
2026-06-16 19:36:25 +00:00
xzfc
bf1aa818c6 Sparse InvertedIndex: bring back generic methods (#9485)
* sparse InvertedIndex: bring back generics

* nits

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2026-06-16 19:34:42 +00:00
Daniel Boros
24db162dbf fix: BlobFs::list_files honors byte-prefix contract (#9464) 2026-06-16 20:31:18 +02:00
Roman Titov
efc0c7961b Use batched reads in GridstoreView::iter (#9429) 2026-06-16 15:46:26 +02:00
qdrant-cloud-bot
dbcfc1c05a test(model_testing): add dense vector with inline_storage + scalar quantization (#9484)
Add a new named dense vector "i" to the model_testing fixture configured
with HNSW inline_storage backed by scalar quantization, so the soak harness
exercises the inline-storage index layout. It behaves like a normal dense
vector to the model; only the on-disk HNSW layout differs.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 11:57:49 +02:00
Ivan Pleshkov
d9729925cc [TQDT] Wire TQ multivectors storage (#9439)
* multi tq scorers

* add vector storage enum

* Rebase fixes

* Improve scoring

---------

Co-authored-by: jojii <jojii@gmx.net>
2026-06-16 11:52:22 +02:00
qdrant-cloud-bot
a8d7039852 test(turbo): reduce randomized scenarios on Windows to fix SLOW tests (#9483)
The 6 turbo vector storage model tests are flagged SLOW by nextest on
Windows CI (>60s, some >240s):
  - vector_storage::turbo::tests::turbo_model_test_random_ops_{dot,cosine}
  - vector_storage::turbo::multi::tests::turbo_multi_model_test_random_ops_{dot,cosine}
  - vector_storage::turbo::test::congruent_random_ops_{dot,cosine}

These are dim x seed x ops sweeps; Windows runners are several times slower.
Lower SEEDS_PER_CELL on Windows only via #[cfg(windows)] so the runs stay
within the slow-timeout, while keeping full coverage on Linux/macOS.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-16 11:25:03 +02:00
Daniel Boros
179433ae1c refactor: explicit index-type arms for Turbo4 in read-only open (#9479) 2026-06-15 23:02:12 +02:00
Daniel Boros
4d6fb4e0ab feat: add open for read-only sparse vector index (#9435)
* feat: add open for read-only sparse vector index + enum sparse dispatcher

* fix: universal-IO loads for read-only sparse index open

* refactor: rename load_via/open_via to load_universal/open_universal

* refactor: drop StorageVersion::load in favor of load_universal

The regular-IO `load` duplicated `load_universal` over plain `File` IO.
Remove it and route all callers through `load_universal(&MmapFs, ..)`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(sparse): decouple inverted index from concrete storage; split segment_constructor_base (#9461)

Make the read-only index enum generic over storage `S` (no concrete MmapFile),
and remove construction callbacks from the sparse index open paths.

- InvertedIndex is now a pure read/search trait: `open`/`from_ram_index`/
  `type Fs` moved off the trait to inherent methods on each concrete index
  type, so construction no longer requires `S::Fs: Default`.
- SparseVectorIndex open split into a generic `plan` (load-vs-build decision +
  RAM-index build) and generic `finish` (assembly); callers do the concrete
  per-type construction, so no construction callbacks are needed.
- ReadOnlySparseVectorIndex::open takes the already-constructed inverted index
  and caller-loaded config instead of a `load_inverted_index` callback.
- VectorIndexReadEnum is generic over `S: UniversalRead`; sparse mmap variants
  hold `InvertedIndexCompressedMmap<_, S>` rather than a concrete `MmapFile`.
- Split the 1182-line segment_constructor_base.rs into a module (paths,
  vector_storage, payload_storage, id_tracker, vector_index,
  sparse_vector_index, create_segment, segment, legacy_state); the sparse
  dispatcher's match arms collapse into three per-family helpers.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>

* feat: LiveReload (no-op) dispatch for read-only vector index enum (#9436)

---------

Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 22:31:03 +02:00
Daniel Boros
ddb32fed59 feat: live_reload for read-only immutable id tracker + enum dispatch (#9434)
* feat: live_reload for read-only immutable id tracker + enum dispatch

* deleted should be already sorted

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2026-06-15 21:19:54 +02:00
xzfc
3d03dd4752 [UIO] condition checker: fallible checks (#9405)
* condition checker: fallible checks

* Update
2026-06-15 18:11:23 +00:00
Daniel Boros
5980de8b3d feat: add VectorIndexReadEnum open dispatcher (#9428)
* feat: add VectorIndexReadEnum open dispatcher

* review nit

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2026-06-15 16:23:40 +02:00
Luis Cossío
da8a213ee1 Add facets bench (#9456) 2026-06-15 09:29:12 -04:00
qdrant-cloud-bot
4c169d571c build(deps): bump pyo3 from 0.28.3 to 0.29.0 (#9462)
Bumps [pyo3](https://github.com/pyo3/pyo3) from 0.28.3 to 0.29.0.
- [Release notes](https://github.com/pyo3/pyo3/releases)
- [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md)
- [Commits](https://github.com/pyo3/pyo3/compare/v0.28.3...v0.29.0)

---
updated-dependencies:
- dependency-name: pyo3
  dependency-version: 0.29.0
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-06-15 11:22:11 +02:00
Daniel Boros
d669a08c2b feat: add open to read-only HNSW index (#9427)
* feat: add open to read-only HNSW index

* fix: dedicated universal-IO load for read-only graph

* fix: report actual graph residency in read-only is_on_disk

* refactor: rename load_via to load_universal

* refactor: unify graph links loading on universal IO

Replace the dual GraphLinks load paths (regular mmap + universal IO) with a
single universal-IO loader, and the `Mmap` GraphLinksEnum variant with a
`Universal` variant that keeps a type-erased `UniversalRead` handle alive
behind `Box<dyn GraphLinksStorage>` (UniversalRead is not object-safe).

- GraphLinksEnum::from_storage picks the variant from UniversalKind:
  borrowable (mmap-backed) kinds stay `Universal`, others are materialized
  into `Ram`, so the borrowability invariant in GraphLinksStorage::bytes
  holds by construction.
- Loading takes a `Populate` parameter, derived from `hnsw_config.on_disk`:
  on_disk -> Populate::No (lazy), otherwise Populate::Blocking.
- is_on_disk is reported from config again instead of the enum variant.
- Split graph_links.rs into a graph_links/ module (format, vectors, storage,
  links, tests) with a relationship diagram in mod.rs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor: drop LoadOption in favor of a Populate parameter

After unifying the link load paths on universal IO, LoadOption only encoded a
populate choice with a fs that was always MmapFs. Replace it with a `Populate`
argument to GraphLayers::load, removing the enum, its constructors, the
load_links helper, and the unused generic backend.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 09:19:58 +02:00
Ivan Pleshkov
47767d19fd unpadded rotations (#9450) 2026-06-12 22:24:23 +02:00
qdrant-cloud-bot
bc12ea174f Lower default update queue length from 1M to 200 (#9448)
Reduce the default in-RAM update worker queue size to limit memory
held by pending operations and provide faster backpressure.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-12 13:56:45 +02:00
Jojii
eb0ef2a9d8 [TQDT] TurboMultiVectorStorage (#9414)
* TurboQuant Datatype for Multivectors

* Fix update_from and add non-appendable open()

* Fix unnecessary allocations + wrap chunk boundaries

* Congruence tests TurboVectorStorage <-> TurboMultiVectorStorage(vecs=1)

* Only use appendable backend for turbo4-multivectors

* Simplify update_from

* Never place multivectors across chunk boundaries (skip tail, reject oversized)

* Review remarks
2026-06-12 12:03:17 +02:00
Daniel Boros
7f76e12b77 feat: read-only immutable id tracker open + enum open dispatcher (#9433) 2026-06-12 12:01:15 +02:00
Daniel Boros
96954f5d73 feat: add open to read-only plain vector index (#9426) 2026-06-12 11:35:59 +02:00
Arnaud Gourlay
598094fef6 Introduce Collection model testing (#9072)
* Collection model testing

* Jemalloc

* don't generate multivectors for now

* add unit test

* more tests

* make WInDowSS happy
2026-06-12 11:27:39 +02:00