Commit Graph

393 Commits

Author SHA1 Message Date
Arnaud Gourlay
bf564a40cf Improve timeout logic for Telemetry (#7607)
* Improve timeout logic for Telemetry

* assert!

* fix misuses of StoppinGuard

* decrease timeout for each shard
2025-11-27 16:43:56 +01:00
Tim Visée
6467931915 Add a user agent to HTTP clients (#7623)
* Add user agent to add HTTP clients

* Move user agent constant to defaults.rs
2025-11-26 18:59:21 +01:00
Tim Visée
e630cf59fa Bump dev version to 1.16.2-dev (#7604) 2025-11-25 15:01:34 +01:00
Tim Visée
fca10199b4 Actively migrate away from RocksDB for vector/payload storage and index (#7551)
* Actively migrate away from RocksDB for vector/payload storage and index

* Update OpenAPI spec
2025-11-18 11:18:46 +01:00
Tim Visée
77cd5962c2 Bump dev version to v1.16.1-dev (#7548) 2025-11-17 15:45:10 +01:00
Tim Visée
1b6e52554a Audit all spawn blocking calls, prematurely abort them (#7533)
* Prematurely abort blocking task in `spawn_cancel_on_drop` on drop

These tasks are intended to be cancellable. Now we prematurely abort the
task if the future was dropped before the task is executed.

* Prematurely abort blocking task in `spawn_cancel_on_token` on cancel

These tasks are intended to be cancellable. Now we prematurely abort the
task if the cancellation token is triggered before the task is executed.

* Prematurely abort blocking task for fetching telemetry

* Prematurely abort stoppable task on drop, all are safe to abort early

* Make `move_dir` either move everything, or nothing at all

That is with the exception of file IO errors in which case data may be
partially moved.

Before this PR it was possible for the new target directory to be
created without moving all data into it. Now we either do all, or
nothing.

* Prematurely abort task for creating full snapshot

It is fine to either create it, or not at all.

* Prematurely abort blocking task for waiting on consensus leader

* Prematurely abort blocking cardinality estimation and shard info tasks

* Prematurely abort blocking point deduplication task

* Prematurely abort blocking task for checking available disk space

* Prematurely abort blocking shard read operations

All shard read operations, such as retrieve, scroll, facets and more can
be safely aborted prematurely.

Related to: <https://github.com/qdrant/qdrant/pull/7530>

* Prematurely abort blocking task for waiting on replica state

* Prematurely abort blocking task for waiting on transfer replica states

* Prematurely abort blocking task for loading segment

This can safely be aborted before the task is started

* Prematurely abort blocking task waiting for replica states

* Prematurely abort blocking task for creating snapshot file

Safe because it aborts before writing any snapshot files to disk
2025-11-14 13:29:06 +01:00
Andrey Vasnetsov
ccabe47a08 more stop flags (#7531)
* add stopflag check into query_points of payload index

* propagate stopflag more

* fmt

* bench: compare better against no atomic

* use stoppable iter with IteratorExt

* clippy

* Add cancelled error helper

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
Co-authored-by: timvisee <tim@visee.me>
2025-11-14 10:58:04 +01:00
Jojii
f6b715bd62 Metrics for snapshots (#7497)
* Add atomic counter for running snapshots

* Refactor collection telemetry + export prometheus metric

* Handle collection in ToC + current recovery measurements

* Fix openapi tests

* Fix tests

* Add snapshot metrics for streaming and partial snapshots.

* Fix typo in metrics name

* Adjust metrics names

---------

Co-authored-by: timvisee <tim@visee.me>
2025-11-11 15:00:11 +01:00
Ivan Pleshkov
86918bc6bb Enable appendable quantization by default (#7508)
* enable appendable quantization by default

* update openapi
2025-11-10 13:25:31 +01:00
Tim Visée
3581c1bee9 Bump dev version to v1.15.6-dev (#7477) 2025-10-30 10:45:49 +01:00
Tim Visée
2b59214907 Skip RocksDB for mutable payload index and payload storage (#7433)
* For mutable payload index, don't create with RocksDB anymore

* For payload storage, don't create with RocksDB anymore

* Add missing dot

* Update OpenAPI spec
2025-10-29 17:36:37 +01:00
Jojii
c890d3aaa9 Add unindexed vectors to telemetry and metrics API (#7307)
* New metric for excluded vectors in indexed_only requests

* Make metric name align with prometheus naming convention

* Fix nit

* Fix tests

* Fix openapi

* Rename index_only into indexed_only

---------

Co-authored-by: timvisee <tim@visee.me>
2025-10-29 16:44:02 +01:00
Jojii
f2c012732e Currently running optimizers in Metrics (#7316)
* Currently running optimizer count in metrics

* Clearly state the prerequisites of count_optimizers_running()

* Minor improvements

* improve metric naming
2025-10-23 10:45:59 +02:00
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