Commit Graph
747 Commits
Author SHA1 Message Date
Arnaud Gourlay 118ff6dda3 Fix Clippy 1.89 (#6981) 2025-08-11 13:16:42 +02:00
Roman Titov bf319a0b40 Avoid creating partial snapshot if snapshot manifest contains no changes (#6924) 2025-08-11 13:15:39 +02:00
Tim Visée d6844b7f65 Deprecations for Qdrant 1.15.0 (#6892)
* Deprecate init_from

* Mark memmap_threshold as deprecated

* Mark locks API as deprecated

* Mark RBAC collection access payload filter as deprecated

* Allow deprecations in tests and benchmarks
2025-07-17 16:12:57 +02:00
Kumar Shivenduandtimvisee 105bdb4dc2 Fix bug that causes all replicas to die if node is restarted during resharding (#6800)
* Fix bug that causes all replicas to die if node is restarted during resharding

* fix recursive async problem

* Avoid write lock unless required

* avoid using &mut when & is sufficient

* Remove is_in_progress since check_abort_resharding exists (#6806)

* On resharding abort, only abort transfers related to current operation

* Fix resharding dead replicas improvements (#6881)

* Apply suggestions to fix resharding dead replicas

* fmt

---------

Co-authored-by: timvisee <tim@visee.me>
2025-07-17 14:00:50 +02:00
Tim Visée 416e6b12ac Change retain to extract_if where we depend on retain result (#6802) 2025-07-17 13:53:17 +02:00
eceefa780e Wait until replicas are activated, when creating custom shards (#6817)
Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: timvisee <tim@visee.me>
2025-07-17 13:49:48 +02:00
Kumar Shivendu 1d80c55921 Use peer_id instead of default_peer_id (#6815) 2025-07-17 13:49:28 +02:00
Luis Cossíoandgenerall 2eb9fcee53 [MMR] resolve at collection level (#6786)
* add mmr as a ScoringQuery

* add mmr to CollectionQueryRequest

* handle mmr after collecting from shards

* use unwrap_or_else

* include mmr as a vector query

* ordering for MMR is None

* fix score threshold

* fmt + todo comment

* remove unused function

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-07-17 13:48:37 +02:00
Kumar Shivendu 05c762a26a Introduce new config to set default peer ID (#6783)
* Introduce new config to set default peer ID

* Add unit test to check persistence of default peer ID

* add missing update to main.rs

* fix clippy

* Log if using default peer ID

* Use non default peer id

* Move default_peer_id config to cluster config

* update main.rs

* minor var name refactor

* Add validation for default peer ID range

* Fix validation and ensure we dont generate Peer ID 0 randomly

* fmt
2025-07-17 13:47:32 +02:00
Roman Titov bda74ceae2 Create custom shards in Initializing state instead of Active (#6778) 2025-07-17 13:39:59 +02:00
Andrey Vasnetsov 7d2fbb0d4c remove max indexing threads from config (#6760)
* remove max_optimization_threads from config.yaml

* fmt
2025-07-17 13:29:24 +02:00
xzfc 231567c31a Configurable HNSW healing threshold (#6756) 2025-07-17 13:26:25 +02:00
Tim Viséeandgenerall 66352e4950 Feature flag RocksDB dependency (#6646)
* Flag index selector

* Flag take_database_snapshot

* Flag field index builder

* Flag bool index

* Flag full text index

* Flag geo index

* Flag map index

* Feature flag numeric index

* Flag skip_rocksdb

* Flag payload storage

* Flag segment

* Flag builder

* Flag backup

* Make RocksDB crate optional

* Tweak feature flag gate

* Disable default segment crate features from all dependents

* Handle flag in collection crate correctly

* Flag payload storage types in tests

* Temporarily disable on-disk check for sparse vectors

* Flag sparse vector RocksDB in GPU code

* Fix compilation error since recent merge

* Flag payload storage types in new function

* remove todo

* Explicitly implement default to more clearly state difference

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-07-17 13:06:39 +02:00
Andrey Vasnetsov 3f6c909057 Fix default replication factor (#6632) 2025-07-17 11:22:12 +02:00
Andrey Vasnetsov ab3bf7bb24 register payload index fields on recovering snapshot (#6582) 2025-05-22 23:27:34 +02:00
Roman Titovandgenerall 86d7c02528 Add partial snapshot recovery and search locks (#6497)
Co-authored-by: generall <andrey@vasnetsov.com>
2025-05-22 23:27:01 +02:00
Andrey Vasnetsov 7872c182f1 Strict mode error is now 400 instead of 403 (#6560)
* strcit mode error is now 400 instead of 403

* fix test
2025-05-22 23:22:16 +02:00
Andrey Vasnetsovandtimvisee 3501e4b7fe Add setting to limit max number of collections (#6548)
* add setting to limit max number of colelctions

* upd openapi

* Add max_collections to config

---------

Co-authored-by: timvisee <tim@visee.me>
2025-05-22 23:21:00 +02:00
Tim Visée 6bf59ed6eb Use more write buffers, and flush them (#6514)
* Explicitly flush buffered writers so that we catch errors

* Buffer IO in more places

* Tweaks

* Apply review suggestions
2025-05-22 23:10:07 +02:00
Tim Visée cad4ceed4b Buffer all file IO when used as reader or writer (#6513) 2025-05-22 23:06:03 +02:00
Tim Visée 0699dd0827 Don't batch queries if having more segments than search threads (#6478)
* Don't batch query if there's more segments than CPUs, limit threads

* Don't batch query if there's more segments than search threads

* Link to pull request

* Add note that we only consider local segments and global search threads
2025-05-22 23:00:01 +02:00
Roman Titov 5483581064 Add partial snapshot API endpoints (#6304) 2025-05-22 22:49:26 +02:00
Kumar Shivendu 83af9cf3ba 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-21 00:12:26 +02:00
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
Tim Visée e59d395d80 Use ahash for maps/sets holding point IDs, offsets or similar (#6388) 2025-04-21 00:10:22 +02:00
dependabot[bot] 32c9faa745 build(deps): bump anyhow from 1.0.97 to 1.0.98 (#6374) 2025-04-21 00:03:38 +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
Andrey Vasnetsovandtimvisee c15a6ca442 Scroll lock: make sure no segments are modified between scroll and retrieve (#6289)
* Scroll lock: make sure no segments are modified between scroll and retrieve

* Take write lock in block_in_place to prevent blocking tokio runtime

* Use blocking write

* Recover collection snapshot on general runtime

* Make function const

---------

Co-authored-by: timvisee <tim@visee.me>
2025-04-20 23:44:25 +02:00
Arnaud Gourlay 33e7aa0b98 Fixes for Clippy 1.86 (#6290) 2025-04-20 23:42:07 +02:00
dependabot[bot]andLuis Cossío 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
Jojiiandgenerall 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
Roman Titovandtimvisee 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
Tim Visée c41a65a3de Fix consensus snapshot not applying shard key mappings (#6212)
* Propagate shard key mapping wrapper deeper

* Also bump reverse shard mapping when applying shard keys from snapshot

* Also apply new shard key mappings to existing replicas

* Apply shard key to replica set through apply_state directly

* Set both new shard key mappings through utility function

* Set shard key mappings directly during directory creation

* Rename get_key to key

* Update comment
2025-03-21 11:46:59 +01: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
dependabot[bot] 0b66b2efe8 build(deps): bump async-trait from 0.1.86 to 0.1.88 (#6180) 2025-03-21 11:45:16 +01:00
xzfcandgenerall 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
JojiiandTim Visée 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
dependabot[bot] 07f5580c68 build(deps): bump anyhow from 1.0.96 to 1.0.97 (#6103) 2025-03-21 11:41:03 +01:00
Arnaud GourlayandTim Visée 6afd4f1e3e 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-03-21 11:40:35 +01:00
Arnaud Gourlay b5de28db80 Struct deconstruction leftovers (#6071) 2025-03-21 11:40:13 +01:00
Arnaud Gourlay 8426b52644 Struct deconstruction in conversions (#6066)
* Struct deconstruction in conversions

* payload ops conversions

* inference conversions

* RecordInternal conversion

* shard operation conversions
2025-03-21 11:39:46 +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
Tim Visée 13178a4dc9 Fix mix ups in read/write rate limit settings (#6029) 2025-03-21 11:37:20 +01:00
Andrey Vasnetsovandtimvisee 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
Arnaud Gourlay 2da7b56468 Remove support for deprecated shard format (#6016) 2025-03-21 11:37:05 +01:00
Roman Titov e05e3b775e Include ClusterMetadata into Raft snapshot 😬 (#6014) 2025-03-21 11:36:48 +01:00