Commit Graph

353 Commits

Author SHA1 Message Date
Luis Cossío
8dc1eb235b universal-query: some interface renaming/edits (#4406)
in grpc:
- restructure `ContextInput`, so that it becomes easy to handle both pairs and positive/negative lists in the future

in rest: 
- restructure context queries so that they don't repeat the label in order to be used . E.g. turn `{ query: { context: { context: [ ... ] } } }` into `{ query: { context: [ ... ] } }` 
- fixes fusion so that `{query: { fusion: "rrf" } }` actually works

both:
- renames `RecommendInput` positives and negatives to singular (same as in reco api)
2024-06-10 18:47:40 -04:00
Luis Cossío
6d0d542356 universal-query: Expose REST endpoint (#4380)
Exposes `POST collections/{collection_name}/points/query` for single queries
2024-06-10 11:55:46 -04:00
dependabot[bot]
c770688a22 Bump schemars from 0.8.20 to 0.8.21 (#4336)
* Bump schemars from 0.8.20 to 0.8.21

Bumps [schemars](https://github.com/GREsau/schemars) from 0.8.20 to 0.8.21.
- [Release notes](https://github.com/GREsau/schemars/releases)
- [Changelog](https://github.com/GREsau/schemars/blob/master/CHANGELOG.md)
- [Commits](https://github.com/GREsau/schemars/compare/v0.8.20...v0.8.21)

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

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

* Update OpenAPI specification

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: timvisee <tim@visee.me>
2024-05-28 16:09:25 +02:00
Luis Cossío
c8e82e75a8 universal-query: Converge API types into CollectionQueryRequest (#4304)
* rest -> collection

* grpc -> collection

* fix rebase

* use constants for defaults
2024-05-27 13:28:08 -04:00
Luis Cossío
b14d0b2463 universal-query: user-facing gRPC and REST request types (#4303)
* add grpc `QueryPoints`

* add rest types

* move to REST types to `api::rest::schema`, decouple `OrderByInterface` and `RecommendStrategy`

* openapi changes

* add score_threshold param

* decouple `ShardKeySelector`, add shard key param

* remove commented-out code

* new codespell
2024-05-24 08:23:12 -04:00
Luis Cossío
2a82ef41a0 universal-query: Introduce order_value field in ScoredPoint (#4291)
* - Fix ordering in group-by for custom scoring
- Rename `OrderingValue` -> `OrderedValue`
- Introduce `order_value` field in `ScoredPoint`

* modify `Ord` implementation

* rename to `OrderValue`

* `has_custom_scoring` -> `is_distance_scored`

* regen apis

* flip bools in `is_distance_scored`
2024-05-22 09:56:31 -04:00
Luis Cossío
bfa72bb6d8 universal-query: Add query() to ShardOperation trait (#4210)
* add `query` to shard trait

* add missing conversions for query

* update grpc docs

* Query response has intermediate results

* add ShardQueryResponse description

* move pub use to the top, keep only one way of reaching reexports
2024-05-15 09:36:46 -04:00
Ivan Pleshkov
e80844969f Float16 integration and API (#4234)
* f16 integration

tests

api

fix test

are you happy clippy

* fix build
2024-05-15 10:36:55 +02:00
Luis Cossío
4132d9a226 universal-query: Introduce new RawVector and VectorInput messages (#4209)
* Introduce `RawVector` and `VectorInput` messages

* gen grpc docs

* remove extra `optional`

* gen grpc docs
2024-05-14 11:40:11 -04:00
generall
bcc3e34298 fix openapi schema consistency 2024-05-13 23:04:26 +02:00
AMIR
0ee46a5c1c Simplify REST API nesting (#3323) (#3414)
* Simplify REST api nesting (#3323)

* tiny clarity refactor for test

* simpler generated openapi

* fix tests

* wrap deserializer functions into a struct impl

* fix null case

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2024-05-13 16:16:35 -04:00
Roman Titov
dae311e5e8 Add basic resharding types (#4216) 2024-05-13 13:31:03 +02:00
Jojii
2bbf491204 make grpc service type enums unique for UpdateCollectionClusterSetupRequest and PointsUpdateOperation (#4205)
* make grpc service type enums unique
2024-05-09 13:41:06 +02:00
Arnaud Gourlay
b602cb7daa gRPC API multivector for write and retrieve (#4179)
* gRPC API multivector for write and retrieve

* improve naming

* validate multiv + sparse

* code review

* regen gRPC docs

* remove incorrect validation
2024-05-08 19:28:47 +02:00
dependabot[bot]
369adcb093 Bump schemars from 0.8.17 to 0.8.19 (#4186)
* Bump schemars from 0.8.17 to 0.8.19

Bumps [schemars](https://github.com/GREsau/schemars) from 0.8.17 to 0.8.19.
- [Release notes](https://github.com/GREsau/schemars/releases)
- [Changelog](https://github.com/GREsau/schemars/blob/master/CHANGELOG.md)
- [Commits](https://github.com/GREsau/schemars/compare/v0.8.17...v0.8.19)

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

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

* Update OpenAPI specification

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: timvisee <tim@visee.me>
2024-05-07 10:41:40 +02:00
Arnaud Gourlay
571143ae87 Simplify MaxSim configuration (#4171)
* Simplify MaxSim configuration

* enable extension of multivectorconfig

* rename multi_vec_config to multivec_config
2024-05-06 14:19:42 +02:00
Arnaud Gourlay
4f797c1bb4 REST API multivector for write and retrieve (#4117)
* REST API multivector for write and retrieve

* add test showing search is not supported

* use helper

* debug asserts

* better naming

* iterator style

* better naming

* add validation test for checking all inner vectors have the same size
2024-05-03 10:55:17 +02:00
Tim Visée
8723b7e93e Add API key field to snapshot restore, fix snapshot recovery with API key (#4155)
* Add API key to HTTP client

* Add API key field to snapshot recovery requests

* Add API key to channel service

* Provide API key when doing snapshot transfer

* Configure API key header name constant in a central place

* Reformat

* Update OpenAPI spec

* Remove suffixed spaces from configuration file

* Allow to specify HTTP headers in some consensus test utility functions

* Add snapshot transfer test with configured API key

* Use random API key in test

* Fix compilation errors and clippy warnings
2024-05-02 17:10:34 +02:00
Luis Cossío
bf83dc4428 Issues API: Add clear_issues REST endpoint (#4125)
* add clear_issues rest endpoint

* review fixes

* update openapi

* fix number of apis checker
2024-04-29 12:01:01 -04:00
Andrey Vasnetsov
c173a9f5e5 Sparse idf dot (#4126)
* introduce QueryContext, which accumulates runtime info needed for executing search

* fmt

* propagate query context into segment internals

* [WIP] prepare idf stats for search query context

* Split SparseVector and RemmapedSparseVector to guarantee we will not mix them up on the type level

* implement filling of the query context with IDF statistics

* implement re-weighting of the sparse query with idf

* fmt

* update idf param only if explicitly specified (more consistent with diff param update

* replace idf bool with modifier enum, improve further extensibility

* test and fixes

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

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

* review fixes

* fmt

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2024-04-29 14:54:14 +02:00
Luis Cossío
9292dedb5c Issues API: Enable GET /issues endpoint (#4118)
* enable `GET /issues` endpoint

* add access test
2024-04-26 08:08:18 -04:00
Andrey Vasnetsov
44f2744d74 Byte storage api support (#4065)
* wip: include datatype in vector params API

* generate api schemas

* propagate datatype to segment creation

* fix review

* fmt
2024-04-18 15:22:28 +02:00
Andrey Vasnetsov
20eb2e1f2f remove usage of vectors_count (#4052)
* remove usage of vectors_count

* skip serialization if none

* add deprecated mention

* Add colon after deprecation note

---------

Co-authored-by: timvisee <tim@visee.me>
2024-04-18 15:22:01 +02:00
Ivan Pleshkov
224e4f600a Byte storage integration into segment (#4049)
* byte storage with quantization

raw scorer integration

config and test

are you happy fmt

fn renamings

cow refactor

use quantization branch

quantization update

* are you happy clippy

* don't use distance in quantized scorers

* fix build

* add fn quantization_preprocess

* apply preprocessing for only cosine float metric

* fix sparse vectors tests

* update openapi

* more complicated integration test

* update openapi comment

* mmap byte storages support

* fix async test

* move .unwrap closer to the actual check of the vector presence

* fmt

* remove distance similarity function

* avoid copying data while working with cow

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-04-18 00:42:17 +02:00
Mac Chaffee
3d8b553cd2 Update docs to mention safer production practices (#4028)
* Update docs to mention safer production practices

* Clarify that client-server is more performant, but still not prod ready
2024-04-17 11:20:55 -04:00
Arnaud Gourlay
885664ea66 Decouple named vector struct (#4014)
* Decouple NamedVectorStruct from REST API

* add NamedVectorStruct::MultiDense to segment

* update doc

* fully qualified segment types

* no need to ser/de anymore

* sprinkle required PartialEq

* new rbac code needs to convert
2024-04-12 14:38:57 +02:00
Arnaud Gourlay
b49000858a Multivec knob for SegmentConfig (#3963)
* Multivec knob for SegmentConfig

* regen openapi

* add TODO for next step

* introduce multivecconfig to support more similarity aggregation

* update openapi
2024-04-04 16:38:09 +02:00
Tim Visée
8560f15416 Add grey collection status (#3962)
* Add grey color for collection info status

* Restructure locks in local shard info method

* Set collection status to grey if we have pending optimizations

* Update OpenAPI specification and gRPC documentation

* Set optimizer status instead of color for compatibility reasons

* Only set and check for grey status if there are no other statuses
2024-04-04 10:04:02 +02:00
Andrey Vasnetsov
97241d04e7 add config property to disable jwt by default (#3923) 2024-03-27 14:05:01 +01:00
Ricardo Pallas
265bfa253c Removes method from abort shard transfer operation (#3803)
* Removes method from abort shard transfer operation

* Updates consensus test message assertion

* updates validation message
2024-03-26 14:27:33 +01:00
Tim Visée
70414af18d Expose the WAL delta transfer method in our OpenAPI specification (#3884) 2024-03-21 11:36:39 +01:00
Tim Visée
d7c888010a Switch to Recovery state, deprecated PartialSnapshot, for Qdrant 1.9 (#3847)
* Deprecate PartialSnapshot replica set state

* Improve logging

* Update gRPC docs

* Remove now obsolete migration TODO
2024-03-19 14:50:13 +01:00
Ivan Pleshkov
5766f030ab remove checksum path parameter for snapshot recovery in openapi (#3758) 2024-03-04 22:18:42 +03:00
Luis Cossío
3d3d8e15b8 Chore: Remove issues API from openapi spec (#3735)
* remove issues api from openapi spec

* update number of expected apis
2024-03-01 14:41:07 +01:00
Roman Titov
5f7e053eaf Logic tweaks for WAL diff shard transfer (#3719)
* Change `ClockMap` to always reject tick 0

* Enable rejecting operations in `LocalShard::update`...

...and propagate updated `clock_tick` back to the caller

* WIP: Retry operation on *all* nodes (with new tick)...

...if *any* node rejected the operation

* fixup! WIP: Retry operation on *all* nodes (with new tick)...

Keep the same `clock` for the whole duration of `update`

* Add update response status for clock rejection (#3725)

* Add clock rejected update status

* Don't hide internal items in docs

* Propagate clock rejected status if operation clock is too old

* Fix test in which we manually define clock ticks

* Expect forward proxy rejection, node already has that operation

* Add constant for first valid clock tick, init clocks in recovery point

* In testing, advance all zero clocks to start ticking from 1

* Attempt to fix clock_set_clock_map_workflow

* Rename WalError::Rejected to ClockRejected

* Limit retry attempts when operation is rejected for an old clock tick

* Don't log rejected clock tag if tick was 0

* Cleanup `ClockMap`/`RecoveryPoint`

* Cleanup `ClockSet` and `ShardReplicaSet::update`

* Fix `clock_set_clock_map_workflow` test

* add debug assertions

* fmt

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: generall <andrey@vasnetsov.com>
2024-03-01 12:32:03 +01:00
Tim Visée
7522d89f85 When restarting shard transfer, keep sync if old transfer was sync (#3728)
* When restarting shard transfer, use sync if old or new one had sync set

* refactor restart transfer models

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-02-29 19:15:35 +01:00
Tim Visée
e39c481b17 Add consensus operation to restart shard transfer (#3703)
* Add consensus operation to restart shard transfer with different config

* Require shard transfer restart to have a changed configuration

* implement api

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-02-29 17:03:21 +01:00
Luis Cossío
5deee2a419 OrderBy: Allow integer in StartFrom (#3726) 2024-02-29 12:22:30 -03:00
xzfc
78cc43361b Don't produce histograms in /telemetry JSON response (#3708) 2024-02-27 23:21:10 +00:00
xzfc
ca2cd46f29 Drop unused Deserialize (#3680) 2024-02-24 00:33:21 +01:00
Tim Visée
44fa95f6d5 Shard diff transfer integration (#3509)
* Add first stubs for WAL delta shard transfer method

* Repurpose queue proxy, use it for transferring WAL diff as well

* Integrate WAL delta transfer is transfer selection logic

* Add WalDelta shard transfer type which is not exposed in public API

* Basic implementation of falling back to stream records transfer

* Share await_consensus_sync function

* Ask remote shard for recovery point

* During WAL delta transfer, resolve shard diff locally for recovery point

* Rebase on latest dev, support empty WAL diff

* Rebase on latest dev, support empty WAL diff

* Use partial snapshot state for WAL delta transfer

* Set cutoff point on remote shard after shard WAL delta transfer

* Set cutoff point on remote shard after stream records transfer

* During WAL delta transfer, set s tate from partial snapshot to partial

* Describe WAL delta transfer in a comment

* Allow updating cutoff point in stream records transfer to fail

* Do not set cutoff point on remote shard on WAL delta transfer

* Make await consensus sync logic easier to read and reason about

* Fix fallback to other shard transfer method on WAL delta transfer fail

* Various minor improvements

* Add TODO for just ignoring API unimplemented errors

* Only allow stream records cutoff point error if remote is older version

* Allow switching to partial to fail when falling back

* Only change shard state to partial if not in partial state already

* Change default shard transfer method back to stream records

* Add important TODO back

* Add WAL delta shard transfer method in gRPC

* Prefer configured shard transfer method as default

* Extract shard transfer fallback logic into separate function
2024-02-23 17:32:22 +01:00
xzfc
ad606e7066 Report shard transfer progress (#3555)
* Shard transfer progress

* Add test

* Round to two decimals

* Use ringbuffer crate

* Text-based human readable report
2024-02-23 10:40:44 +00:00
Tim Visée
0f0c357e05 Add replica state: Recovery (#3659)
* Add recovery shard replica set state

* Accept forced operations in partial snapshot state

* Fix switching into wrong state

* Add some helpful comments

* Deduplication in match statement
2024-02-22 13:09:39 +01:00
xzfc
ff9e3a6ab9 Prometheus histogram support (#3552)
* Get rid of Arc in SegmentOptimizer::get_telemetry_counter()

* Get rid of SegmentOptimizer::get_telemetry_data

* Prometheus histogram support

* Fixes, and sparse buckets

* Preallocate in convert_histogram, merge_histograms

* debug_assert to check boundaries are sorted

* Generate histograms when details_level >= 3 or in /metrics
2024-02-22 10:39:33 +00:00
Luis Cossío
29c914de71 Issues API: Interface: get issues (#3502)
* add `/issues` endpoint

* generate openapi spec

* fmt

* fix read only patterns test

* list under beta tag, update tags descriptions.
2024-02-16 11:54:14 -03:00
Florents Tselai
5d74f95441 ALtered the protoc package url to work on osx/darwin too (#3632) 2024-02-16 13:32:19 +01:00
shylock
eff1fd821e Feat/set payload by key (#3548)
* Support set by key in low level.

* Rename key field.

* Format.

* Pass key.

* Format.

* Test.

* Clippy.

* Fix ci lint.

* Check grpc consistency.

* Update openapi.

* Fix empty key test case.

* Support array index.

* Format.

* Add test for non exists key.

* Clippy fix.

* Add idempotence test.

* Update index by updated payload.

* Add ut for utils.

* Add ut for 1 level key.

* Fix ut.

* Support no exits key.

* Fix test result.

* Fix after rebase

* handle wildcart insertion into non-existing array

* avoid double read of payload during update

* fix missing removing data from index in case if set_payload removes indexed field

---------

Co-authored-by: Shylock Hg <shylock@DESKTOP-40I855A>
Co-authored-by: Albert Safin <xzfcpw@gmail.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2024-02-15 15:15:05 +01:00
Kumar Shivendu
50fc2288d0 refactor: OpenAPI tests (#3606)
* test: Restructure OpenAPI tests

* fix: Remove cache dirs

* fix: Remove cache dirs from helpers

* fix: Path of openapi.json

* fix: Update path of openapi tests everywhere
2024-02-14 22:19:26 +05:45
Luis Cossío
5429a31423 remove secondary ordering by id description from order_by parameter (#3589) 2024-02-13 08:24:43 -03:00
generall
6ea6bed97a fix openapi 2024-02-11 17:01:31 +01:00