Commit Graph

544 Commits

Author SHA1 Message Date
Kumar Shivendu
d3d639ea9d Improve telemetry logic and test (#6399)
* Improve telemetry logic and test

* Parametrize telemetry test

* Consistency hash peeer ID across telemetry

* clean test

* Use Option in segments telemetry

* updat openapi spec

* Avoid test failure on change in order of params
2025-04-18 15:31:37 +02:00
Andrey Vasnetsov
c57d748dd4 Telemetry improvements (#6390)
* allow shard states in anonymize telemetry (with hashed peer ids)

* introduce level3 and level4 for telemetry, where level4 = everything, incl. segments info

* upd openapi

* fix tests

* expose vector count & size stats on shard level to avoid reading of segments

* fix spelling

* upd schema

* fix tests

* Use unwrap_or_default

* [#6390] skip serializing shard details in Level2 (#6398)

* skip serializing shard details in Level2

* upd openapi

---------

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
2025-04-17 23:32:10 +02:00
Kumar Shivendu
e4dd6390e6 Fix flaky test with dirty shards (#6397) 2025-04-17 21:52:12 +05:30
Kumar Shivendu
8d49c2c3aa Recover dirty shards using other replicas when marked Dead (#6293)
* Test behaviour of Qdrant with shard initializing flag

* Corrupt shard directory and let Qdrant panic like prod

* Wait for shard transfer

* Restore dirty shards using other replicas

* remove unused code

* Request transfer only if replica is dead or dirty

* fmt

* remove comment

* fix clippy

* Delete shard initializing flag after initializing empty local shard

* Expect test to recover shard in existing test

* Review suggestions

* Run tests for longer

* Simplify tests

* Use 2k points

* condition for point_count

* Add comment

* fix flaky tests

* fix flaky tests

* handle edge case

* Include Active in expected states list

* Introduce is_recovery

* simplify tests

* get rid of is_dirty bool in DummyShard

* add missing negation in condition

* fix condition

* final fix for transfer condition

* Don't auto recover if in recovery mode, simplify state checking

* minor comment improvements

* tests scenario where node is killed after deleting shard initializing flag

* Fix failing CI

* Only automatically recover dead replicas

* Mark replica as dead to recover dummy shard

* fix failing test

* Sleep one second after killing peer, give time to release WAL lock

* Prevent waiting for peer to come online indefinitely

* update comment

* minor typo

---------

Co-authored-by: timvisee <tim@visee.me>
2025-04-17 01:22:24 +05:30
Roman Titov
b77a1a356e Optimize GitHub Actions workflows (#6362)
* Add shared rust-cache key for integration test jobs

* Disable debug symbols

* Remove non-necessary setup steps...

...from `test-low-resources` and `test-snapshot-operations-s3-minio` jobs

* Always upload `test-consensus`/`integration-tests-consensus` logs...

...even when tests passed successfully

* Reduce poll interval for `wait_for` checks in integration tests
2025-04-16 12:00:20 +02:00
Luis Cossío
634e5064ec [query api] don't propagate offset into prefetches (#6357)
* don't propagate offset into prefetches

* I want to see CI with that change

* Move import into platform specific scope

* edit test to make sure offset is not propagated

* fix planned query test

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
Co-authored-by: timvisee <tim@visee.me>
2025-04-11 14:11:21 +02:00
Arnaud Gourlay
8d54eba487 Fix strict mode query limit for distance matrix API (#6354) 2025-04-10 09:52:25 +02:00
Arnaud Gourlay
e617b9fa20 Fix strict mode query limit for group APIs (#6353) 2025-04-09 20:24:23 +02:00
Arnaud Gourlay
932ac134e8 Read rate limiter charge per filter condition (#6333) 2025-04-07 19:01:54 +02:00
Arnaud Gourlay
d46c4bf099 Rate limit retrieve based on number of ids (#6327)
* Rate limit retrieve based on number of ids

* fmt

* Better test
2025-04-07 11:31:42 +02:00
Luis Cossío
f9a537174c [strict mode | score boosting] Strict mode for formula queries (#6317)
* move problems.rs to collection crate

* change type on datetime_key expression

* extract from expression

* check for unindexed fields in formula

* clippy

* dedup code

* Only implement verification for `CollectionQuery` types (#6319)

* verify CollectionQuery's Prefetch

* remove implementation for REST query

* remove implementation for REST query groups

* add basic openapi test
2025-04-04 13:52:01 -03:00
Arnaud Gourlay
7723d91427 Document Multivector Euclidean scoring discrepancy (#6320) 2025-04-04 15:54:28 +02:00
Arnaud Gourlay
fd9215858e Rate limite recommendation based on number of examples (#6324) 2025-04-04 15:53:14 +02:00
tellet-q
592766d319 A new test check that payload_io_read is withing some limit for a larger amount of segments (#6301)
* Add a test on payload_io_read value
2025-04-03 09:12:29 +02:00
Andrey Vasnetsov
fbf1ce4d17 implement missing validation for sparse and milti-vectors in grpc (#6274) 2025-03-31 11:22:53 +02:00
Arnaud Gourlay
22a33bfc53 Generate data for v1.13.5 in storage compat. tests (#6255) 2025-03-25 18:05:58 +01:00
Arnaud Gourlay
41a15acd6a Add all datatypes to storage compat. tests (#6254) 2025-03-25 16:17:54 +01:00
Arnaud Gourlay
cf81d8d674 Add multivector to storage compat. tests (#6251) 2025-03-25 15:30:24 +01:00
Arnaud Gourlay
9adf8610b3 Add more payload types to storage compat. tests (#6250)
* Add more payload types to storage compat. tests

* less duplication
2025-03-25 13:46:40 +01:00
Tim Visée
0f07f45cf5 Unify function for creating shard key, we had it in two places (#6227) 2025-03-21 16:32:52 +01:00
Andrey Vasnetsov
dad1496d50 decrease collection probability (#6224) 2025-03-21 14:55:37 +01:00
Tim Visée
f50292e5eb Test shard key application in consensus snapshot (#6213)
* Test shard key application in consensus snapshot

* Review suggestions
2025-03-21 11:47:33 +01:00
Luis Cossío
4149e6d2b3 [score boosting] Error on unexpected type (#6187)
* helper for getting payload value

* Error instead of silent default

* fix clippy

* fix openapi test
2025-03-18 12:21:36 -03:00
Jojii
c9a6a96bcb Io measurement cleanup and tests (#5949)
* HW measurement cleanup and more tests

* Fix wrong measurements

* Use new assertion function

* Fix Payload Measurement bug. Fix tests
2025-03-12 09:59:43 +01:00
Arnaud Gourlay
1a0862ebd3 Write rate limit batch update per point count (#6152) 2025-03-11 16:10:07 +01:00
Arnaud Gourlay
58039f9f2e Unset strict config fields (#6120) 2025-03-10 15:32:21 +01:00
Jojii
bf47c97257 Measure io writes for vector upsertions (#5944)
* Add counter to vector storage API

* Measuring IO write for dense vectors

* Tests, GPU and sparse

* Measure multi vectors too

* Fix comment
2025-03-10 15:27:06 +01:00
Arnaud Gourlay
7ba47bb63e Do not rate limit scroll operations for shard transfers (#6118) 2025-03-07 12:45:18 +01:00
Jojii
1fded093b7 Measure hardware IO for update operations (#5922)
* Measure update operations hardware IO

* Add support for distributed setups

* also measure update_local

* Add consensus tests for HW metrics of update operations

* add test for upserting without waiting

* Disable HW usage reporting when not waiting for update API

* Review remarks

* Fix resharding collecting hw measurements

* Fix metric type

* New struct HardwareData for better accumulation

* Ensure we always apply CPU multiplier

* Apply suggestions from code review

* Update src/actix/api/update_api.rs

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

* Fix assert_with_upper_bound_error threshold calculation.

* Clarifying why we don't measure shard cleanup

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-03-06 15:03:23 +01:00
Andrey Vasnetsov
ea6dc0a91a IsEmpty/IsNull index (#6088)
* create initial strucutres

* clippy

* start field-query refactoring

* start field-query refactoring (2/N)

* start field-query refactoring (3/N): duplicate is_empty/null condiftions as field condition

* start field-query refactoring (4/N): re-instate is_empty fallback in case new index is not built yet

* filter for is_empty/is_null

* implement add/remove point

* upd schema

* open and create of null-index

* create null-index

* fix test

* Update lib/segment/src/index/query_optimization/condition_converter.rs

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

* unit test for null-index

* more unit tests

* add openapi tests

* fmt

* fix for integartion tests

* rabbit review fix

* make [null] non-empty

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-03-04 13:19:50 +01:00
Arnaud Gourlay
fc17b79334 Add retry-after header for gRPC (#6072)
* Add retry-after header for gRPC

* propagate retry-after within inter node communication

* snipe

* tweak and test

* log all parsing errors

* Update lib/collection/src/operations/types.rs

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-02-28 11:41:40 +01:00
Luis Cossío
64a117f81e [score boosting] openapi test for formula (#6064)
* add formula to internal grpc api

* add openapi test for formula
2025-02-26 10:28:12 -03:00
Arnaud Gourlay
dc307b0f47 Fix flaky test failed_snapshot_recovery (#6063) 2025-02-26 00:29:57 +01:00
Arnaud Gourlay
e50c8436d5 Keep initial shard configuration on failed restore (#6038)
* Keep initial shard configuration on failed restore

* Set initialization flag for crash safety
2025-02-25 13:26:06 +01:00
Tim Visée
5dd4d1fb74 Add a basic consensus compaction test, also assert cluster metadata (#6017)
* Add a basic consensus compaction test, also asserting cluster metadata

* Use just one shard and replica in consensus compaction test
2025-02-18 17:37:17 +01:00
Tim Visée
36fd28a722 Do not deactivate partial/recovery replica on missing point (#5991)
* Do not deactivate partial or recovery replica on non-transient error

* Handle missing point edge case in handle_failed_replicas instead

* We already have the replica state

* Add test, move replica during constant set payload, assert shard move

* Add link to pull request in comment
2025-02-17 09:42:26 +01:00
Arnaud Gourlay
1a7e2701d7 Add strict mode for max points count (#5967)
* Add strict mode for max points count

* clarify estimated nature
2025-02-12 11:10:51 +01:00
Arnaud Gourlay
d4e0aaa0d7 Retry-After on rate limiter hit for REST API (#5917)
* Retry-After on rate limiter hit for REST API

* fix tests

* Ceil retry after seconds number so clients don't retry too early

* Relax retry after time requirement a bit in case CI machines are slow

* Add rate limit test, test retry after if we replanish within a second

* Report time to wait in rate limit error

---------

Co-authored-by: timvisee <tim@visee.me>
2025-02-10 11:27:18 +01:00
Damian
01a997098f Add NormalizePath middleware to cleanup url (#5946)
* feat: add NormalizePath middleware to cleanup url

Signed-off-by: Damian <damiakpan@gmail.com>

* Cleaned up comment on Normalize Path

* test: add test case to validate behavior

* Update tests/basic_api_test.sh

Co-authored-by: Andrey Vasnetsov <vasnetsov93@gmail.com>

---------

Signed-off-by: Damian <damiakpan@gmail.com>
Co-authored-by: Andrey Vasnetsov <vasnetsov93@gmail.com>
2025-02-06 09:43:43 +01:00
Tim Visée
06239033d3 Add test for URI and boostrap URI environment variables (#5916)
* Restructure process spawning in consensus tests, build list of args

* Extend consensus test, also test if providing URIs through env vars work

* Set URI and bootstrap variables unconditionally
2025-01-31 10:17:44 +01:00
Luis Cossío
5d9d5bd3f9 Rename blob_store as gridstore (#5918)
* rename blob_store into gridstore

Article is incoming and I feel like gridstore is a better fit to the
architecture

* fmt

* remove outdated TODO
2025-01-30 14:56:34 -03:00
Roman Titov
f72dcfb94b Optimize consensus loop (#5728) 2025-01-28 13:55:49 +01:00
n0x29a
1796c76e35 Strict mode sparsevector (#5841)
* Strict mode sparse vectors
* Update gRPC docs
* Use deny_unknown_fields (#5868)

---------

Co-authored-by: n0x29a <n0x29a@example.com>
Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2025-01-23 17:34:38 +00:00
Tim Visée
5f55d3a5a5 Fix broken shard key mapping storage, keep shard key numbers (#5838)
* Move shard key mapping type definition into separate module

* Create save on disk wrapper for shard mapping, persist in robust format

* Clean up shard key mapping wrapper

* Transform conversion functions into from implementations

* Add test, ensure shard key numbers are correctly persisted on restart
2025-01-21 13:39:17 +01:00
Arnaud Gourlay
4dee0c5bf4 Strict mode multivector (#5757)
* strict mode for multivector

* simplify impl

* regen docs
2025-01-20 15:53:35 +01:00
Arnaud Gourlay
4eee1b81d6 API validation for unique dense and sparse vector names (#5808)
* API validation for unique dense and sparse vector names

* less alloc

* test empty name as well

* quotes instead of ticks
2025-01-15 16:51:05 +01:00
Tim Visée
3787cf1f38 Resharding: add test for abort resharding fix (#5795)
* Add consensus test to abort resharding with replicas, previously failed

* Remove unnecessary info fetch

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2025-01-14 15:15:49 +01:00
Arnaud Gourlay
580c9f249a Migrate strict mode payload test for mmap (#5793) 2025-01-14 13:22:50 +01:00
Jojii
3e96fae333 [Strict mode] limits for filter and conditions (#5754)
* Add limits for filter and conditions

* clippy

* Review remarks + nested condition test

* Fix opnapi specs

* Improve error message by giving info about limits and usage
2025-01-14 11:07:27 +01:00
Tim Visée
3304d7b60d Resharding: wait on clean up deletes, exact counting in tests (#5787)
* During resharding tests, assert exact counts

* Wait on delete operation while cleaning up points
2025-01-13 19:13:07 +01:00