Commit Graph

700 Commits

Author SHA1 Message Date
Andrey Vasnetsov
bbea80e7d4 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-21 00:10:28 +02:00
xzfc
feb06c9113 Enable incremental_hnsw_building default (#6355) 2025-04-21 00:02:36 +02:00
Luis Cossío
076bcdaa16 refactor QueryEnum::Nearest for using NamedQuery (#6349)
* refactor QueryEnum::Nearest for using NamedQuery

* use explicit `NamedQuery::from`
2025-04-20 23:58:39 +02:00
Luis Cossío
317f1e0dbe [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-20 23:52:36 +02:00
Luis Cossío
e114801ebf sum_scores recommendation strategy (#6256)
* Add in rest and grpc

* add to QueryEnum

* implement Query trait

* connect to scorer creation

* upd tests

* additional changes

* fmt

* gen openapi and grpc docs

* coderabbit fix

* add changes in async scorer

* test sum_scores in more places, refactor to remove repetition
2025-04-20 23:47:58 +02:00
Arnaud Gourlay
89667860dd Minor cleanups (#6291) 2025-04-20 23:42:17 +02:00
dependabot[bot]
f230629fa0 build(deps): bump log from 0.4.26 to 0.4.27 (#6247)
* build(deps): bump log from 0.4.26 to 0.4.27

Bumps [log](https://github.com/rust-lang/log) from 0.4.26 to 0.4.27.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.26...0.4.27)

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

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

* put variables inside the strings for log macros

* also for pyroscope

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2025-03-31 16:19:55 +02:00
Jojii
5cd7239b61 Measure Payload Index IO Writes (#6137)
* Prepare measurement of index creation + Remove vector deletion
measurement

* add hw_counter to add_point functions

* Adjust add_point(..) function signatures

* Add new measurement type: payload index IO write

* Measure payload index IO writes

* Some Hw measurement performance improvements

* Review remarks

* Fix measurements in distributed setups

* review fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-03-31 16:19:19 +02:00
Tim Visée
4182614595 Add all feature flag, report enabled flags on start (#6228)
* Add magic all flag, if set all features will be enabled

* Report enabled feature flags on start, if any is enabled

* Remove pub visibility from all, add comment it's only applied on init

* Don't check all flag in is_empty
2025-03-31 16:19:16 +02:00
Roman Titov
c4ec15db9a Simplify ShardKeyMapping implementation (#6220)
* Simplify `ShardKeyMapping` impl

* Automatically switch to new mappings format, if `Number` shard key is used

* Apply TODOs

* Add comment describing the issue, leave instructions for migration

* Cleanup

Remove unnecessary assignment

* Cleanup

Remove misleading comment

---------

Co-authored-by: timvisee <tim@visee.me>
2025-03-31 16:19:06 +02:00
Andrey Vasnetsov
a21e364e6f remove failty to_string conversion for InferenceToken (#6221) 2025-03-31 16:17:24 +02:00
Tim Visée
12492c7bda Fix broken shard key mapping in consensus snapshot (#6209)
* Use safe shard key wrapper type in consensus snapshot state

* Add shard ID iterator

* Produce net wrapped shard key mapping type directly

* Add useful comments

* Fix typo
2025-03-21 11:46:38 +01:00
Tim Visée
01be51e251 Add global feature flags (#6194)
* Add global feature flags structure, load on start

* Feature flag use of new shard key format

* Enable feature flag for new shard key format by default in dev builds

* Prevent unwrapping everywhere; Single place for initialization (#6198)

* Disable shard key feature flag by default for now, it causes problems

---------

Co-authored-by: Jojii <15957865+JojiiOfficial@users.noreply.github.com>
2025-03-21 11:46:08 +01:00
Jojii
56a7cfdb20 Cardinality estimation IO measurements (#6117)
* Cardinality estimation measurements

* Apply hw measurements to latest changes from dev

* Clippy

* Also measure cardinality estimation for geo index

* Make measured units 'bytes'

* Use PointOffsetType instead of u32 for size calculation

* fix memory cost for check_values_any in mmap index

* fix double counting for value reading in mmap, remove hw_counter from mmap hashmap

* fmt

* fix hw measurement for text index

* Remove non necessary lifetime annotations

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-03-21 11:44:55 +01:00
Arnaud Gourlay
754ef8c135 Log hardware reporting enabled at startup (#6165) 2025-03-21 11:44:41 +01:00
xzfc
d5fe14a44e Add Anonymize macro (#6160)
* Add Anonymize macro

* Use Anonymize macro

* anonymize metadata

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-03-21 11:44:06 +01:00
Jojii
6d53bd9184 IO read measurements for most Payload indices (#5951)
* Add payload index filtering IO measurements for some indices

* Add payload index metric to api and telemetry

* Also account for index access overhead

* Review remarks

* Anonymize new HardwareUsage field

* Fix tests
2025-03-21 11:43:45 +01:00
Arnaud Gourlay
8c988196ea Remove code duplication for recommendation conversion (#6131) 2025-03-21 11:42:51 +01:00
Jojii
78f0428f3e 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-21 11:42:08 +01:00
xzfc
a17e122557 Anonymize ShardKey in ReplicaSetTelemetry (#6115)
* Anonymize ShardKey in ReplicaSetTelemetry

* Anonymize vector names in CollectionConfigInternal

* no-op: impl HardwareUsage for HardwareUsage (used in HardwareTelemetry)

* no-op: impl Anonymize for OptimizersStatus (used in OptimizerTelemetry and CollectionsAggregatedTelemetry)

* no-op: impl Anonymize for TrackerStatus in (used in TrackerTelemetry)

* no-op: Anonymize VectorParams in VectorsConfig

* no-op: Copy fields explicitly in OperationDurationStatistics

* no-op: `.clone().map(|x| x.anonymize())` -> `.anonymize()`

* no-op: impl Anonymize for ConsensusThreadStatus (used in PeerInfo and ClusterStatusTelemetry)
2025-03-21 11:41:54 +01:00
Arnaud Gourlay
5fdc6c068e Fix logging for remove_started_file_indicator (#6090) 2025-03-21 11:40:52 +01:00
Andrey Vasnetsov
eec3328424 remove warning about bootstrap URI if it is not provided (#6065) 2025-03-21 11:39:32 +01:00
Tim Visée
8ad2b34265 Bump Rust edition to 2024 (#6042)
* Bump Rust edition to 2024

* gen is a reserved keyword now

* Remove ref mut on references

* Mark extern C as unsafe

* Wrap unsafe function bodies in unsafe block

* Geo hash implements Copy, don't reference but pass by value instead

* Replace secluded self import with parent

* Update execute_cluster_read_operation with new match semantics

* Fix lifetime issue

* Replace map_or with is_none_or

* set_var is unsafe now

* Reformat
2025-03-21 11:38:56 +01:00
Luis Cossío
a6043c5db4 [score boosting] add gRPC structures (#6035)
* add grpc structures

* grpc docs

* make by_zero_default optional
2025-03-21 11:38:19 +01:00
Luis Cossío
88701bdb82 [score boosting] Connect formula to query (#6024)
* finish connecting formula query

* upd openapi
2025-03-21 11:37:59 +01:00
Kumar Shivendu
96c8bd6bb4 Log consensus snapshot metadata when applying (#6030) 2025-03-21 11:37:23 +01:00
Andrey Vasnetsov
caed5729e5 IO resource usage permit (#6015)
* rename cpu_budget -> resource_budget

* clippy

* add io budget to resources

* fmt

* move budget structures into a separate file

* add extend permit function

* dont extend existing permit

* switch from IO to CPU permit

* do not release resource before aquiring an extension

* fmt

* Review remarks

* Improve resource permit number assertion

* Make resource permit replace_with only acquire extra needed permits

* Remove obsolete drop implementation

* allocate IO budget same as CPU

* review fixes

---------

Co-authored-by: timvisee <tim@visee.me>
2025-03-21 11:37:12 +01:00
Andrey Vasnetsov
f455669d0a Ca cert for snapshots (#6010)
* make cacert optional

* ignore missing cacertificate on creating https client

* Some tweaks

* Update development.yaml

---------

Co-authored-by: timvisee <tim@visee.me>
2025-03-21 11:36:52 +01:00
Roman Titov
8f4d4beff3 Add common::update::update function (#5977) 2025-03-21 11:36:43 +01:00
Arnaud Gourlay
798f14cafb Fix Clippy 1.85 (#6011)
* Fix Clippy 1.85

* fix false positive
2025-03-21 11:36:07 +01:00
Roman Titov
01acabc0c6 Move UpdateParams structure into common::update... (#5974)
...to easier propagate `wait` and `ordering` API parameters
2025-02-17 10:20:47 +01:00
Roman Titov
363c5412a0 Add InternalUpdateParams structure (#5968)
* Add `InternalUpdateParams` structure...

...to easier propagate `shard_id` and `clock_tag` internal API parameters

* fixup! Add `InternalUpdateParams` structure...

Use `InternalUpdateParams::default` instead of `Default::default`

* Remove now obsolete delinters, expect them where still applicable

---------

Co-authored-by: timvisee <tim@visee.me>
2025-02-17 10:20:37 +01:00
Arnaud Gourlay
aa02c19af9 Properly size Raft message buffer (#5973) 2025-02-17 10:19:03 +01:00
Roman Titov
fa13607f76 Tiny refactoring to reduce some boilerplate in update API (#5953)
* Rename `UpdateParam` into `UpdateParams` and remove `Option`s from fields

* Use `common::inference::extract_token` in internal gRPC API

* Destructure `UpdateVectorsInternal`/`DeleteVectorsInternal` requests in internal gRPC API

* Add `extract_internal_request` helper for internal gRPC API

* fixup! Add `extract_internal_request` helper for internal gRPC API

Use `extract_internal_request` helper in `sync` API

* fixup! Rename `UpdateParam` into `UpdateParams` and remove `Option`s from fields

Remove `JsonSchema` derive from `UpdateParams`
2025-02-11 14:42:04 +01:00
Arnaud Gourlay
27d5b39aee 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-11 14:41:44 +01:00
Andrey Vasnetsov
361daad1c9 check if bootrap is the same as URI (#5950) 2025-02-11 14:41:22 +01:00
Damian
ef68ed9760 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-11 14:41:16 +01:00
Tim Visée
6cc3ecbc30 Enable consensus compaction by default (#5903)
* Enable consensus compaction by default

* Also set new compaction default in code
2025-02-11 14:41:05 +01:00
Jojii
ec0762a560 Measure IO reads for vectors (#5912) 2025-02-11 14:40:21 +01:00
Jojii
77f65ef95f HwCounter rename IO metrics (#5898)
* Rename io metrics and add vector_io_write

* Chore: Cleanup obsolete TODOs and simplify retrieving HardwareCounterCells (#5899)
2025-02-11 14:37:24 +01:00
Tim Visée
d279de9f0e Allow to set peer and boostrap URI through environment variable (#5904) 2025-02-11 14:36:40 +01:00
Luis Cossío
f110328296 bump and migrate to rand 0.9.0 (#5892)
* bump and migrate to rand 0.9.0

also bump rand_distr to 0.5.0 to match it

* Migrate AVX2 and SSE implementations

* Remove unused thread_rng placeholders

* More random migrations

* Migrate GPU tests

* bump seed

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2025-02-11 14:36:20 +01:00
Roman Titov
8afe42da3e Optimize consensus loop (#5728) 2025-02-11 14:35:51 +01:00
Roman Titov
0d16911607 Split tonic::api::points_common module (#5865) 2025-01-28 10:44:07 +01:00
Roman Titov
8868ecc9b2 Split qdrant::common::points module (#5862) 2025-01-27 18:26:02 +01:00
Jojii
97743b1b62 Propagate hardware counter for more functions (#5844)
* Propagate hardware counter for more functions

* Minor improvements

* use vector_query_contexts hardware_counter
2025-01-27 18:25:49 +01:00
xzfc
e85a9f18b4 Add VectorName type alias (#5763)
* Add VectorName/VectorNameBuf type aliases [1/2]

* Add VectorName/VectorNameBuf type aliases [2/2]
2025-01-27 18:25:41 +01:00
Roman Titov
1a4cc22589 Cleanup #[allow(dead_code)] annotations (#5818) 2025-01-23 14:27:56 +01:00
Jojii
38f478ddf7 Measure payload read IO (#5773)
* Measure read io for payload storage

* Add Hardware Counter to update functions

* Fix tests and benches

* Rename (some) *_measured functions back to original
2025-01-23 14:27:40 +01:00
Arnaud Gourlay
6678050332 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-16 10:52:00 +01:00