571 Commits

Author SHA1 Message Date
Daniel Boros
b47fa7d1ee fix: timeout tests (#8591) 2026-04-02 12:57:32 +02:00
Tim Visée
f5e005c45c Wait for resharding to finish on all peers (#8585) 2026-04-01 13:38:40 +02:00
Arnaud Gourlay
3f57eb0345 Bump Python CI test deps (#8582) 2026-04-01 11:43:43 +02:00
qdrant-cloud-bot
623db4c2a5 build(deps): bump cryptography from 46.0.5 to 46.0.6 in /tests (#8569)
Bumps [cryptography](https://github.com/pyca/cryptography) from 46.0.5 to 46.0.6.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/46.0.5...46.0.6)

Made-with: Cursor

Co-authored-by: Cursor Agent <agent@cursor.com>
2026-04-01 10:19:32 +02:00
Andrey Vasnetsov
6f2e19a43a Skip audit logging for telemetry endpoints (#8571)
* Skip audit logging for telemetry endpoints

Telemetry access checks (telemetry_memory, telemetry_requests,
telemetry_cluster, cluster_telemetry) fire on every metrics scrape and
produce very noisy audit logs with no security-relevant signal.

Switch all telemetry callers to use `auth.unlogged_access()` to bypass
audit logging, consistent with the existing metrics and prepare_data
handlers that already did this.

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

* trigger CI

* feat: add some tests

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Daniel Boros <dancixx@gmail.com>
2026-03-31 22:29:18 +02:00
xzfc
0b0df145b3 Drop RocksDB (#8529)
* Skip broken tests

* Add rocksdb dropper

This is a temporary tool. It will be removed later in this PR.

* [automated] Drop rocksdb

This commit is made by running tools/rocksdb/drop.sh

* Touch-up after ast-grep

The previous automated commit removed items, but not their comments.
Also, some blocks are left with only one item.
Also, ast-grep can't handle macros like `vec![]`.

This commit completes the job.

* Remove RocksDB dropper

* Remove mentions of rocksdb feature in CI

* Fix clippy warnings

These `FIXME` comments added previously in this PR by ast-grep by
"peeling" cfg_attr like this:

    -#[cfg_attr(not(feature = "rocksdb"), expect(...))]
    +#[expect(...)] // FIXME(rocksdb): ...

This commit removes these allow/expect attributes and fixes clippy
lints.

* Remove leftover rocksdb-related code

Removed:
- Cargo.toml: rocksdb cargo feature flag and dependencies.
- code: rocksdb-related items that was not under feature flag.
- flags.rs: rocksdb-related qdrant feature flags.

Disabled:
- Some benchmarks because these do not compile now.

* Print warning if rocksdb leftovers found in snapshots

* Remove Clone from tokenizer

* Regenerate openapi.json
2026-03-31 18:08:39 +00:00
Daniel Boros
974fcb63c7 Feat/storage api over universal io (#8311)
* feat: add storage_read_service proto definition

* feat: update qdrant tonic definition

* feat: add list_files

* feat: add read_bytes

* feat: add read_bytes_stream

* feat: add read_batch & read_whole api

* feat: add read_multi

* fix: mod.rs

* feat: update resolve_path

* feat: add path resolve

* feat: add more tests and fix stream api

* feat: better error handling

* feat: add collection_base_path

* fix: potential EOF error

* fix: nested runtime panic on tests

* fix: github actions

* fix: auth tests

* fix: coderabbit pr review

* fix: linter

* fix: clippy

* fix: range validation and path resolve

* fix: linter

* fix: clippy

* fix: clippy

* fix: universal io error

* fix: incoming changes

* fix: compiler error

* feat: spilt impl

* fix: pr review

* fix: linter

* fix: dev changes

* fix: linter

* review fixes

* fmt

* chore: fix naming

* fix: pr reviews

* fix: rebase dev

* fix: clippy

* fix: tests

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2026-03-29 23:08:16 +02:00
Arnaud Gourlay
bef8d42174 Fix flaky test_shard_transfer_includes_deferred_points (#8528) 2026-03-28 12:48:36 +01:00
Arnaud Gourlay
8525016450 Test resharding up/down with deferred points (#8502)
* Test resharding down with deferred points

* clean

* test resharding up as well

* delete and fixes

* Moved the cleanup step between commit_read_hashring and commit_write_hashring.
2026-03-27 12:48:29 +01:00
Bhagirath Kapdi
fb704e5d13 Feature/strict mode search max batchsize (#8469)
* feat: add search_max_batchsize to strict mode config

* added test case for search_max_batchsize

* Changes for fixing CI issue dure openapi

* Modify check_strict_mode_batch

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2026-03-26 16:26:09 +01:00
qdrant-cloud-bot
424bc2c265 Enable async_scorer in integration tests (#8487)
* Enable async_scorer in integration tests

Enable `async_scorer=true` for all openapi and shell-based integration
tests by setting the environment variable in `integration-tests.sh`.
This exercises the io_uring vector storage path (on Linux) across all
vector configurations tested there, with graceful fallback if io_uring
is unavailable on the CI runner.

Made-with: Cursor

* Scope async_scorer to test_points_search consensus test only

Revert the blanket async_scorer=true from integration-tests.sh to keep
the normal mmap path covered. Instead, enable it via extra_env in just
the test_points_search consensus test, so we exercise the io_uring path
without losing coverage of the non-io_uring path on Linux.

Made-with: Cursor

* Parametrize test_points_search for sync/async scorer modes

Use pytest.mark.parametrize to run test_points_search twice: once with
the default scorer (sync_scorer) and once with async_scorer=true. This
exercises both the normal mmap and io_uring paths in a single test.

Made-with: Cursor

---------

Co-authored-by: Cursor Agent <agent@cursor.com>
2026-03-23 18:08:55 +01:00
Arnaud Gourlay
8179c3bec0 Test all shard transfer methods for deferred points (#8447)
* Test all shard transfer methods for deferred points

* WAL delta carries deferred points

* add point count assertions

- snapshot: asserts target_visible == source_visible — deferred state preserved exactly
- stream_records: asserts target_visible >= source_visible — points may not be deferred on target
2026-03-23 18:07:54 +01:00
Excellencedev
3230f1d952 Implement Per collection metrics for Promethus (#8214)
* Implement Per-Collection Prometheus Metrics

* Update config/config.yaml

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

* Update tests/per_collection_metrics_test.sh

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

* Update tests/per_collection_metrics_test.sh

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

* fix ci

* comment

* Update tests/per_collection_metrics_test.sh

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

* adress revew

* fix: linter

* refactor: cardinality limit, anonymize fix, cleanup

- Add max_per_collection_metrics config (default 256) to bound
  per-collection label cardinality
- Fix anonymize: strip per_collection_responses entirely instead of
  leaking hashed collection names
- Move CollectionName into requests_telemetry, remove
  telemetry_context.rs
- Add unit tests for cardinality limits
- Add integration test assertions for default mode
- Regenerate OpenAPI spec
- Document why internal gRPC doesn't attach CollectionName

* avoid cloning

* fix: address pr reviews

* fix: linter

* fix: linter

* feat: enforce {name} in actix api

* chore: remove empty line

* feat: add actix pre-commit hook

* feat: potential enforce tonic collection name

* feat: use proc_macro instead

* feat: use collection_name instead of name

* feat: add tonic telemetry tests

* fix: linter

* fix: linter

* chore: remove unneccessary clone

* fix: use collection_name everywhere

* fix: python tests and openapi

* chore: simplify collection_name tests

* actix collection_name enforcign: use relative path in test + avoid grep

* fix: remove macro

* chore: add some comment to telemetry_wrapper

* fix: clippy

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Daniel Boros <dancixx@gmail.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2026-03-23 15:19:02 +01:00
Tim Visée
8b1ca256f5 Allow peer to bootstrap with used URI if empty (#8301)
* [ai] Allow peer to bootstrap with existing URI if peer has no shards

Prompt:

I have a Qdrant cluster in distributed mode with some nodes registered
in consensus. If I bootstrap a new node with an URL that is already used
it is rejected and an error is returned. I would like to change this
behavior and allow this to happen. This would effectively replace a peer
because internally we'd drop the existing peer first, and then we'd add
the new peer so we can reuse the same peer URL. We must still reject
bootstrapping with the same URL if the peer that used the URL before us
still has any shards on it.

* [ai] Add test to assert new behavior, can rejoin if empty

Prompt:

Add two tests to assert the new behavior.

The first test should:
- create a cluster
- create a collection
- bootstrap a new peer
- kill and delete the local data for this peer without removing it from consensus
- bootstrap a new peer but reuse the URI of the peer we just killed to rejoin
- bootstrapping is expected to succeed

The second test should:
- create a cluster
- create a collection
- bootstrap a new peer but reuse the URI of the last node
- bootstrapping is expected to fail because the node being replaced has data on it

* [ai] Attempt to fix new tests

* Reformat

* [ai] Fix deadlock when rejoining with same peer URI

* [ai] Add test to ensure existing peer stops consensus on replace
2026-03-23 09:59:49 +01:00
Jojii
356040312b Correct calculation of deferred point counts (#8366)
* Don't account for deferred points in some places

# Conflicts:
#	lib/collection/src/shards/local_shard/scroll.rs

* Add in QueryContext

* Cover more places

* Coderabbit review remarks

* Properly count amount of deleted deferred points (#8386)

* Properly count amount of deleted deferred points

* Prevent double-counting of the same point

* Remove hints to estimations

* Properly handle counts in ProxySegment

* Add tests and fix deleted point count issue

* Adjusts tests + fix issues

* Separte fields for deferred points in telemetry (SegmentInfo)

* Remove deferred_points_count()

* openapi

* Fix test by manually calculating visible points

* Adjust ProxySegment test to revertion of SegmentInfo

* Throw error if collection was not found in telemetry (e2e Test)

* Update lib/segment/src/segment/segment_ops.rs

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>

* Make new fields in API optional

* Don't take range if no deferred point exist

* Review remarks

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2026-03-19 11:33:09 +01:00
tellet-q
b10d1b9ebd Add a test for dirty shard crashloop (#8440)
* Add a test for dirty shard crashloop
2026-03-19 11:15:36 +01:00
qdrant-cloud-bot
f6acad5086 chore: upgrade test dependencies (#8442)
Run `uv --project tests lock --upgrade` to update all test dependencies
to their latest compatible versions.

Updated packages:
- certifi: 2026.1.4 -> 2026.2.25
- charset-normalizer: 3.4.4 -> 3.4.6
- google-api-core: 2.29.0 -> 2.30.0
- google-auth: 2.48.0 -> 2.49.1
- googleapis-common-protos: 1.72.0 -> 1.73.0
- graphql-core: 3.2.7 -> 3.2.8
- hypothesis: 6.151.6 -> 6.151.9
- numpy: 2.4.2 -> 2.4.3
- pyasn1: 0.6.2 -> 0.6.3
- pyjwt: 2.11.0 -> 2.12.1
- pytest-cases: 3.9.1 -> 3.10.1
- qdrant-client: 1.16.2 -> 1.17.1
- werkzeug: 3.1.5 -> 3.1.6
- yarl: 1.22.0 -> 1.23.0

Removed:
- rsa: 4.9.1 (no longer needed by google-auth)

Made-with: Cursor

Co-authored-by: Cursor Agent <agent@cursor.com>
2026-03-18 11:32:08 +01:00
Arnaud Gourlay
c28966dcda Fix update worker hanging in deferred wait loop on config change (#8410)
* Fix update worker hanging in deferred wait loop on config change

* stop ignoring test

* handle timeout

* don't ack deferred points barrier when optimizer channel fails

* WIP: error handelling

* WIP: fmt

* cleanup

* propagate update status

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2026-03-18 10:59:35 +01:00
Arnaud Gourlay
8ca480e635 Ignore failing deferred points test during investigation (#8411) 2026-03-16 11:41:11 +01:00
Arnaud Gourlay
09c0ad6fb4 Fix timeout in test_shard_snapshot_transfer_deferred (#8398)
* Fix timeout in test_shard_snapshot_transfer_deferred

* more specific exception net

* set client timeout explicitly
2026-03-13 23:42:26 +01:00
qdrant-cloud-bot
84df573e59 Add consensus test for deferred points in snapshot shard transfer (#8393)
* Add consensus test for deferred points in snapshot shard transfer

Verify that deferred points (those beyond the indexing threshold in
appendable segments) are included when performing a shard transfer
with the snapshot method, and become visible after optimization on
both source and target nodes.

Made-with: Cursor

* fix

---------

Co-authored-by: Cursor Agent <agent@cursor.com>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2026-03-13 17:21:56 +01:00
Arnaud Gourlay
9074b9640b Integration test for deferred points (#8365)
* Integration test for deferred points

* test facets

* rework
2026-03-13 12:45:19 +01:00
Tim Visée
01a56ef2e5 Fix transfers may lock shard holder for too long (#8373)
* Add basic test that shows shard holder is locked for too long

* Rework test, move into stream records test

* Fix typos

* Don't lock shard holder for a long time in stream records transfer (#8374)

* [ai] Detach shard holder lock from sending update batch

* Fix clippy warning

* Move stream records delay up to sleep in the middle of the batch

* remove unused code

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2026-03-13 09:48:10 +01:00
xzfc
8ab0057566 DiscoveryQuery -> DiscoverQuery (#8378) 2026-03-12 19:54:34 +01:00
Arnaud Gourlay
d1c797ba77 Default shard transfer with snapshot when prevent_unoptimized (#8358)
* Default shard transfer with snapshot when prevent_unoptimized

* extract heuristic

* adjust all possible call sites

* keep previous style

* rework default shard transfer method

* Ensure we don't combine non-streaming transfers with filters

* Clippy

* add http ok assertion before json()

* Use exhaustive match

* keep stream records as fallback

* use effective_optimizers_config

* fix fallback success signal

---------

Co-authored-by: jojii <jojii@gmx.net>
Co-authored-by: timvisee <tim@visee.me>
2026-03-12 15:59:20 +01:00
xzfc
96933b34f0 Chores (#8370)
* chore: gitignore .idea and .vscode globally

Reason: `lib/edge/publish` is a separate Cargo workspace and I'd like to
have a separate rust-analyzier configuration for it, which is stored in
`.vscode/settings.json`. Not sure about `.idea`, but I guess the same
logic applies.

* chore: Use Iterator::is_sorted (stabilized in Rust 1.82)

* chore: remove unrelated files

These were added in #5501 (42fd2e27), perhaps by accident?
2026-03-12 09:59:23 +01:00
Andrey Vasnetsov
b14e0be4ed Restrict snaphsot recovery to snapshots directory, hide file contents (#8341)
* restrict recovery from snapshot folder

* fmt

* clippy

* Extend test, path must be inside snapshots directory

* In release builds, hide detailed tar error message to not leak contents

* Change from bad request to forbidden

* fix(auth_tests): place snapshot in peer snapshots dir for recover_collection_snapshot

The recover from snapshot API now requires file:// paths to be inside the
configured snapshots directory. Write the test snapshot into the peer's
snapshots directory instead of a temp file so the request is allowed.

Made-with: Cursor

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: Cursor Agent <agent@cursor.com>
2026-03-10 17:13:32 +01:00
tellet-q
8d50f0a845 Add test for snapshot backpressure freeze (#8197)
* Add test for snapshot backpressure freeze
2026-02-24 15:04:59 +01:00
Arnaud Gourlay
a6c35be384 Fix Docker build for local compatibility tests (#8191) 2026-02-20 16:06:02 +01:00
Arnaud Gourlay
ab1917d634 Storage compatibility v1.17.0 (#8189) 2026-02-20 13:30:24 +01:00
Andrey Vasnetsov
6e79f8bf02 Untagged Enum for FeedbackStrategy (#8171)
* [manual] make untagged enum for consistent API for FeedbackStrategy

* add #[validate(nested)]

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2026-02-18 16:55:47 +01:00
Andrey Vasnetsov
345621f447 Expose shard snapshot API (#8132)
* [AI] generate openapi schema for stream download of shard snapshot

* bump number of APIs

* cover API with access test

* fix test

* fix test
2026-02-16 13:34:44 +01:00
Arnaud Gourlay
5ffc6a45a8 Remove update queue opnum from CollectionInfo (#8127) 2026-02-13 17:36:54 +01:00
Arnaud Gourlay
134ffde18f uv dependencies upgrade (#8124) 2026-02-13 12:05:30 +01:00
Roman Titov
05011e81cd Ensure WAL and shard clocks consistency when creating shard snapshot (#8104) 2026-02-13 11:27:02 +01:00
Arnaud Gourlay
db4aa33e6e Update Python dependencies: urllib3, protobuf, werkzeug, pyasn1 (#8119)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: agourlay <606963+agourlay@users.noreply.github.com>
2026-02-13 08:21:17 +01:00
Andrey Vasnetsov
af7608b101 Ignore cacert for internal requests if not configured (#8099)
* ignore cert verification if not configured

* also ignore hostnames

* script for manually testing tls clsuter
2026-02-12 10:59:38 +01:00
Tim Visée
c63f9eef29 Fix stream records transfer data race, losing pending updates (#8103)
* Add integration test to assert all queued updates are also transferred

* Plunge update queue in stream records transfers

* Migrate existing plunger usages to new plunge helper

* Skip test if not compiled with staging flag

* Only send delay operation when staging feature is enabled

* Reformat

* Fix review remarks
2026-02-11 17:18:44 +01:00
Luis Cossío
a43780941b [relevance feedback] add rest and grpc interfaces (#7399)
* add rest and grpc interfaces

Also handle inference for this query

* follow refactor from base branch

* renaming from Ms Cooper

* get started on validation testing

* more validations

* test equivalence with query when less than 2 feedback elements

* rename feedback query to relevance_feedback query

* fix extraction of context pairs

* rename feedback vector to example

* make coderabbit happier

* upd test

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2026-02-11 16:05:11 +01:00
tellet-q
3ba62e37b6 Add a test to check if creating snapshots blocks other operations (#7510)
* Add a test to check if creating snapshots blocks other operations
2026-02-11 12:20:47 +01:00
tellet-q
9b3939e008 Add test for consensus' freeze during streaming snapshot (#8075) 2026-02-11 10:58:36 +01:00
Luis Cossío
a87c22f56b fix: handle score_threshold in Formula queries (#8097)
* handle `score_threshold` in Formula queries

* AI: add openapi test

prompt: Upload 4 points with a numeric payload, use the payload as the
score, and set a score threshold. We can assert which ids should be in
the result and which shouldn't
2026-02-10 17:28:27 -03:00
Andrey Vasnetsov
4437edb775 Weighted rrf (#8063)
* weighted rrf implementation

* test

* fmt

* fix edge

* validate number of sources and number of weights

* do not partial match

* upd schema

* review fixes

* update formula

* remove calcualtions from tests

* update comment, because AI have OCD

* fmt
2026-02-06 19:36:27 +01:00
tellet-q
75ba1de122 Add more stages for shard transfer profiling (#8027)
* Improve stages reporting

* Remove transferring records info from snapshot transfer's comment

* Add detailed profiling for ReshardingStreamRecords

* Address AI review comment

* Remove some nesting

---------

Co-authored-by: timvisee <tim@visee.me>
2026-02-06 10:55:23 +01:00
Ivan Pleshkov
510b0c090a Update queue status in metrics and telemetry (#8060)
* update queue status in metrics and telemetry

* fix python tests

* update openapi
2026-02-05 11:37:19 +01:00
Arnaud Gourlay
9f09dbfd3b Update queue info into CollectionInfo (#8010)
* Update queue info into CollectionInfo

* basic test

* fix

* cleaner

* Update lib/collection/src/shards/local_shard/mod.rs

Co-authored-by: xzfc <5121426+xzfc@users.noreply.github.com>

* fix the fix

* rename to op_num

* skip_serializing_if just in case

* first step

* test queue length with staging feature

* gate integration test based on binary feature

---------

Co-authored-by: xzfc <5121426+xzfc@users.noreply.github.com>
2026-01-30 17:23:53 +01:00
Tim Visée
36824b9aff Use local telemetry for peer version check, not cluster level telemetry (#8016) 2026-01-30 13:18:03 +01:00
Andrey Vasnetsov
15361e2fb8 more reliable version check (#8002) 2026-01-27 17:07:31 +01:00
tellet-q
00039e1537 Track shard transfer stages and duration (#8001)
* Track shard transfer stages and duration
2026-01-27 15:32:17 +01:00
Andrey Vasnetsov
81e7ab72fe introduce update_mode parameter for upsert operation to control if we want to insert, update, or upsert (#7963)
* introduce update_mode parameter for upsert operation to control if we want to insert, update, or upsert

* add test

* upd dockstring

* require resharding once all peers have updated version

* use service error

* fix clippy again

* wait for same version before resharding in tests
2026-01-27 00:39:25 +01:00