562 Commits

Author SHA1 Message Date
Bhagirath Kapdi
732d34027f
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 18:54:05 +01:00
qdrant-cloud-bot
f9d81f2b92
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-26 18:40:47 +01:00
Arnaud Gourlay
a97132fad6
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-26 18:40:31 +01:00
Excellencedev
77e2fe72f8
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-26 18:39:05 +01:00
Tim Visée
9f8602d854
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-26 18:34:39 +01:00
Jojii
7b196be231
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-26 18:24:36 +01:00
tellet-q
b9e34b68b8
Add a test for dirty shard crashloop (#8440)
* Add a test for dirty shard crashloop
2026-03-26 18:24:29 +01:00
qdrant-cloud-bot
2e11a99783
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-26 18:23:00 +01:00
Arnaud Gourlay
60f32d7e65
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-26 18:22:37 +01:00
Arnaud Gourlay
4aa8f98045
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-26 18:16:41 +01:00
qdrant-cloud-bot
a10b033043
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-26 18:16:01 +01:00
Arnaud Gourlay
26c92ca8e4
Integration test for deferred points (#8365)
* Integration test for deferred points

* test facets

* rework
2026-03-26 17:58:02 +01:00
Tim Visée
1d43353aee
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-26 17:56:35 +01:00
xzfc
da4c15a5fc
DiscoveryQuery -> DiscoverQuery (#8378) 2026-03-26 17:55:57 +01:00
Arnaud Gourlay
d58a6975d0
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-26 17:55:51 +01:00
xzfc
c41a582296
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-26 17:52:01 +01:00
Andrey Vasnetsov
c6f7550fdc
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-26 17:48:45 +01:00
tellet-q
506b69297f
Add test for snapshot backpressure freeze (#8197)
* Add test for snapshot backpressure freeze
2026-03-26 17:02:10 +01:00
Arnaud Gourlay
34dcaa5c16
Fix Docker build for local compatibility tests (#8191) 2026-03-26 16:53:37 +01:00
Arnaud Gourlay
c0323bbdf9
Storage compatibility v1.17.0 (#8189) 2026-03-26 16:52:37 +01:00
Andrey Vasnetsov
da98a8eec4
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 17:21:06 +01:00
Andrey Vasnetsov
d16c62c76c
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-17 11:00:47 +01:00
Arnaud Gourlay
cc3f578b5c
Remove update queue opnum from CollectionInfo (#8127) 2026-02-16 10:17:29 +01:00
Arnaud Gourlay
6b139a823d
uv dependencies upgrade (#8124) 2026-02-16 10:17:28 +01:00
Roman Titov
bdd4bb5180
Ensure WAL and shard clocks consistency when creating shard snapshot (#8104) 2026-02-13 11:52:23 +01:00
Arnaud Gourlay
9fdc92e615
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 09:55:50 +01:00
Andrey Vasnetsov
7e1a8325dc
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-13 09:55:46 +01:00
Tim Visée
caa5a14866
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-13 09:55:37 +01:00
Luis Cossío
bc6246df5a
[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-13 09:55:37 +01:00
tellet-q
22fb1c5bc4
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-13 09:55:36 +01:00
tellet-q
4cf0bbd63c
Add test for consensus' freeze during streaming snapshot (#8075) 2026-02-13 09:55:36 +01:00
Luis Cossío
b88a1d76ce
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-13 09:55:18 +01:00
Andrey Vasnetsov
037600e8af
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-10 00:04:33 +01:00
tellet-q
79d0678440
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-10 00:03:26 +01:00
Ivan Pleshkov
78207079dd
Update queue status in metrics and telemetry (#8060)
* update queue status in metrics and telemetry

* fix python tests

* update openapi
2026-02-10 00:01:27 +01:00
Arnaud Gourlay
aeeafe4a0e
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-02-09 23:39:24 +01:00
Tim Visée
7d2a9657ac
Use local telemetry for peer version check, not cluster level telemetry (#8016) 2026-02-09 23:39:17 +01:00
Andrey Vasnetsov
c755e6bfe8
more reliable version check (#8002) 2026-02-09 23:37:14 +01:00
tellet-q
55969c7e97
Track shard transfer stages and duration (#8001)
* Track shard transfer stages and duration
2026-02-09 23:36:50 +01:00
Andrey Vasnetsov
9099a7ac1b
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-02-09 23:28:45 +01:00
xzfc
8fb203eeb5
Update GET collections/{}/optimizations (#7946)
* refactor(SegmentOptimizer::name): make it `&'static`

* refactor(TrackerStatus): add is_running()

* refactor: add TrackerSegmentInfo

* feat: rework optimizations endpoint

* feat(collections/{}/optimizations): trim spaces
2026-02-09 23:28:03 +01:00
Daniel Boros
00e0a7fc24
feat/test-timeout (#7920)
* feat: add timeout tests

* fix: timeout test

* fix: api urls

* fix: test

* feat: add staging api def

* feat: add parallel executor for tests

* fix: imports

* fix: ci/cd

* rollback openapi schema change

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2026-02-09 23:15:44 +01:00
Andrey Vasnetsov
ac2c18e1fe
Validate vector name in matrix request (#7923)
* validate `using` param

* fix slop
2026-02-09 23:08:14 +01:00
Kumar Shivendu
a036211a0f
Test behaviour when having no shards in custom sharding (#7867)
* Test behaviour when having no shards in custom sharding

* minor suggestion
2026-02-09 22:56:17 +01:00
Sapphire
37de1f219d
Add enable_hnsw option for payload field schema (#7887)
* feat: Add enable_hnsw option for payload field indexes

Add optional enable_hnsw parameter to all payload index types to control
whether additional HNSW graph links are built for each indexed field.

- Add enable_hnsw field to all 8 payload index param types
- Update gRPC proto definitions and conversions
- Update OpenAPI schema
- Modify HNSW graph builder to respect enable_hnsw flag
- Add enable_hnsw() helper methods to PayloadSchemaParams and PayloadFieldSchema
- Update all tests to include new field (default: None)

When enable_hnsw is true and payload_M > 0, additional HNSW links will
be built for the payload field. Default value is true for backward compatibility.

* Fix Some format problems

* fix: address comment problem

---------

Co-authored-by: EC2 Default User <ec2-user@ip-10-78-171-148.ec2.internal>
2026-02-09 22:53:47 +01:00
tellet-q
30a34642b9
Add a test for recovery after kill during Partial (#7762)
* Add a test for recovery after kill during Partial

* Address AI review

* simplify test

* Merge pull request #7829

* introduce a new state

* switch to ManualRecovery for user-initiated snapshot operations

* fmt

* fix test and regen api

* test fix: instead of force recovery on update failed snapshots now re…

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2026-02-09 22:35:29 +01:00
Andrey Vasnetsov
a21b641d26
Merge pull request #7835
* alt api key

* rm typo

* fix key length check logic

* differnt dirs for tests

* fix tests

* rm unused
2026-02-09 22:35:18 +01:00
Luis Cossío
d889ff90ee
allow collection-level jwt access (#7758) 2026-02-09 22:31:53 +01:00
Luis Cossío
45c560b5bc
[cluster telemetry] Expose endpoint (#7729)
* expose cluster telemetry endpoint

* add endpoint to openapi

* add jwt test

* remove dead_code expectation

* fix consistency check

* fix jwt access test

* use response(reference(..)) in openapi
2026-02-09 22:31:32 +01:00
tellet-q
f1d54ca889
Move test dependencies to tests (#7793)
* Move pyproject and uv.lock to tests folder

* Make tests working-dir agnostic

* Fix test

* Address review
2025-12-18 17:29:18 +01:00