Commit Graph

346 Commits

Author SHA1 Message Date
Tim Visée
877ee63f00 Set correct OpenAPI version for v1.8.x release (#3783) 2024-03-07 10:10:13 +01:00
Tim Visée
e6411907f0 Bump version to 1.8.0 (#3779) 2024-03-06 10:38:44 +01:00
Ivan Pleshkov
17982377b0 remove checksum path parameter for snapshot recovery in openapi (#3758) 2024-03-05 17:16:38 +01:00
Luis Cossío
e153787662 Chore: Remove issues API from openapi spec (#3735)
* remove issues api from openapi spec

* update number of expected apis
2024-03-05 17:16:13 +01:00
Roman Titov
cb073c5b8c 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-05 17:16:11 +01:00
Tim Visée
b9f211af46 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-03-05 17:16:03 +01:00
Tim Visée
78c3797fbf 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-03-05 17:15:56 +01:00
Luis Cossío
8c762ee5b6 OrderBy: Allow integer in StartFrom (#3726) 2024-03-05 17:15:54 +01:00
xzfc
c4b862c492 Don't produce histograms in /telemetry JSON response (#3708) 2024-03-05 17:12:52 +01:00
xzfc
d50ec6c87c Drop unused Deserialize (#3680) 2024-03-05 17:12:14 +01:00
Tim Visée
137d87448f 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-03-05 17:10:16 +01:00
xzfc
2bdfa360e1 Report shard transfer progress (#3555)
* Shard transfer progress

* Add test

* Round to two decimals

* Use ringbuffer crate

* Text-based human readable report
2024-03-05 17:10:06 +01:00
Tim Visée
80681aa220 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-03-05 17:09:44 +01:00
xzfc
19f43f5b30 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-03-05 17:09:36 +01:00
Luis Cossío
049795ac0a 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-03-05 17:08:20 +01:00
Florents Tselai
7818a47702 ALtered the protoc package url to work on osx/darwin too (#3632) 2024-03-05 17:08:18 +01:00
shylock
87b541bb41 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-03-05 17:08:07 +01:00
Kumar Shivendu
f514b29641 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-03-05 17:07:42 +01:00
Luis Cossío
7ef8012c79 remove secondary ordering by id description from order_by parameter (#3589) 2024-03-05 17:07:26 +01:00
generall
852be5aa2f fix openapi 2024-03-05 17:04:56 +01:00
ding-young
112b5d66f3 Support Min should clause (#3331) (#3466)
* Add min_should field in Filter struct

* min_should clause checks whether at least given number (min_count) of conditions are met
* modify test cases due to change in Filter struct (set min_should: None)
* add simple condition check unit test
* docs, cardinality estimation, grpc not implemented yet

* Add min_should field in Filter struct

* min_should clause checks whether at least given number (min_count) of conditions are met
* modify test cases due to change in Filter struct (set min_should: None)
* add simple condition check unit test

* Impl min_should clause in REST API

* perform cardinality estimation by estimating cardinalities of intersection and combining as union
* add openapi spec with docs update
* add integration test

* Impl min_should clause in gRPC

* Cargo fmt & clippy

* Fix minor comments

* add equivalence test between min_should and must

* shortcut at min_count matches

* use `Filter::new_*` whenever possible

* Add missing min_should field

* Fix gRPC field ordering & remove deny_unknown_fields

* Empty commit

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2024-03-05 17:04:51 +01:00
Luis Cossío
fb46ec8af1 Order-by: support datetimes (#3540)
* support \`start_from\`: DateTime

* add order by datetime test

* generate openapi models and grpc docs

* fixup after rebase

* allow string representation of datetime in grpc

* add TODO

* fix `.start_from()`

* use custom deserialization on datetime
2024-03-05 17:04:26 +01:00
Jojii
3ee5aac011 Optimize MatchAny (#3525)
* add benches for large MatchAny

* use HashSet for MatchAny

* use fnv hash

* make fnv workspace level dependency; apply clippy

* remove SmolStr from Keyword; Improve performance

* add bench for small number of keywords

* fix openapi

* fix performance issue

* apply integer optimization; create magic number constant
2024-03-05 17:03:59 +01:00
Luis Cossío
9c93020bde Datetime index: Introduce RangeInterface (#3516)
* merge range and datetime range into one interface

* remove separate datetime_range from FieldCondition

* review fixes, remove code duplication. Thanks @xzfc

* update openapi test
2024-03-05 16:57:54 +01:00
Tim Visée
c6407abbb3 Dynamic CPU saturation integration (#3115)
* Integrate dynamic CPU saturation with public API changes

This reverts commit 08930fefa9.

* Call num_cpus only once
2024-03-05 16:57:43 +01:00
Luis Cossío
320b7f2621 order_by in scroll (#3493)
* first PR implementation (#2865)

- fetch offset id
- restructure tests
- only let order_by with numeric
- introduce order_by interface

cargo fmt

update openapi

calculate range to fetch using offset + limit, do some cleanup

enable index validation, fix test

Fix pagination

add e2e tests

make test a little more strict

select numeric index on read_ordered_filtered

add filtering test 🫨

fix filtering on order-by

fix pip requirements

add grpc interface, make read_ordered_filtered fallible

fmt

small optimization of `with_payload` and `with_vector`

refactor common logic of point_ops and local_shard_operations

Make filtering test harder and fix limit for worst case

update openapi

small clarity refactor

avoid extra allocation when sorting with offset

stream from numeric index btree instead of calculating range

use payload to store order-by value, instead of modifying Record interface

various fixes:
- fix ordering at collection level, when merging shard results
- fix offset at segment level, to take into account also value offset
- make rust tests pass

remove unused histogram changes

fix error messages and make has_range_index exhaustive

remove unused From impl

Move OrderBy and Direction to segment::data_types::order_by

Refactor normal scroll_by in local_shard_operations.rs

More cleanup + rename OrderableRead to StreamWithValue

empty commit

optimization for merging results from shards and segments

fix case of multi-valued fields

fix IntegerIndexParams name after rebase

precompute offset key

use extracted `read_by_id_stream`

Expose value_offset to user
- rename offset -> value_offset
- extract offset value fetching logic

* remove offset functionality when using order_by

* include order_by in ForwardProxyShard

* extra nits

* remove histogram changes

* more nits

* self review

* resolve conflicts after rebase, not enable order-by with datetime index schema

* make grpc start_from value extendable

* gen grpc docs

---------

Co-authored-by: kwkr <kawka.maciej.93@gmail.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2024-03-05 16:57:35 +01:00
xzfc
2f76603ddf DateTime payload index (#3395)
* Datetime payload index

* Introduce IndexMapItem

* Drop FieldIndex::DatetimeIndex

* Rename OpenAPI struct names

* Switch to microseconds

* Validate and serialize grpc timestamps

* Add tests with different timezones

* minor review fixes

* Revert "Drop FieldIndex::DatetimeIndex"

This reverts commit d55f251afd.

* Revert "Introduce IndexMapItem"

This reverts commit c5255f6b1a.

* fix: back to microseconds after reverts

* extract range conversion from boxed checker fn

* add log to deps

* don't run macro doctest

* no_run -> ignore

* remove prost-types in favor of prost-wkt-types

* better assertion on test_payload_indexing.py

* propagate unparsable datetime

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2024-03-05 16:57:08 +01:00
Gabriel
3392407f6a API for checking collection exists (#3472)
* saving progress

* tests assertions are working

* fixed lint

* fixed typo, existance -> existence

* added timing on grpc

* added timing on grpc

* fixed double time
2024-03-05 16:55:27 +01:00
xzfc
a11c6f6a5b add optional checksum to snapshot recovery request (#3381)
* add optional checksum to snapshot recovery request

* Update openapi yaml files

* Add pytests for snapshots restoration
2024-03-05 16:52:38 +01:00
xzfc
ebc31f265e Add latest_error_timestamp to message_send_failures (#3418) 2024-03-05 16:49:14 +01:00
Tim Visée
3281be7402 Rename IntegerParams to IntegerIndexParams to be consistent with text (#3385) 2024-03-05 16:47:18 +01:00
Tim Visée
820ade7494 Parameterize integer index, allow lookup or range exclusively (#3380)
* Merge serde attributes

* Remove obsolete conversion

* Add integer type with parameters

* Make integer lookup and range parameters non-optional

* Add parameterized integer index types test

Co-authored-by: Di Zhao <diz@twitter.com>

* Cleanup

---------

Co-authored-by: Di Zhao <diz@twitter.com>
2024-03-05 16:47:07 +01:00
kwkr
4296226555 Add checksum to SnapshotDescription (#2840)
* add checksum to SnapshotDescription

* implement storing snapshot checksums in a file

* Don't serialize checksum if it's None for backwards compatibility

* Remove hex dependency, use Rust std formatter for this

* Do not error if we cannot remove checksum file for snapshot

Some snapshots may not have a corresponding checksum file. Maybe it was
created in an older Qdrant version that didn't have support for this, or
a user hasn't provided any.

* Add debug message when hashing snapshot, can be expensive on large files

* Inline debug messages

* Add checksum to shard snapshots

* If creating snapshot fails, delete snapshot target and checksum file

* Use Rust idiomatic ok() and improve debug messages

* Use correct snapshot checksum paths, clean up after shard snapshot

* Use better path type in get_checksum_path

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2024-03-05 16:46:31 +01:00
Kumar Shivendu
0fe19cfb60 feat: Expose git commit id in the health check endpoint (#3346)
* feat: Expose git commit id in the health check endpoint

* fix: CI errors

* test: Add test for health check api

* feat: Add / endpoint to openapi schema

* Make git commit hash optional

* ci: Enable debugging setup-protoc action

* Install later protobuf compiler through GitHub Action

* Disable debug mode for setup-protoc job

* refactor: Use commit instead of commit_id

* fix: Use commit instead of commit_id gRPC docs

* test: Update ping API test

* refactor: Rename ping api to root api

---------

Co-authored-by: timvisee <tim@visee.me>
2024-03-05 16:46:04 +01:00
Andrey Vasnetsov
4c5596579e suggestions for 2024 roadmap (#3362)
* suggestions for 2024 roadmap

* Update docs/roadmap/README.md

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>

* Update docs/roadmap/README.md

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>

---------

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
2024-02-02 12:02:09 +01:00
Andrey Vasnetsov
dbab7f8c1c bump version 1.7.0 (#3175) 2023-12-08 01:46:36 +01:00
George
1c0d132111 replace enum in status codes with str (#3174) 2023-12-06 22:16:24 +01:00
Arnaud Gourlay
4f90cf4af2 Minor API documentation fixes (#3173)
* Minor API documentation fixes

* sync
2023-12-06 17:22:42 +01:00
Ivan Pleshkov
17827a33a1 Internal sparse configs for segment (#3168)
* internal sparse vector segment configs

update openapi

fix build

provide correct index type to fixtures

rename grpc stuff

optional search threshold

update api consistency

* review fix

* rollback rename

* reger docs

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-12-06 17:22:14 +01:00
Tim Visée
83c0606be9 Make point, vector and indexed vector counts optional in collection info (#2785)
* Make point, indexed point and vector counts optional in collection info

* Update OpenAPI specification and gRPC docs

* Use functional entry API

* Mark point/vector count fields as deprecated

* Use internal collection info structure to remove internal optionals

* Don't deprecate, but mark point counts as approximate
2023-12-06 17:21:55 +01:00
Luis Cossío
0cf21109eb Add web UI sync script to DEVELOPMENT (#3165) 2023-12-06 17:20:33 +01:00
Roman Titov
cb46a73609 Extend /readyz with shards readiness check (#3053, #3084)
Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: timvisee <tim@visee.me>
2023-12-06 17:20:29 +01:00
Kaan C. Fidan
8f19257f70 Manhattan distance (#3079)
* implemented Manhattan distance

* updated quantization dependency

* fixed negative distances and doc consistency

* fixed neon implementation

* updated quantization dependency

* updated quantization dependency

* removed redundant copy operation

* updated quantization dependency

* Change back to upstream quantization dependency

---------

Co-authored-by: timvisee <tim@visee.me>
2023-12-06 17:17:34 +01:00
Ivan Pleshkov
a8d634cc9b Sparse vector grpc configs (#3123)
* sparse vector grpc configs

* basic grpc test

* add todo comment

* fix integration test
2023-12-06 17:16:35 +01:00
Arnaud Gourlay
85c96cdd9a Integration tests sparse vector validation (#3122)
* Integration test for sparse vector validations

* cleanup

* clean again
2023-12-06 17:16:12 +01:00
Ivan Pleshkov
3fc1f96564 Sparse index segment and collection config (#2802)
* quantization storage as separate entity

sparse index try to extend segment types

fix build

fix async scorer

codespell

update openapi

update vector index

remove code duplications

more fixes

more fixes

fix build

fix deserialization test

remove transform_into

are you happy clippy

update openapi

update openapi

are you happy clippy

fix build

optional serialize

more defaults

update openapi

fix comments

generic transpose_map_into_named_vector

rename fields in tests

remove obsolete parts

only named sparse config

VectorStruct without unnamed sparse

NamedVectorStruct without unnamed sparse

remove obsolete test

update openapi

mmap index

revert preprocess function

are you happy fmt

update openapi

fix build

fix tests

are you happy fmt

fix for client generation

fix sparse segment creation

fix basic sparse test

fix conflicts

remove obsolete convertion

fix build

config diffs

update openapi

review remarks

update openapi

fix batch upsert

add failing test showing bad ids matching

fix sparse vector insertion

remove on_disk flag

update openapi

revert debug assert

simplify conversions

update openapi

remove on disk storage flag

update openapi

default for vector config

update openapi comment

remove diffs

update openapi

* enable consensus test

* add comment

* update openapi
2023-12-06 17:16:06 +01:00
Ivan Pleshkov
ee7a165d9b Optional sparse full scan threshold (#3116)
* optional sparse full scan threshold

* update openapi

* skip serializing if none

* review remarks
2023-12-06 17:15:57 +01:00
Wesley
8b7211cb20 Read-Only API keys (#2979)
* Read-only API keys

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>

Correct placement of OpenAPI security

Place regex dep with actix/tonic

* Read-only API keys

* Replace with pytests

* API Key tests run on the same job

* Drop allow dead-code

* Rename setting key

* Containerized tests

* No special config files

* DRY

* refactor: re-use can_write method

* refactor: replace static by constants

* refactor: get PID from `$!`

* refactor: use explicit brackets on boolean condition

* style: fix identation

* small fixes + account for new APIs

* specify security in openapi

* small fix + chmod for .sh testfile

* add best-efford check for api consistency

---------

Co-authored-by: Amr Hassan <amr.hassan@gmail.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2023-12-06 17:11:33 +01:00
Ivan Pleshkov
47690244bc Sparse vector grpc definition (#3070)
* Sparse vector grpc definition

remove obsolete use

update grpc docs

update openapi

more convertion fixes

update grpc docs

* validations

* review renamings

* add todos
2023-12-06 17:11:06 +01:00
Luis Cossío
3fd3ff215a refactor: turn offset into an option (#3082)
* refactor: make offset optional

* update openapi

* add simple test
2023-12-06 17:11:00 +01:00