Commit Graph

5465 Commits

Author SHA1 Message Date
Tim Visée
2bc905058f Final metrics tweaks for Qdrant 1.16.0 (#7516)
* Add collections_vector_total metric for backwards compatibility

Only this metric was removed since Qdrant version 1.15.5, and so this
adds it back for backwards compatibility. Though it has been marked as
deprecated now.

* Prefix replica metrics with collection, part of collection namespace

* Count running optimizations per collection

* Remove deprecation flag

* Minor optimization, preallocate vectors
2025-11-12 12:07:39 +01:00
Arnaud Gourlay
365dc743b7 Bump Pyo3 to 0.27.1 for Edge (#7519) 2025-11-12 11:26:14 +01:00
Tim Visée
c3d2d5d291 Fix hash ring initialization for custom sharding, prevent resharding panic (#7517)
* Correctly rebuild hash rings, don't use default with custom sharding

* Correctly initialize hash ring map with custom sharding

Don't load the non key ring by default

* Validate shard key for resharding more aggressively

When using auto sharding, require no shard key. When using custom
sharding, require a shard key.

* Only pass sharding method into shard holder construction

* Remove now obsolete debug assertion, we use same source config

* Correctly reconstruct hash rings, also add shard IDs in auto mode

* Add test, do not break consensus on invalid resharding down operation

* Add tests for resharding down shard count precondition

* Minor test tweaks

* Improve debug assertion

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

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2025-11-12 11:25:24 +01:00
Jojii
f6b715bd62 Metrics for snapshots (#7497)
* Add atomic counter for running snapshots

* Refactor collection telemetry + export prometheus metric

* Handle collection in ToC + current recovery measurements

* Fix openapi tests

* Fix tests

* Add snapshot metrics for streaming and partial snapshots.

* Fix typo in metrics name

* Adjust metrics names

---------

Co-authored-by: timvisee <tim@visee.me>
2025-11-11 15:00:11 +01:00
Tim Visée
84f9dc2dbb In metrics, only show cumulative number of page faults (#7482)
* In metrics, aggregate page faults

* Include page fault of active children (recursively)

* type alias Pid: i32

* Code improvements

* Ignore already terminated processes

* Clippy

* Also count faults for joined descendant threads in children

* Import std::cmp::min

* Rework child fault recursion, remove second hash set

* Add simple test for iterating child processes

* Fix typo

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

* Use limit values directly

* We don't include the parent PID

* Don't allocate hashmap when listing process children

* Extend process child PIDs test, fork recursively

---------

Co-authored-by: jojii <jojii@gmx.net>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-11-11 13:38:37 +01:00
Arnaud Gourlay
c0a6f86af7 Fix flaky test consensus compaction (#7513) 2025-11-11 12:48:45 +01:00
Roman Titov
388f95203c Allow partial recovery of dummy shard (#7512) 2025-11-11 12:44:06 +01:00
Andrey Vasnetsov
bf87170db3 promotion integration test (#7511)
* test with background update process

* fmt

* remove unused imports

* Remove unused import

---------

Co-authored-by: timvisee <tim@visee.me>
2025-11-11 11:50:13 +01:00
Andrey Vasnetsov
cff49b8f19 Fusion & MMR support in Edge (#7491)
* introduce rescore stage to handle fusion in shard properly

* make shard-stage and collection-stage rescoring explicit

* review fixes
2025-11-11 00:04:56 +01:00
Roman Titov
6bca83c568 Cleanup edge_py::types::filter module (#7490)
Co-authored-by: generall <andrey@vasnetsov.com>
2025-11-10 17:44:12 +01:00
Andrey Vasnetsov
fe06b8559d simple integration test for tenant promotion (#7503)
* simple integration test for tenant promotion

* add cleanup after promotion

* When switching to ReadActive state, set it for the correct peer ID

* fix test

---------

Co-authored-by: timvisee <tim@visee.me>
2025-11-10 17:42:05 +01:00
Arnaud Gourlay
fc86e1dd0b Try fixing Dependabot (#7509)
* Try fixing Dependabot

* oh come on
2025-11-10 16:29:19 +01:00
Tim Visée
7842b47b7d Add ReadActive replica state, use in some stream records transfers (#7474)
* Add ReadActive replica state

* Add consensus function to switch from Partial to ReadActive and confirm

* On stream records to a different shard ID, switch to ReadActive first

* Update OpenAPI spec

* In stream records peer sync, require all peers to be up-to-date

* Review fixes

* Rename ReadActive to ActiveRead

* update openapi spec

* explicit state checking functions

* typo

* update fallback routing with usage of a new state

---------

Co-authored-by: KShivendu <kshivendu1@gmail.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2025-11-10 15:57:10 +01:00
Arnaud Gourlay
8ad34865cb Fix missing workspace lints (#7507) 2025-11-10 14:08:07 +01:00
Ivan Pleshkov
86918bc6bb Enable appendable quantization by default (#7508)
* enable appendable quantization by default

* update openapi
2025-11-10 13:25:31 +01:00
Roman Titov
5c1adde0c6 Implement PyQuery conversions (#7481)
* Rename `PyVectorType` into `PyNamedVector` 😠

* Move `PyQuery` into `types::query`

* Implement `PyQuery` conversions

* Use `bytemuck` to safely transmute between `edge-py` wrapper types (#7488)
2025-11-01 22:37:14 +01:00
Tim Visée
9569f89d1a Report max system wide mmap count in metrics (#7487) 2025-10-31 13:29:31 +01:00
Tim Visée
0646b16f93 In metrics, expose current thread count (#7484) 2025-10-31 13:29:19 +01:00
Roman Titov
9aea6e1b95 Fix clippy 🙄 (#7486)
Co-authored-by: timvisee <tim@visee.me>
2025-10-31 12:59:27 +01:00
Roman Titov
10f3901b39 Improvements to Qdrant Edge Python bindings (#7473)
* Cleanup `examples/qdrant-edge.py`

* Cleanup `edge_py::types::vector` module

* Cleanup `edge_py::types::filter::condition` module

* Extend `PyWithPayload` type

* Use `from` instead of `into` for conversions

* Assert variants for enum conversions
2025-10-31 10:28:20 +01:00
Tim Visée
cf9b830f96 Various metrics tweaks (#7480)
* Change page fault metrics from gauges to counters

* Change collection_vectors_total to collection_vectors

* Rename metric for page faults in joined child processes

* Rename some procfs metrics

* Show single limit for number of open files

* For number of file descriptors and mmaps follow convential names

* Rename dead_shards_total to dead_replicas

* Fix metric prefix for gRPC entries, add missing underscore

A underscore was missing if no global prefix was set
2025-10-31 10:06:45 +01:00
Andrey Vasnetsov
7994816a1e remove filter level jwt (#7450)
* make jwt with payload filter fail

* remove `whole` access requirement

* remove unnecessary mut

* fmt

* adjust test

* fix test

* remove more tests

* fix test

* fix test again

* fix test again

* Replace deprecated PayloadConstraint with JSON Value placeholder

* Fix expect message

---------

Co-authored-by: timvisee <tim@visee.me>
2025-10-31 10:03:04 +01:00
Jojii
d21acf0e30 Fix panic on empty collections (#7478) 2025-10-30 14:48:18 +01:00
Jojii
5c0863ae8e Add global metrics prefix (#7438)
* Qdrant prefix for metrics

* Update metrics tests

* Update openapi docs

* Make prefix configurable

* don't enable metrics prefix by default

* Adjust tests and openapi specs

* Custom validation for metrics_prefix setting
2025-10-30 11:37:20 +01:00
Tim Visée
bb5f8b0df5 Bump MSRV to 1.89 (#7476) 2025-10-30 10:45:56 +01:00
Tim Visée
3581c1bee9 Bump dev version to v1.15.6-dev (#7477) 2025-10-30 10:45:49 +01:00
Andrey Vasnetsov
925d5127c8 remove init_from (#7454)
* wip: remove init_from

* remove init_from tests

* upd schema

* rm test
2025-10-29 17:37:02 +01:00
Andrey Vasnetsov
c1af720d0d remove lock api (#7449)
* remove lock api

* fix api count + remove tests

* remove another test

* remove more tests
2025-10-29 17:36:54 +01:00
Tim Visée
c64a297a7b Remove old shard key mapping format (#7047)
* Remove old shard key mapping format variant

* Change single variant enum into tuple struct

* Remove migration logic for old to new shard key format
2025-10-29 17:36:47 +01:00
Tim Visée
2b59214907 Skip RocksDB for mutable payload index and payload storage (#7433)
* For mutable payload index, don't create with RocksDB anymore

* For payload storage, don't create with RocksDB anymore

* Add missing dot

* Update OpenAPI spec
2025-10-29 17:36:37 +01:00
Jojii
9a69e02b1e Procfs metrics (#7451)
* Procfs metrics

* Clippy

* Fix compiling on non linux targets

* Move procfs up

---------

Co-authored-by: timvisee <tim@visee.me>
2025-10-29 17:27:25 +01:00
Tim Visée
c85c8db7fe Add repr(C) attribute to type used in MmapSlice (#7472) 2025-10-29 17:14:12 +01:00
Jojii
48d61f1719 Metrics vectors by name per collection (#7441)
* Add vector count per vector-name to metrics API

* Add to metrics API

* Improve TinyMap::get_or_insert_default and add tests

* Minor improvements

* Update openapi

* Review remarks

* Remove `collection_vectors` since it can be calculated manually
2025-10-29 17:00:53 +01:00
Jojii
c1e5b17dde Dead shards in /metrics (#7310)
* Dead shards in /metrics

* Update src/common/metrics.rs

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-10-29 16:48:06 +01:00
Jojii
c890d3aaa9 Add unindexed vectors to telemetry and metrics API (#7307)
* New metric for excluded vectors in indexed_only requests

* Make metric name align with prometheus naming convention

* Fix nit

* Fix tests

* Fix openapi

* Rename index_only into indexed_only

---------

Co-authored-by: timvisee <tim@visee.me>
2025-10-29 16:44:02 +01:00
Jojii
eff9107747 Add num points/vectors to metrics API (#7302) 2025-10-29 16:40:23 +01:00
Jojii
36bbc3ab69 Add replica metrics (#7301)
* Add replica metrics

* Clippy

* Properly ignore shards with resharding status

* Include 0 as value in metrics

* Remove total_active_replicas and total_expected_replicas

* Improve minimum active replica count in case of resharding

* Reorder metrics calls min < max (to trigger CI)

* Fix metrics help

* Fix typo

---------

Co-authored-by: timvisee <tim@visee.me>
2025-10-29 15:59:49 +01:00
Kumar Shivendu
9f0779ed16 Respect payload filters while replicating point (#7362)
* Respect payload and hashring filters while replicating point

* Merge points instead of replacing for filtered stream records transfer

* cleanup

* Update utils

* Allow filters in transfer

* drop hashring filter since its not required when destination has single shard

* test comment

* Pass actual filter

* use exact=True

* Forward updates that satisfy the filter

* make test long enough for extra points to be upserted

* minor improvements

* fix test

* try with only inserting new points

* Temporarily forward points that match before or after

* Fix failing test

* Only do inserts

* Dont merge points and update old points in test

* Fix the bug in integration test

* fix read_batch_with_hashring fn name and docs

* changes after rebase

* add validation check

* apply suggestions

* Always trim clock tag when forwarding to a different shard ID

* review fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-10-29 19:41:55 +05:30
Jojii
b3c6f40118 Add avx512vl and avx512vpopcntdq in telemetry (#7471) 2025-10-29 14:00:24 +01:00
Roman Titov
f107ee9eb7 Implement edge_py::Shard::query (#7465) 2025-10-29 13:27:54 +01:00
xzfc
3b55f856f4 Don't reuse links with vectors, optimize OldIndexCandidate::evaluate (#7467)
* links_empty

* Don't reuse links with vectors

* review fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-10-29 13:27:30 +01:00
Ivan Pleshkov
793b261016 avx512 for binary quantization (#7052)
* avx512 for binary quantization

fix build

* change checks order
2025-10-29 13:26:55 +01:00
Tim Visée
851d30a679 build(deps): bump starlette from 0.47.2 to 0.49.1 in /tests (#7470)
Bumps [starlette](https://github.com/Kludex/starlette) from 0.47.2 to 0.49.1.
- [Release notes](https://github.com/Kludex/starlette/releases)
- [Changelog](https://github.com/Kludex/starlette/blob/main/docs/release-notes.md)
- [Commits](https://github.com/Kludex/starlette/compare/0.47.2...0.49.1)

---
updated-dependencies:
- dependency-name: starlette
  dependency-version: 0.49.1
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-29 13:10:29 +01:00
xzfc
5dcfaf1af6 Replace RwLock<BitVec> with BitVec<AtomicUsize> (#7468) 2025-10-29 11:56:57 +01:00
Andrey Vasnetsov
37b0f71e26 Move Query Context into shard crate (#7459)
* Move modifier to segment level

* write idf modifier into segment config

* fmt

* use proper query context in edge

* simplify init_query_context
2025-10-29 11:39:16 +01:00
Tim Visée
45579756cb Access vector_data without risk of panicking (#7469)
* Get vector data checked to prevent panic

* Add invalid vector name error helper
2025-10-29 10:35:12 +01:00
Kumar Shivendu
bd744f5f61 Introduce fallback shard key for read and write requests (#7356)
* Allow passing fallback shard key on request level

* clippy & fmt

* Check target shard key replica states for routing

* fmt

* clippy

* Add shard fallback in gRPC

* updates

* clippy fix

* Check for empty replicas

* review: validate grpc shard key selector with fallback

* write routing logic (doesnt work yet)

* Don't hold shard holder guard for too long

---------

Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: timvisee <tim@visee.me>
2025-10-28 19:02:53 +01:00
dependabot[bot]
96a7a70759 build(deps): bump actions/download-artifact from 5 to 6 (#7461)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-28 11:01:27 +01:00
dependabot[bot]
ef1618ae0e build(deps): bump actions/upload-artifact from 4 to 5 (#7460)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-28 11:01:00 +01:00
xzfc
962c036b49 Drop docs/grpc/docs.md (#7453) 2025-10-27 11:23:26 +00:00