Commit Graph

3618 Commits

Author SHA1 Message Date
Andrey Vasnetsov
65312a1e82 implement shard key init state in grpc (#7522)
* implement shard key init state in grpc

* Update lib/api/src/grpc/proto/collections.proto

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

* sync grpc autogen

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-11-12 15:05:17 +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
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
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
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
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
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
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
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
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
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
Andrey Vasnetsov
b037910c2f Implement logging of slow requests for scroll, facet, count, and retrieve (#7291)
* reorder arguments of scroll_by

* add slow request log for scroll request

* add slow request log for facet request

* add slow request log for count request

* add slow request log for retrieve request

* Remove obsolete clone

* generic implementation of Loggable for Arc

* Refactor scroll by arguments (#7296)

* separate internal scroll operation from the one used by user

* fmt

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-10-27 11:19:25 +01:00
xzfc
6c4ad118d1 Misc edge dev env fixes (#7456) 2025-10-25 10:48:18 +02:00
xzfc
67db9ff241 Expose AcornSearchParams to edge Python bindings (#7455) 2025-10-25 10:46:33 +02:00
xzfc
c1c9eb9ddb Add ACORN-1 search (#7414)
* GraphLayersBase::try_for_each_link

* Add FilteredScorer::score_points_unfiltered

* Add GraphLayersBase::search_on_level_acorn()

* Add SearchParams::acorn API parameter

* Integrate ACORN to HNSW search

* Add doc

* review fixes

* Misc fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-10-24 19:09:21 +00:00
Kumar Shivendu
addb74cc28 Implement logic to replicate points between shards (#7361)
* Allow replicating points between shards

* Add integration test for replicating points between shards

* Drop filter from ForwardProxyShard to for now

* Clean up test

* fix assert failures

* Fix integration test

* Drop reliance on FilteredStreamRecords

* minor improvements
2025-10-24 16:39:04 +05:30
Roman Titov
c2be7855ac Implement edge::Shard::query (#7440)
Co-authored-by: generall <andrey@vasnetsov.com>
2025-10-23 21:39:29 +02:00
Roman Titov
0281cd1952 Cleanups for shard crate and related stuff (#7445) 2025-10-23 20:24:21 +02:00
Roman Titov
bfda43f4c5 Move mmr into shard crate (#7429) 2025-10-23 11:16:20 +02:00
Jojii
f2c012732e Currently running optimizers in Metrics (#7316)
* Currently running optimizer count in metrics

* Clearly state the prerequisites of count_optimizers_running()

* Minor improvements

* improve metric naming
2025-10-23 10:45:59 +02:00
Roman Titov
06e9b26f07 Implement edge::Shard::query_scroll (#7426) 2025-10-21 22:03:54 +02:00
Tim Visée
27cf6e381e Improved segment flush ordering (#7381)
* Re-sort segments on flush, don't use proxy but inner segment state

* Also sort segments when proxying all segments for snapshot

The snapshot operation explicitly flushes segments. We therefore must
satisfy flush ordering there too.

* Add some helpful comments

* Add explicit flush ordering enum for segments

* Minor tweaks

* Fix spelling in comment

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2025-10-21 16:21:24 +02:00
Andrey Vasnetsov
fd75821c97 rate limit slow request warning queue (#7434)
* rate limit slow request warning queue

* Update lib/collection/src/profiling/slow_requests_collector.rs

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

* fmt

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-10-21 14:45:12 +02:00
Tim Visée
f106430225 Deduplicate iter_internal and iter_ids in ID trackers (#7428)
* Switch from iter_ids to iter_internal

* Remove iter_ids function

* Rename iter_ids_excluding to iter_internal_excluding
2025-10-21 10:25:54 +02:00
Kumar Shivendu
b8ac6741d4 Introduce replicate points action (#7063)
* Introduce new replicate points action

* fmt

* Introduce filter in shard transfer and new transfer method

* clippy & fmt

* Update OpenAPI specs and gRPC API

* Update gRPC docs

* Take from/to shard key as input for replicate_points

* update gRPC docs

* Make filters optional

* fmt

* clippy

* drop FilteredStreamRecords

* Add validation

* update gRPC docs

* Drop FIlteredStreamRecords

* clippy

* update openapi spec

* review fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-10-20 22:45:52 +02:00
Andrey Vasnetsov
29a1197c4e derive Eq for Filter (and underlying types) (#7419)
* derive Eq for Filter (and underlying types)

* fix tests

* use ptr to compare and hash CustomIdChecker

* fix gpu test

* fmt

* use OrderedFloat directly

* post-rebase fixes

* fmt

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2025-10-20 17:27:03 +02:00
Luis Cossío
41a33167df [relevance feedback] Feedback in CollectionQuery (#7386)
* rename `NamedQuery::new_from_vector` -> `NamedQuery::new

* add feedback query in CollectionQuery. Extract pairs from feedback

* add tests

* fmt

* parameterize num pairs

* rename Linear to Simple

* follow refactor from base branch
2025-10-20 12:05:45 -03:00