Commit Graph

321 Commits

Author SHA1 Message Date
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
ding-young
62428e61e9 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-02-11 16:43:43 +01:00
Luis Cossío
87ba64a302 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-02-08 22:44:22 +01:00
Jojii
7f33ac1f63 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-02-08 12:50:58 +01:00
Luis Cossío
85d432b342 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-02-05 15:09:05 -03:00
Tim Visée
56171c6087 Dynamic CPU saturation integration (#3115)
* Integrate dynamic CPU saturation with public API changes

This reverts commit 08930fefa9.

* Call num_cpus only once
2024-02-05 14:08:02 +01:00
Luis Cossío
b0aab16b0d 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-02-04 18:46:22 +01:00
xzfc
41784a29bf 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-01-31 11:14:31 +01:00
Gabriel
e0ed12c3bf 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-01-29 13:39:42 +01:00
xzfc
e65fa10a6c 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-01-25 16:00:07 +01:00
xzfc
70745ae019 Add latest_error_timestamp to message_send_failures (#3418) 2024-01-22 11:39:57 -03:00
Tim Visée
cf8d13cf6c Rename IntegerParams to IntegerIndexParams to be consistent with text (#3385) 2024-01-12 16:16:22 +01:00
Tim Visée
e42f35b623 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-01-11 18:41:14 +00:00
Andrey Vasnetsov
fc57f944d6 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-01-11 10:05:26 +00:00
kwkr
6cfcce764d 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-01-10 13:03:50 +01:00
Kumar Shivendu
ea32150b0e 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-01-09 16:14:08 +05:30
George
c770d21a83 replace enum in status codes with str (#3174) 2023-12-06 17:29:01 +01:00
Arnaud Gourlay
70274a9a70 Minor API documentation fixes (#3173)
* Minor API documentation fixes

* sync
2023-12-06 15:08:44 +01:00
Ivan Pleshkov
83e2e167e8 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 13:28:17 +01:00
Tim Visée
325a9be27e 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 13:21:44 +01:00
Luis Cossío
e399392427 Add web UI sync script to DEVELOPMENT (#3165) 2023-12-05 15:44:49 -03:00
Roman Titov
f3c7cca417 Extend /readyz with shards readiness check (#3053, #3084)
Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: timvisee <tim@visee.me>
2023-12-05 17:59:46 +01:00
Kaan C. Fidan
c7402a45d7 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-02 21:28:38 +01:00
Ivan Pleshkov
da30d59b75 Sparse vector grpc configs (#3123)
* sparse vector grpc configs

* basic grpc test

* add todo comment

* fix integration test
2023-12-01 20:36:32 +01:00
Arnaud Gourlay
0b3efb2bc2 Integration tests sparse vector validation (#3122)
* Integration test for sparse vector validations

* cleanup

* clean again
2023-12-01 14:08:42 +01:00
Ivan Pleshkov
336efea59e 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-01 13:10:58 +01:00
Ivan Pleshkov
8dcf63c509 Optional sparse full scan threshold (#3116)
* optional sparse full scan threshold

* update openapi

* skip serializing if none

* review remarks
2023-11-30 21:47:30 +01:00
Wesley
8b806f90de 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-11-23 21:58:35 +01:00
Ivan Pleshkov
4f7afa46c3 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-11-23 14:01:29 +01:00
Luis Cossío
94fe916ebc refactor: turn offset into an option (#3082)
* refactor: make offset optional

* update openapi

* add simple test
2023-11-22 15:05:54 -03:00
Luis Cossío
215292709d Update main and roadmap READMEs (#3055)
* add dotnet sdk as official client

* update roadmap achievements
2023-11-22 14:23:53 +01:00
Arnaud Gourlay
bbc7b37123 Accept empty sparse vectors (#3057)
* Accept empty sparse vectors

* sparse vector index is responsbile for filtering empty vectors
2023-11-21 11:27:12 +01:00
Ivan Pleshkov
0607be64c9 Sparse vectors rest search and upsert (#3051)
* sparse vector sparse search and upsert

are you happy fmt

fix build

update openapi

batch changes

update openapi

named sparse vector

* review remarks

* cowvalue to cowvector
2023-11-21 09:18:15 +01:00