Commit Graph

330 Commits

Author SHA1 Message Date
Andrey Vasnetsov
02de826748 fix segment repair on load (#7400)
* fix segment repair on load

* workaround for rocksdb

* Minor comment tweaks

* In in memory ID tracker, unset version first before dropping mapping

* rename cleanup_versions into fix inconsistencies

---------

Co-authored-by: timvisee <tim@visee.me>
2025-10-14 14:06:50 +02:00
dependabot[bot]
ec6089c0ca build(deps): bump flate2 from 1.1.2 to 1.1.4 (#7349)
Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.1.2 to 1.1.4.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/compare/1.1.2...1.1.4)

---
updated-dependencies:
- dependency-name: flate2
  dependency-version: 1.1.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-07 09:35:14 +02:00
xzfc
a0d62330c7 Use fs-err (#7319) 2025-09-29 12:47:10 +00:00
dependabot[bot]
ae0e4e4305 build(deps): bump anyhow from 1.0.99 to 1.0.100 (#7287)
* build(deps): bump anyhow from 1.0.99 to 1.0.100

Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.99 to 1.0.100.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.99...1.0.100)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-version: 1.0.100
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* Inline formatting argument

---------

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>
2025-09-23 10:30:52 +02:00
Andrey Vasnetsov
e86d60e6b0 slow requests log (#7188)
* wip: generalization trait for queries

* implement generalization for point operations

* fmt

* log priority queue

* wip: SlowRequestsListener

* fmt

* fix clippy

* simplify generalization

* fmt

* implement collection of requests profiles for update API

* implement API for viewing slow requests log

* add collection name to update worker

* add datetime to log

* fmt

* probabilistic counter of unique requests

* rename

* compute hash before converting into json value

* move logable out of generalizable

* fmt

* log query request

* fmt

* some fixes

* move measurement into local shard

* fmt

* upd openapi (not important)

* For enum variants, has discriminant

* Make SearchParams Copy

* Hash 0.0 and -0.0 the same

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

* Correctly hash enum variants and float values

* Hash through ordered float instead

* Fix priority queue not keeping longest request for hash

* SearchParams implements Copy

* Fix clippy warning

* Add unordered_hash_unique

* skip serialization if none

* Use OrderedFloat for hashing a float

* Use OrderedFloat for hashing a float

* only log updates if they are performed

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: xzfc <xzfcpw@gmail.com>
2025-09-19 19:59:25 +02:00
Andrey Vasnetsov
dbe71d44a8 Fix missing flush, flush before sync (#7263)
* add missed flush buffer

* For all BufWriters, wrap owned type and explicitly flush

---------

Co-authored-by: timvisee <tim@visee.me>
2025-09-16 10:34:12 +02:00
Arnaud Gourlay
360d7bc26d Clippy 1.90 (#7253)
* Fix Clippy 1.90

* fmt
2025-09-15 20:12:11 +02:00
xzfc
3c9e36fa0b Limit concurrent calls to load_segment (#7233)
* Limit concurrent calls to `load_segment`

* Use StreamExt::buffer_unordered
2025-09-11 13:57:24 +02:00
dependabot[bot]
f833e10dd5 build(deps): bump thread-priority from 2.1.0 to 3.0.0 (#7225)
Bumps [thread-priority](https://github.com/iddm/thread-priority) from 2.1.0 to 3.0.0.
- [Release notes](https://github.com/iddm/thread-priority/releases)
- [Changelog](https://github.com/iddm/thread-priority/blob/master/CHANGELOG.md)
- [Commits](https://github.com/iddm/thread-priority/commits/v3.0.0)

---
updated-dependencies:
- dependency-name: thread-priority
  dependency-version: 3.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-09 10:24:18 +02:00
xzfc
3baa7d9d7d HNSW: use new graph format during search (#7195)
* point_scorer: generic `Filters` -> non-generic `ScorerFilters`

point_scorer: rename FilteredQuantizedScorer -> FilteredBytesScorer

* Use ScorerFilters when appropriate

* {CustomQueryScorer,MetricQueryScorer}: SupportsBytes = True

* Add GraphLayersWithVectors::search_with_vectors

* Use GraphLayersWithVectors::search_with_vectors in HNSWIndex::search_with_graph

* Move `BoxCow` and `SimpleCow` to a common module

* Review remarks
2025-09-04 11:48:26 +00:00
Ivan Pleshkov
33837423e9 Enable BQ in appendable segments (#7145)
* Create and load for an appendable quantization

remove feature flag

more todo

review remarks

review remarks

* fix after rebase

* Enable BQ in appendable segments

* remove const placeholder

* fix after rebase

* fix after rebase

* fix config mismatch optimizer

* fix sq infinity loop

* add comment
2025-09-03 13:56:32 +02:00
Tim Visée
094fb02e6e Revert "Fix flaky save_on_disk test race condition (#7126)" (#7182)
* Revert "Fix flaky save_on_disk test race condition (#7126)"

This reverts commit 80f0b53cea.

Related flakiness reports:
- https://github.com/qdrant/qdrant/issues/7156
- https://github.com/qdrant/qdrant/issues/7181

* Fix comment
2025-09-01 10:51:23 +02:00
Tim Visée
894692919c Remove chunked mmap vectors mlock flag (#7165) 2025-08-28 15:40:13 +02:00
Fabrício Bracht
80f0b53cea Fix flaky save_on_disk test race condition (#7126)
* fix flaky save_on_disk tests with barrier synchronization

* apply suggestions from coderabbitai bot

* fix timeout in test_wait_for_multiple_notifications

* add TEST_IO_SLACK for disk write latency in tests

* make concurrent readers count explicit in test

* relax timing assertions and use timeout variable for consistency

* refactor wait_for to use deadline-based loop to prevent false timeouts

* fix stale variable name in comment

* relax immediate test timing bound to reduce CI flakes

* add overflow protection for deadline calculation

* apply "checked_sub here and unwrap" suggestion

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* track remaining time instead of deadline to avoid overflow issues

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-08-27 10:55:25 +02:00
Tim Visée
931b467dde Bump dev version to v1.15.5-dev (#7154) 2025-08-27 10:54:15 +02:00
xzfc
f2ce816fbe Add memory::madvise::will_need_multiple_pages() (#7124) 2025-08-25 09:22:11 +00:00
Andrey Vasnetsov
5235d86435 measure disk size of directories if available (#7120)
* measure disk size of directories if available

* review suggestions

* Update comment

---------

Co-authored-by: xzfc <xzfcpw@gmail.com>
2025-08-25 00:17:27 +02:00
xzfc
95d7936687 Graph links serializer: avoid large intermediate allocations (#7118)
* Introduce io::file_operations::atomic_save

* Replace GraphLinksSerializer with serialize_graph_links
2025-08-22 17:08:35 +00:00
Roman Titov
0bfa8f61d5 Move SaveOnDisk into common crate (#7105) 2025-08-20 17:06:47 +02:00
dependabot[bot]
599a6e42ad build(deps): bump anyhow from 1.0.98 to 1.0.99 (#7099) 2025-08-20 10:07:30 +00:00
xzfc
acfdf02da8 Optional scorer methods via TBool (#6989)
* Add common::typelevel module

* Use common::typelevel for score_bytes

* Revert "Split FilteredScorer into FilteredScorer and FilteredQuantizedScorer"

This reverts commit ff3a93ee95.

* FilteredQuantizedScorer

* Extract `struct Filters` from `FilteredScorer` and `FilteredQuantizedScorer`

* Revert "QuantizedVectors::query_scorer_bytes"

This reverts commit 9dee824afd.

* Partial revert "Add QueryScorerBytes::score_bytes"

This reverts commit d80af4f698, but keeps
the QueryScorerBytes trait while removing implementations.

* Partial revert "Add EncodedVectorsBytes::score_point_vs_bytes"

This partially reverts commit c741e42f9a.
- trait `EncodedVectorsBytes` and its implementations: reverted/removed
- calls to `EncodedVectorsBytes::score_point_vs_bytes`: replaced with
  calls to `EncodedVectors::score_bytes`

* Remove unused method FilteredScorer::new_from_raw
2025-08-18 14:40:12 +00:00
Tim Visée
60cf81fa64 Bump dev version to v1.15.4-dev (#7062) 2025-08-14 15:57:43 +02:00
Tim Visée
8c1a01724f Bump dev version to v1.15.3-dev (#7014) 2025-08-12 13:45:34 +02:00
xzfc
079ef6fb13 Implement GraphLinksFormat::CompressedWithVectors (#6982)
* Simplify graph_links tests

* Rstest-ify hnsw_index::tests::test_save_load

* Rename EncodedVectorsU8::{get_quantized_vector => get_quantized_vector_offset_and_code}

Reason: it was inconsistent with other implementations of
get_quantized_vector().

* Add QuantizedVectors::{get_quantized_vectors, get_quantized_vector_layout}

* Rename `links_map` to `for_each_link`

* pack_links: expose the updated `raw_links` order

* TestRawScorerProducer: support quantization

* Make GraphLinksSerializer::new return Result

* Rename links/compressed_links into `neighbors`

* Implement GraphLinksFormat::CompressedWithVectors

* GraphLayersWithVectors

* bitpacking: add packed_links_size

* Reorder neighbors: N__VVVVVVVcccccccccc -> Ncccccccccc__VVVVVVV
2025-08-11 17:28:43 +00:00
Roman Titov
8be5e1b07f Refactor Collection::restore_shard_snapshot (#6988) 2025-08-06 17:48:04 +02:00
Arnaud Gourlay
255dd51e5a Fix Clippy 1.89 (#6981) 2025-08-05 18:06:04 +02:00
Kumar Shivendu
76cc63359d Bump dev version to 1.15.2-dev (#6955)
* Bump dev version to 1.15.2-dev

* Updated cargo.lock

* Trigger CI
2025-07-29 22:26:24 +05:30
xzfc
9bd506d4f7 Introduce StableHash (#6940)
* Introduce StableHash

* Use SipHasher24 explicitly
2025-07-26 21:25:56 +00:00
Andrey Vasnetsov
6fdf445570 UUID index bug (#6916)
* reproduce bug as unit test

* reproduce in even faster unit test

* fix alignment in mmap_hashmap

* clippy

* review fixes
2025-07-22 20:26:35 +02:00
xzfc
a959e8a671 MADV_POPULATE_READ on sequential mmaps (#6923) 2025-07-22 14:05:07 +02:00
Tim Visée
b81e81c1f8 Fix checkfs in MUSL builds (#6903) 2025-07-20 16:15:50 +02:00
Arnaud Gourlay
1362563c2c Bump thread-priority 2.1.0 (#6885) 2025-07-16 17:14:06 +02:00
Tim Visée
8b38f3a831 Adjust feature flag descriptions (#6875) 2025-07-15 15:31:37 +02:00
Tim Visée
70477eb5a9 Enable migration from RocksDB to mutable ID tracker by default (#6872)
* Enable migration from RocksDB to mutable ID tracker by default

We planned to enable this by default in the Qdrant 1.15.0 release.

* Synchronize enable at version TODOs for other flags with planning

* Update OpenAPI spec
2025-07-15 13:34:28 +02:00
Tim Visée
cd045b2e7d Naive migration of payload indices from RocksDB to Gridstore (#6810)
* Add function to detect if storage is using RocksDB

* Add feature flag to toggle payload index migration

* Add naive payload index migration, rebuild from scratch if RocksDB

* Adjust payload index rebuild logs

* When rebuilding payload indices, clean up existing storages

* Update OpenAPI spec

* Use weak references to Gridstore in mutable payload index flushers

* Rework payload index clear/wipe functions, make them consistent

* Naively migrate RocksDB before loading indices

* Fix mmap payload index load, staged like others (#6837)

* Add staged loading of mmap numeric payload index

* Add staged loading of mmap map payload index

* Add staged loading of mmap geo payload index

* Add staged loading of mmap full text payload index

* Add staged loading of mmap bool and null payload index

* Minor tweaks

* Don't fail clearing file cache if file does not exist

---------

Co-authored-by: jojii <jojii@gmx.net>
2025-07-14 13:26:18 +02:00
Andrey Vasnetsov
c964beee71 add flag to break optimization loop on panic (#6787)
* WIP: add flag to break optimization loop on panic

* notification on manual budget change only

* move check for disk size before creting a temp segment
2025-07-03 17:54:06 +02:00
Andrey Vasnetsov
3bd7ba423b Optimize detect when primary condition is sufficient review (#6794)
* Optimize payload filtering to avoid redundant matching

* No boxing

* review suggestions

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2025-07-03 13:00:46 +02:00
Tim Visée
488f13a93a Actively migrate payload storage from RocksDB to Gridstore (#6734)
* Migrate RocksDB based payload storage into Gridstore

* Add migrate_rocksdb_payload_storage feature flag

* Minor tweaks

* Use iter to migrate all payloads

* Fix clippy warning

* Update OpenAPI spec

* Track if mmap payload storage is populated, set memory/disk storage type

* Add test

* Log amount of bytes we migrate instead of point count

* Remove TODO

* Render storage size migrated in human human readable format, not bytes

* On migration failure, drop full payload storage directory

* Fix missing import
2025-06-30 16:22:38 +02:00
Tim Visée
393dd6f5cf Add in-memory payload storage on Gridstore (#6722)
* Add in-ram-mmap payload storage type

* When RocksDB is not compiled, select in-ram mmap payload storage

* Enable payload storage on-disk check again in config mismatch optimizer

* Add feature flag to build in-ram-mmap payload storage

* Tweak is_on_disk condition

* Bump version estimates in runtime feature flags
2025-06-25 14:37:45 +02:00
xzfc
706571d8b4 Configurable HNSW healing threshold (#6756) 2025-06-25 10:22:18 +00:00
Tim Visée
5e1728dadd Add validation for legacy collection names (#6752)
* Add function for validating legacy collection names

* Apply legacy collection name validation everywhere

* Add more validation to gRPC endpoints

* Adjust tests
2025-06-24 20:02:40 +05:30
Andrey Vasnetsov
8792f51d0c check filesystem on start (#6682)
* check filesystem on start and do some simple mmap test to make sure it is persisted

* fmt

* fix fs type read on non-linux

* feature-flag for fs-check supported platforms + fs check with sub-folder

* fmt

* try larger magic file

* minor fixes

* fix compile on windows

* Add FAT, exFAT and APFS file systems

* Update lib/common/memory/src/checkfs.rs

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

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
2025-06-16 18:12:59 +02:00
Tim Visée
fd4dba96f2 Expose runtime feature flags in telemetry (#6667)
* Expose runtime feature flags in telemetry

* Update OpenAPI spec
2025-06-11 11:36:01 +02:00
dependabot[bot]
85e260e31b build(deps): bump flate2 from 1.1.1 to 1.1.2 (#6659) 2025-06-09 21:06:25 +00:00
Tim Visée
5b92f84238 Migrate away from RocksDB based sparse vector storage (#6607)
* Reformat

* Add function to find appendable sparse storage files without opening it

* Actively migrate away from RocksDB based sparse vector storage

* Add test for simple sparse vector storage migration

* Fix test comments

* Also migrate vector deletes for sparse storage

* Use walkdir to list files
2025-06-06 17:09:14 +02:00
Tim Visée
b9fa7a5103 Migrate away from RocksDB based multi dense vector storage (#6604)
* Add function to open all multi dense vector storage types

* Move list files function into common crate

* Add function to find appendable multi dense storage files without opening it

* Actively migrate away from RocksDB based multi dense vector storage

* Add test for simple multi dense vector storage migration

* Also migrate vector deletes for multi dense storage
2025-06-06 09:16:36 +02:00
Tim Visée
fe49cd89e3 Add mutable numeric payload index on top of Gridstore (#6609)
* Extend Gridstore blob trait, support basic primitives and vector of them

* Implement mutable numeric index on top of Gridstore

* Wrap Gridstore in rwlock, flush asynchronously

* Set custom Gridstore options tuned to numeric index

* Fix compilation errors

* Destruct RocksDB selector everywhere

* Add Gridstore payload index selector, build numeric, fallback others

* Add feature flag to Gridstore mutable payload index

* Don't store empty values in gridstore, it's not supported

* Reformat

* Initialize Gridstore during init of index builder

* Use owned and referenced paths correctly around Gridstore

* Change Gridstore page size in numeric index as suggested

* Make Gridstore block size dependent on size of numeric type

* Add tests

* Add separate fixed size blob trait for vec, prevent footgun

* Improve page size calculation

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>

* Simplify Blob requirement for numeric payload index

* Add missing test cases

* Replace ref mut with &mut

* Use correct hardware counter

* Implement clear cache for numeric payload index on Gridstore

* The block size is dynamic

* Error if trying to load index from storage that doesn't match backend

* fix counter

* Add comment on why we change page size

---------

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2025-06-05 09:10:56 +02:00
Tim Visée
3fc51c69b0 Migrate away from RocksDB based dense vector storage (#6603)
* Add function to open all appendable dense vector storage types

* Add function to find appendable dense storage files without opening it

* Add function to migrate RocksDB dense vector storage into mmap

* Add feature flag and actively migrate on load

* Log number of migrated points

* Add function to open all simple dense vector storage types

* Add test for simple dense vector storage migration

* Use correct column families

* Use more generic feature flag

* Also migrate vector deletes

* Fix review remarks
2025-06-04 17:40:13 +02:00
dependabot[bot]
aba512fd3d build(deps): bump num_cpus from 1.16.0 to 1.17.0 (#6630)
Bumps [num_cpus](https://github.com/seanmonstar/num_cpus) from 1.16.0 to 1.17.0.
- [Release notes](https://github.com/seanmonstar/num_cpus/releases)
- [Changelog](https://github.com/seanmonstar/num_cpus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/num_cpus/compare/v1.16.0...v1.17.0)

---
updated-dependencies:
- dependency-name: num_cpus
  dependency-version: 1.17.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-03 12:21:44 +02:00
Tim Visée
a39b54b82a Actively migrate away from RocksDB based ID tracker (#6579)
* Actively migrate RocksDB ID tracker to new format on segment load

* Extract ID tracker migration logic to function

* Feature flag ID tracker migration

* Simplify ID tracker migration by moving it deeper into load function

* Move migrate function to the bottom

* Add test to assert RocksDB to mutable ID tracker migration

* Assert new mutable ID tracker is empty

* Review remarks

* On RocksDB to mutable ID tracker migration failure, clean up files

* Demote empty mutable ID tracker to debug assertion

* Copy all point versions, including deleted, set known mappings

* read links and versions separatelly

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-05-27 11:36:11 +02:00