Commit Graph

3618 Commits

Author SHA1 Message Date
tellet-q
94de0e2d2d Log full transfer info on aborting a shard transfer (#8345) 2026-03-10 09:57:18 +01:00
Ivan Pleshkov
4b9b39c596 Use predefined deferred ID (#8329)
* Adjust points selection for deferred points update

* adjust proxy segment implementation

* simplify

* use simpler proxy impl

* stick to Entry API

* renaming to stay closer to the original

* two passes and simpler impl.

* fmt

* fmt

* use predefined deferred internal id

* calculate deferred point id

* move deferred check to the entry

* fix after rebase

* fmt

* fix tests

* review remarks

* fix tests

* codespell fix

* are you happy clippy

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2026-03-10 02:17:20 +01:00
qdrant-cloud-bot
7e15d343c2 Introduce EdgeShardConfig for edge shard (#8322)
* Introduce EdgeShardConfig for edge shard

- Add EdgeShardConfig and EdgeOptimizersConfig in lib/edge/src/config.rs
  - Segment config (vector_data, sparse_vector_data, payload_storage_type)
  - Global hnsw_config and per-vector HNSW in segment config
  - Optimizer params: deleted_threshold, vacuum_min_vector_number,
    default_segment_number, max_segment_size, indexing_threshold,
    prevent_unoptimized (excludes memmap_threshold, flush_interval_sec,
    max_optimization_threads)
- Persist/load as edge_config.json in shard path
- EdgeShard uses RwLock<EdgeShardConfig>; load() accepts Option<EdgeShardConfig>,
  falls back to file or infer from segments; compatibility checked on load
- load_with_segment_config() for backward compatibility (SegmentConfig -> EdgeShardConfig)
- optimize() uses EdgeShardConfig for hnsw and optimizer thresholds
- Public methods: set_hnsw_config(), set_vector_hnsw_config(), set_optimizers_config()
  (update and persist)
- Python and examples use load_with_segment_config with existing config API

Made-with: Cursor

* Refactor EdgeShardConfig: user-facing params only, config module

- Replace SegmentConfig inside EdgeShardConfig with user-facing fields:
  - on_disk_payload (bool) instead of payload_storage_type
  - vectors: HashMap<VectorNameBuf, EdgeVectorParams> with on_disk per vector,
    no per-vector quantization; global quantization_config only
  - sparse_vectors: HashMap<VectorNameBuf, EdgeSparseVectorParams> with on_disk
- EdgeVectorParams / EdgeSparseVectorParams use on_disk (bool) instead of
  storage_type; conversion to VectorDataConfig/SparseVectorDataConfig in
  to_segment_config()
- Add config module: mod.rs, optimizers.rs, vectors.rs, shard.rs
- from_segment_config(&SegmentConfig) fills all inferrable params
- to_segment_config() builds SegmentConfig for segments and optimize()
- load_with_segment_config takes Option<SegmentConfig>, uses from_segment_config

Made-with: Cursor

* Move optimizer threshold helpers to shard crate

- Add get_number_segments, get_indexing_threshold_kb, get_max_segment_size_kb,
  get_deferred_points_threshold_bytes in shard::optimizers::config
- Collection OptimizersConfig and edge EdgeOptimizersConfig delegate to these
- Single place for threshold logic; collection and edge use shard helpers

Made-with: Cursor

* Use destructuring in config conversions to avoid missing new fields

- EdgeVectorParams: destructure VectorDataConfig in from_*, destructure self in to_vector_data_config
- EdgeSparseVectorParams: destructure SparseVectorDataConfig and SparseIndexConfig in from_*, destructure self in to_sparse_vector_data_config
- EdgeShardConfig: destructure SegmentConfig in from_segment_config, destructure self in to_segment_config
Adding new fields to source structs will now cause compile errors until conversions are updated.

Made-with: Cursor

* refactor: centralize on_disk_payload→payload_storage_type, on_disk→storage_type, and appendable quantization logic

- PayloadStorageType::from_on_disk_payload(bool) in segment (Mmap/InRamMmap)
- VectorStorageType::from_on_disk(bool) in segment (ChunkedMmap/InRamChunkedMmap)
- QuantizationConfig::for_appendable_segment(Option<&Self>) in segment (feature flag + supports_appendable)
- collection: use from_on_disk_payload in non-rocksdb branch
- edge shard/vectors: use new helpers; remove duplicated conditionals
- shard optimizers: use from_on_disk and for_appendable_segment

Made-with: Cursor

* refactor(edge): use EdgeShardConfig directly, drop segment_config

- Add plain_segment_config() for create_appendable_segment (no HNSW)
- Add segment_optimizer_config() built from EdgeShardConfig for blocking optimizers
- Add vector_data_config(name) for query/MMR
- build_blocking_optimizers: use segment_optimizer_config() instead of SegmentConfig
- create_appendable_segment: use plain_segment_config()
- search/query: use config().vectors and vector_data_config() instead of segment_config()
- Remove segment_config() from EdgeShardConfig and EdgeShard
- Add to_plain_vector_data_config on EdgeVectorParams

Made-with: Cursor

* [manual] review changes

* refactor(edge-py): wrap EdgeShardConfig, add EdgeVectorParams/EdgeSparseVectorParams

- PyEdgeConfig now wraps EdgeShardConfig (vectors, sparse_vectors, on_disk_payload, etc.)
- PyEdgeVectorParams / PyEdgeSparseVectorParams wrap edge config types
- PyEdgeOptimizersConfig for optional optimizer settings
- EdgeShard.load() uses EdgeShardConfig; edge::config made pub for Python crate
- cargo fmt + clippy (remove map_identity)

Made-with: Cursor

* refactor(edge-py): simplify config API, remove unused Py* types, add EdgeConfig

- Remove unused PyPayloadStorageType, PyVectorDataConfig, PyVectorStorageType,
  PySparseVectorDataConfig, PySparseVectorStorageType from Python bindings
- Move PyEdgeOptimizersConfig to lib/edge/python/src/config/optimizers.rs
- Update qdrant_edge.pyi: EdgeConfig with vectors/sparse_vectors,
  EdgeVectorParams, EdgeSparseVectorParams, EdgeOptimizersConfig
- Update examples (common.py, repr.py) to use new config API
- Run cargo fmt

Made-with: Cursor

* [manual] review changes

* [manual] review changes

* [manual] fix test

* Address CodeRabbit review comments for PR 8322 (#8324)

* Address CodeRabbit review comments for PR 8322

- Python examples: explicit imports (repr.py, common.py) and new EdgeConfig API
- HnswIndexConfig: add max_indexing_threads param and property in .pyi and Rust bindings
- EdgeConfig: make vectors optional for sparse-only configs; validate at least one of vectors/sparse_vectors
- EdgeShardConfig::load: use try_exists(), propagate I/O errors
- from_segment_config: infer hnsw_config from per-vector HNSW when all agree
- EdgeShard setters: atomic clone-mutate-save-then-replace; persist config save errors
- Segment compat: prefix vector name in error messages; resolve None datatype to Float32
- max_indexing_threads: preserve 0 (auto) sentinel in trait default; remove per-optimizer overrides
- SegmentOptimizerConfig:🆕 build plain and optimizer maps in single pass
- config_mismatch_optimizer tests: use VectorNameBuf::from() instead of .into()
- vectors.rs: doc updates for per-vector quantization

Made-with: Cursor

* Address @generall review: SaveOnDisk for config, resolve num_rayon_threads in optimizer

- Use SaveOnDisk<EdgeShardConfig> for EdgeShard config (generall: 'We have SaveOnDisk struct for this')
  - Create via SaveOnDisk::new() after resolving config; setters use .write() for atomic persist
  - set_vector_hnsw_config: clone then mutate then write (fallible setter)
- max_indexing_threads: resolve 0 (auto) via num_rayon_threads inside impl (generall: 'proper solution would be to resolve num_rayon_threads inside the optimizer impl')
  - max_indexing_threads_sentinel_aware() now returns Some(num_rayon_threads(raw)) so callers get actual thread count

Made-with: Cursor

* [manual] reorganize num_rayon_threads -> get_num_indexing_threads to better account per-vector configuration

---------

Co-authored-by: Cursor Agent <agent@cursor.com>
Co-authored-by: generall <andrey@vasnetsov.com>

* update docstring and pyi

* fmt

* fmt

* clipy

---------

Co-authored-by: Cursor Agent <agent@cursor.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2026-03-10 00:10:04 +01:00
Luis Cossío
9c6b23346d Rename to StoredPointToValues (#8302)
* rename trait

* rename MmapPointToValues -> StoredPointToValues

* fmt

* more explicit naming of trait functions
2026-03-09 11:56:56 +01:00
xzfc
b7fc4b6fdc Update Readmes/manifest for qdrant-edge Rust package (#8316) 2026-03-09 10:21:40 +00:00
Arnaud Gourlay
0fc5bbfcbc Do not delete source when CoW deferred points (#8290) 2026-03-09 10:58:15 +01:00
Arnaud Gourlay
43b94d27d5 Adjust points selection for deferred points update (#8279)
* Adjust points selection for deferred points update

* adjust proxy segment implementation

* clean

* simplify

* use simpler proxy impl

* cleanup

* stick to Entry API

* renaming to stay closer to the original

* renaming to stay closer to the original

* nits

* two passes and simpler impl.

* fmt

* fmt

---------

Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>
2026-03-09 10:05:27 +01:00
Anas Limem
69b9253797 fixed the logging and removed outdated comments (#8327) 2026-03-08 17:40:37 +01:00
qdrant-cloud-bot
b3a6cba0ff Make edge crate submodules private (#8319)
Change pub mod to mod for count, facet, info, optimize, query,
retrieve, scroll, search, snapshots, and update in lib/edge.
The public API (EdgeShard, ShardInfo) is unchanged.

Made-with: Cursor

Co-authored-by: Cursor Agent <agent@cursor.com>
2026-03-07 00:00:13 +01:00
xzfc
61e046f80e Synchronize Rust and Python edge examples (#8312) 2026-03-06 19:17:15 +00:00
Luis Cossío
c7eadf49de Refactor PointToValues to use UniversalRead (#8298)
* refactor PointToValues to use UniversalRead

It includes a significant change to `MmapValue` trait to be able to
handle Cow reads, instead of just references.

* fix str parsing

* fix incorrect path

* use fallible casting

* clippy

* No eager allocation

this also makes it so that borrowed strs can keep happening :heart-eyes:

* Lifetime cleanup

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2026-03-06 16:11:13 -03:00
Daniel Boros
d4cb6a58d9 feat/edge segment opt (#8224)
* feat: add edge shard optimize

* feat: refactor edge optimize logic

* chore: remove unused &self

* feat: add more tests

* fix: linter

* fix: missing threshold prop

* fix: local nightly version

* fix: linter

* fix: linter issues

* fix: use of explicit from

* feat: add some notes

* fix: feature_flags call once

* [manual] review refactor

* fix:
- default_segment_number -> move shard
- rename: default_hnsw_config -> hnsw_config
- infer existing hnsw_config

* feat: add optimize to python

* feat: add python optimize example

* feat: add hnsw config load tests

* fix: linter

* feat: make unified build config

* fix: linter

* fix: openapi definition'

* fix: review comments

* fix: remove mut self & reset_temp_segments_dir

* fix: linter

* review: rename for simpler public name + use explicit strucuture deconstruction

* clipy

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2026-03-06 18:47:15 +01:00
qdrant-cloud-bot
d7ad2d45f7 fix: codespell 2.4.2 - pre-selected -> preselected, pre-select -> preselect (#8303)
* fix: codespell 2.4.2 - pre-selected -> preselected, pre-select -> preselect

Fixes CI failure with codespell 2.4.2 which flags hyphenated forms.
Updated in: types.rs, query/mod.rs, qdrant.rs, points.proto

Made-with: Cursor

* chore: regenerate OpenAPI spec (tools/generate_openapi_models.sh)

Updates oversampling description to use preselected spelling.

Made-with: Cursor

---------

Co-authored-by: Cursor Agent <agent@cursor.com>
2026-03-06 11:47:16 +01:00
Roman Titov
d53c712c50 IoUringFile based on universal I/O interface (#8292) 2026-03-05 18:19:37 +01:00
xzfc
4ea3190c65 Fix edge examples (#8295)
* amalgamate.py: replace `env!("CARGO_PKG_VERSION")`

Otherwise segment thinks it's v0.0.0 which breaks examples.

* Fix lib/edge/python/examples/repr.py

It it broken by d9393acac6 (#7933), which renamed `SegmentConfig` →
`EdgeConfig` and removed `index` parameter from `VectorDataConfig` by
hardcoding it to `Plain`.

Before:

    $ python lib/edge/python/examples/repr.py
    NameError: name 'SegmentConfig' is not defined

After:

    $ python lib/edge/python/examples/repr.py
    EdgeConfig(vector_data={"": VectorDataConfig(size=128, ...)}, ...)

* gitignore output of Rust edge examples

* Restore `lib/edge/python/examples/.gitignore`

I'm not sure why it's removed in 65312a1e82e6ae4d/#7522.

* Add `prepare_facet_snapshot.sh` for `facet_test.rs`

The script is based on steps mentioned in #8045.

* Remove `edge-cli.rs` example

It was added in 895318913afbad4a/#7140 and seems incomplete.
2026-03-05 10:10:43 +00:00
xzfc
628195fafe Remove shard dependency on api (#8284)
* Move `DenseVector`/`MultiDenseVector` from `api` to `segment`

* Move `OrderByInterface` from `api` to `segment`

Reason: it's used in `edge` which shouldn't depend on `api`.

* Make `shard` -> `api` dependency optional

* Remove `api` from the amalgamation

* Don't install protoc in edge Actions
2026-03-05 04:38:02 +00:00
Andrey Vasnetsov
7083e7f2b6 gridstore live reload (#8287)
* [manual] live reload functions for gridstore-read

* [AI] tests for life reload

* fmt

* Address CodeRabbit review (PR 8287)

- gridstore/mod: acquire pages read lock once in files() loop
- universal_io/mmap: use fs_err::exists() to propagate IO errors
- pages: fix live_reload last_page_id underflow when pages is empty

Made-with: Cursor

* review changes

* thx coderabbit

---------

Co-authored-by: Cursor Agent <agent@cursor.com>
Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2026-03-04 18:30:21 +01:00
Andrey Vasnetsov
aff0ba9669 fix(segment): use div_ceil() to satisfy clippy::manual_div_ceil on Rust 1.94 (#8291)
Replace manual ceiling division (next_multiple_of/div) with div_ceil()
in points_in_storage_count. Fixes clippy with cargo +beta clippy
--workspace --all-targets --all-features -- -D warnings.

Made-with: Cursor

Co-authored-by: Cursor Agent <agent@cursor.com>
2026-03-04 17:15:59 +01:00
Andrey Vasnetsov
77b296d579 storage-backend dependent file listing (#8286) 2026-03-04 14:18:58 +01:00
Luis Cossío
a7e78730a6 [gridstore] simplify page range calculation (#8285)
* simplify page range calculation

* smol fix

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2026-03-03 16:17:03 -03:00
dependabot[bot]
dda856a4ec build(deps): bump tango-bench from 0.6.0 to 0.7.2 (#8272)
* build(deps): bump tango-bench from 0.6.0 to 0.7.2

Bumps [tango-bench](https://github.com/bazhenov/tango) from 0.6.0 to 0.7.2.
- [Release notes](https://github.com/bazhenov/tango/releases)
- [Commits](https://github.com/bazhenov/tango/compare/v0.6.0...v0.7.2)

---
updated-dependencies:
- dependency-name: tango-bench
  dependency-version: 0.7.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix benchmark compilation error

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: timvisee <tim@visee.me>
2026-03-03 14:50:50 +01:00
Andrey Vasnetsov
b6c1987038 MultiFile Universal UI in gridstore pages (#8256)
* [manual] implement Pages for read-only

* Simpler `ReadMulti`/`WriteMulti` interface (#8263)

* [manual] Dumbify `ReadMulti`/`WriteMulti` interface

* fixup! [manual] Dumbify `ReadMulti`/`WriteMulti` interface

🤷‍♀️

* fixup! [manual] Dumbify `ReadMulti`/`WriteMulti` interface

Remove `VecMultiUniversalIo`

* [manual] review fix + silplify json load option

* [AI] split read and write + revome *Multi traits

* [AI] implement write for pages

* [AI] integrate pages into gridstore

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2026-03-03 14:50:44 +01:00
dependabot[bot]
328a6d8819 build(deps): bump cgroups-rs from 0.3.4 to 0.5.0 (#8270)
* build(deps): bump cgroups-rs from 0.3.4 to 0.5.0

Bumps [cgroups-rs](https://github.com/kata-containers/cgroups-rs) from 0.3.4 to 0.5.0.
- [Release notes](https://github.com/kata-containers/cgroups-rs/releases)
- [Commits](https://github.com/kata-containers/cgroups-rs/compare/v0.3.4...v0.5.0)

---
updated-dependencies:
- dependency-name: cgroups-rs
  dependency-version: 0.5.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix: use cgroups_rs::fs API for cgroups-rs 0.5 compatibility

Made-with: Cursor

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Cursor Agent <agent@cursor.com>
2026-03-03 14:50:28 +01:00
Tim Visée
eb28989fad Improve point deduplication loop (#5590)
* Replace deduplication binary heap with kmerge

* Rework deduplication finding, chunk point IDs and only keep highest

* Simplify point group iterator

* Add benchmark

* Fix tests, reverse version

* Reformat
2026-03-03 14:46:29 +01:00
xzfc
8710de88b1 Qdrant edge rust fixes (#8277)
* amalgamate.py: specify encoding="utf-8"

For legacy platforms that still default to cp1252.

* amalgamate.py: use `shutil.which`

In case if `ast-grep` is a cmd wrapper.

* amalgamate.py: write rules to temporary file

Windows runner don't like inline-rules.

* amalgamate.py: Add decription to package

Required for publishing to crates.io.

* amalgamate.py: package build scripts for `common` and `segment`

Also, add more comments.

* amalgamate.py: keep generated module order deterministic

Not an issue, but nice to have. Suggested by CodeRabbit.

* edge-rust-release.yml: also check on arm machines

* edge-rust-release.yml: Use cargo build instead of cargo check

To catch linker errors.

* edge-rust-release.yml: disable fail-fast (for easier debugging)

* edge-rust-release.yml: add --no-verify to cargo publish

The previous job `edge-rust-check` already builds it, no need to build
it again in the `publish` job.
2026-03-03 11:08:16 +00:00
xzfc
13df41e823 Workflow to publish qdrant-edge on crates.io (#8260)
* [ai] Workflow to publish qdrant-edge on crates.io

* Doc, tune Cargo.toml
2026-03-02 22:57:36 +00:00
Andrey Vasnetsov
9b344197a5 feat(universal_io): MultiUniversalRead trait and VecMultiUniversalRead implementation (#8255)
* feat(universal_io): add MultiUniversalRead trait and VecMultiUniversalRead impl

- Add SourceId, MultiUniversalRead<T> trait with read_batch_multi, source_len,
  populate, clear_ram_cache (latter two with default no-op).
- Add UniversalIoError::InvalidSourceId for invalid source id in batch reads.
- Add VecMultiUniversalRead<T, S>: minimal implementation over Vec<S: UniversalRead<T>>
  with attach(source) -> SourceId for adding sources at runtime.
- Add test vec_multi_universal_read_batch_and_attach using MmapUniversal.
- Handle InvalidSourceId in segment OperationError From<UniversalIoError>.

Implements the interface and minimal mmap-based implementation from
docs/design/multi-file-universal-io-plan.md (multi-source universal I/O).

Made-with: Cursor

* refactor(universal_io): move multi-source interface to separate file, drop plan from PR

- Add universal_io/multi_universal_read.rs with SourceId, MultiUniversalRead,
  VecMultiUniversalRead and test; re-export from mod.rs.
- Remove docs/design/multi-file-universal-io-plan.md from the branch.

Made-with: Cursor

* refactor(universal_io): require populate/clear_ram_cache; add new, attach, len, is_empty to trait

- MultiUniversalRead: remove default impls for populate() and clear_ram_cache();
  they are now required.
- Add to trait: new(), len(), is_empty() (default), attach() (default Err).
- Introduce associated type Source for attach; add AttachUnsupported<T>
  placeholder for impls that do not support dynamic attach.
- VecMultiUniversalRead: type Source = S; implement all trait methods.
- Re-export AttachUnsupported from universal_io.

Made-with: Cursor

* refactor(universal_io): remove AttachUnsupported; require attach for all impls

- Drop AttachUnsupported placeholder type and its UniversalRead/Send impls.
- Make attach() a required method on MultiUniversalRead (no default).
- Doc: all implementations must support attaching sources dynamically.
- Remove AttachUnsupported from re-exports.

Made-with: Cursor

* refactor(universal_io): attach by path, new(options), split vec impls, add MultiUniversalWrite

MultiUniversalRead:
- Remove type Source; attach(path, options) opens by path and returns SourceId.
- new(options: OpenOptions) for creating an empty multi-source view.
- Move VecMultiUniversalRead to vec_multi_universal_read.rs.

MultiUniversalWrite (new):
- Trait: new(options), len(), is_empty(), attach(path, options),
  write_batch_multi((SourceId, offset, data)...), source_len, flusher(),
  populate(), clear_ram_cache().
- VecMultiUniversalWrite in vec_multi_universal_write.rs; flusher()
  runs all source flushers.

Re-export MultiUniversalWrite, VecMultiUniversalWrite from universal_io.

Made-with: Cursor

* universal_io: MultiUniversalWrite extends MultiUniversalRead

Make MultiUniversalWrite<T>: MultiUniversalRead<T> like UniversalWrite
extends UniversalRead. Remove duplicated methods (new, len, is_empty,
attach, source_len, populate, clear_ram_cache) from the write trait;
keep only write_batch_multi and flusher. VecMultiUniversalWrite now
impl MultiUniversalRead and MultiUniversalWrite separately.

Made-with: Cursor

* [manual] final fixes

---------

Co-authored-by: Cursor Agent <agent@cursor.com>
2026-03-02 18:19:56 +01:00
Andrey Vasnetsov
13ded7ab14 feat(gridstore): migrate Tracker to universal IO (#8253)
* feat(gridstore): migrate Tracker to universal IO

- Tracker<S> generic over S: UniversalRead<u8> + UniversalWrite<u8>
- Replace MmapSlice<u8> with S; use S::open, read, write, flusher, populate
- On file growth: flush, create_and_ensure_length, re-open S
- Map UniversalIoError::NotFound to tracker file missing error
- get_raw returns Result<Option<Option<ValuePointer>>>; get returns Result<Option<ValuePointer>>
- has_pointer, unset, write_pending return Result where needed
- flusher returns crate::gridstore::Flusher (universal_io Flusher mapped to GridstoreError)
- Type alias Tracker = Tracker<MmapUniversal<u8>> in lib.rs
- Tests use TestTracker = Tracker<MmapUniversal<u8>>; mapping_len/mmap_file_size .unwrap()

Made-with: Cursor

* refactor(gridstore): review follow-ups – generic view, From conversion, iter errors

- GridstoreView: use Tracker<S> with same S as Page (S: UniversalRead + UniversalWrite)
- Tracker: use ? and .map_err(Into::into) instead of .map_err(GridstoreError::from)
- View iter: propagate tracker read errors via Err(e) instead of silently skipping

Made-with: Cursor

* Split Tracker into read/write impl blocks; GridstoreView only requires UniversalRead

- Tracker: impl<S> for files/pointer_count, impl<S: UniversalRead<u8>> for
  get/get_raw/iter_pointers/has_pointer/populate and test helpers,
  impl<S: UniversalRead+UniversalWrite> for new/open/write_pending/set/unset
  and other write methods (like Page).
- GridstoreView: require S: UniversalRead<u8> only so read-only views don't
  need UniversalWrite.

Made-with: Cursor

* Move Tracker::open to read-only impl; add FILE_NAME/tracker_file_name to unbound impl

open() only uses S::open and storage.read(), so it belongs in impl<S: UniversalRead<u8>>.
read_config_and_tracker can thus use a read-only tracker open. FILE_NAME and
tracker_file_name moved to unbound impl so both read and write sections use them.

Made-with: Cursor

---------

Co-authored-by: Cursor Agent <agent@cursor.com>
2026-03-02 18:03:59 +01:00
Andrey Vasnetsov
82c49df611 feat(universal_io): add read_whole and read_json_via for config files (#8251)
* feat(universal_io): add read_whole and read_json_via for config files

- Extend UniversalRead with read_whole() for single-access whole-file read
- Default impl uses len() + read(0..len()); MmapUniversal overrides with one slice
- Add UniversalIoError::SerdeJson for JSON deserialization errors
- Add read_json_via<S,T>(path, options) in common::universal_io
- Gridstore: use read_json_via for config in read_config_and_tracker
- Segment: use read_json_via in ChunkedVectors::load_config, handle NotFound
- Segment: extend From<UniversalIoError> for OperationError with SerdeJson variant

Made-with: Cursor

* feat(universal_io): add UniversalIoError::NotFound for file-not-found

- Add NotFound { path } variant so callers can match without io::ErrorKind
- MmapUniversal::open maps io::ErrorKind::NotFound to NotFound { path }
- ChunkedVectors::load_config matches NotFound => Ok(None)
- OperationError From<UniversalIoError> handles NotFound

Made-with: Cursor

* style: apply cargo fmt

Made-with: Cursor

* fix(common): satisfy clippy explicit_auto_deref in read_json_via

Use &bytes instead of &*bytes; auto-deref handles Cow

Made-with: Cursor

---------

Co-authored-by: Cursor Agent <agent@cursor.com>
2026-03-02 16:38:17 +01:00
Arnaud Gourlay
15be52f122 Introduce Segment API point_is_deferred (#8259)
* Introduce Segment API point_is_deferred

* improve everything

* cheaper implementation

* explicit conversions

* test reopening segment

* test unify logger
2026-03-02 14:39:09 +01:00
Ivan Pleshkov
30cf43382b Deferred threshold integration (#8246)
* Deferred threshold integration

* update deferred id

* apply update_deferred_internal_id

* fix segment inspector

* use avaliable bytes count

* renamings

* review remarks

* review remarks

* move has_deferred_points

* remove todo

* update comments
2026-03-02 09:57:19 +01:00
generall
730439a62a new formatter rules 2026-02-28 23:21:07 +01:00
Luis Cossío
9444b0f07e Gridstore iter: re-fix livelock (#8248)
* release read locks after every batch

* break infinite loop

* oopsie
2026-02-27 22:02:35 +01:00
Luis Cossío
5403ea68ab Chunked vectors with UniversalWrite storage (#8233)
* use CowMultiVector as return type from storages

* add advice to OpenOptions

* Implement ChunkedVectors with generic storage

* rename ChunkedVectors->VolatileChunkedVectors and ChunkedMmapVectors-> ChunkedVectors

* propagate everywhere

fix tests

* [auto] rename BytesRange -> ElementsRange

* [auto] rename BytesOffset -> ElementOffset

* coderabbit nits

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2026-02-27 12:47:15 -03:00
krapcys1-maker
3ddf6234e1 test(segment): stabilize building cancellation timing assertions (#8243)
Co-authored-by: local-user <local-user@local>
2026-02-27 13:08:35 +01:00
Andrey Vasnetsov
7084b5dd91 read write gridstore (#8244)
* [WIP] read and write separattion

* Introduce GridstoreView which contains ephermal representation of data and implements search functions

* fmt

* hide test-only method + add missing file

* fmt

* [AI] do not Copy config

* review nits

* thx coderabbit

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2026-02-26 21:57:40 +01:00
Luis Cossío
21890d2738 use Cow<'_, [T]> as return type in dense vector storages (#8221)
* use `Cow<'_, [T]>` as return type in vector storages

* extract complex type

* clippy

* improve maybe_uninit_fill_from

* don't commit to graphlinks yet
2026-02-26 13:30:21 -03:00
Sapphire
ada810896a Optimize ImmutablePointToValues: inline single-value points to reduce RAM usage and increase performance (#8235)
* optimize: performance improve

* Optimize ImmutablePointToValues to store single values inline

- Replace PointMeta with PointValueEntry enum to distinguish single vs
  multi-value points
- Store single values directly in point_entries, reducing container
  overhead
- Only multi-value and empty points use the shared values_container
- Update all methods and tests to use new representation
- Add tests for edge cases and single-value optimizations

* Explicit branch for zero sized value

* Update comment

* Remove zero count branch as it appears to make it slightly slower

---------

Co-authored-by: 1995chen <chenl2448365088@gmail.com>
Co-authored-by: timvisee <tim@visee.me>
2026-02-26 16:44:45 +01:00
Arnaud Gourlay
3da9e949d7 Decrease Quickcheck test count for WAL on Windows (#8229) 2026-02-26 10:10:43 +01:00
Andrey Vasnetsov
03c0fa2cf7 Universal IO: gridstore pages (#8223)
* [manunal] Gridstore page use universal IO

* fmt

* Apply review feedback for universal IO gridstore pages (#8230)

* Apply review feedback from PR #8223

- Use `super::Result` import in mmap.rs instead of fully-qualified `crate::universal_io::Result`
- Restructure ValuePointer destructuring in get_value and delete_value to
  first match Some(pointer), then destructure separately

* Replace Either<E, GridstoreError> with E: From<GridstoreError> in Gridstore::iter

Use a trait bound instead of Either to combine callback and gridstore
errors, allowing `?` to work directly on GridstoreError. This simplifies
callers by removing Either matching and io::Error conversion workarounds.

---------

Co-authored-by: qdrant-claw <qdrant-claw@users.noreply.github.com>

---------

Co-authored-by: qdrant-claw <qdrant-claw@users.noreply.github.com>
2026-02-25 19:46:00 +01:00
Arnaud Gourlay
b91b3017da Remove unused dependencies (#8226) 2026-02-25 15:42:11 +01:00
krapcys1-maker
a93fa46532 [snapshot] Avoid leaving replicas in recovery state when shard data is absent (#8179)
* snapshot

* snapshot recovery: remove stale state read in revert guard
2026-02-25 15:38:41 +01:00
krapcys1-maker
2ae58b9b8f fix(collection): close snapshot checksum file before reading (#8219)
Co-authored-by: local-user <local-user@local>
2026-02-25 14:15:13 +01:00
dependabot[bot]
18a7587d4b build(deps): bump rand_distr from 0.5.1 to 0.6.0 (#8148)
* build(deps): bump rand_distr from 0.5.1 to 0.6.0

Bumps [rand_distr](https://github.com/rust-random/rand_distr) from 0.5.1 to 0.6.0.
- [Release notes](https://github.com/rust-random/rand_distr/releases)
- [Changelog](https://github.com/rust-random/rand_distr/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand_distr/compare/0.5.1...0.6.0)

---
updated-dependencies:
- dependency-name: rand_distr
  dependency-version: 0.6.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Migrate main code base to rand 0.10

* Migrate tests

* Migrate benches

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: timvisee <tim@visee.me>
2026-02-25 14:15:04 +01:00
krapcys1-maker
200675741d fix(segment): guard min_should estimator edge cases (#8217)
Co-authored-by: local-user <local-user@local>
2026-02-25 11:07:34 +01:00
krapcys1-maker
6ee43a2b0f fix(collection): stabilize hw metrics cancellation test (#8218)
Co-authored-by: local-user <local-user@local>
2026-02-25 10:26:31 +01:00
Luis Cossío
4c3b4b8bc7 Fix unused self lint in macos (#8215)
* expect unused self

* Update lib/wal/src/mmap_view_sync.rs

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2026-02-24 18:59:01 -03:00
Luis Cossío
e28543a604 use UniversalRead in ImmutableDenseVectors (#8210)
* use UniversalRead in ImmutableDenseVectors

...renamed from MmapDenseVectors

* remove madvise arg

* async_raw_scorer
2026-02-24 13:55:16 -03:00
xzfc
28d9c5be12 Single edge crate (#8173)
* Fixups of amalgamator

Fix issues that break `qdrant-edge` build process:
- `use … as segment;` - this causes `ast-grep` rules to replace wrong
  paths. So, rename to avoid collisions.
- `#[macro_use]` and `extern crate` required be in the top-level
  `lib.rs`.
- `format!("…", crate::something::…)` - `ast-grep` can't fix paths
  inside macros. Fixed by moving `crate::something::…` out of the macro.

* Add lib/edge/publish workspace and amalgamation script

* Move `lib/edge/examples` into `lib/edge/publish/` workspace

And fix them to use the generated `qdrant-edge` crate.

* Add github workflow

* Cleanup `qdrant-edge` public API

Removes empty modules. Checked by `cargo doc`.
2026-02-24 16:43:59 +00:00
Ivan Pleshkov
6382d1a7d2 remove rocksdb from gpu tests (#8211) 2026-02-24 16:17:26 +01:00