Commit Graph

606 Commits

Author SHA1 Message Date
Andrey Vasnetsov
e0d507dac7 Inference interface in REST and gRPC (#5165)
* include document & image objects into grpc API

* introduce image and object to rest api

* minor refactoring

* rename Vector -> VectorInternal

* decompose vector data structures

* add schema

* fmt

* grpc docs

* fix conversion

* fix clippy

* fix another conversion

* rename VectorInput -> VectorInputInternal

* replace grpc TryFrom with async functions

* fmt

* replace rest TryFrom with async functions

* add image and object into query rest

* separate inference related conversions

* move json-related conversions into a separate file

* move vector-related transformations into a separate file

* move more vector related-conversions into dedicated module
2024-10-09 10:15:46 +02:00
Tim Visée
082274bd68 Add wait parameter to cluster metadata API (#5174)
* Add blocking implementation of update cluster metadata

* Expose wait parameter to cluster metadata API

* Refactor shard transfer dispatcher into toc dispatcher

* Reformat
2024-10-08 13:03:59 +02:00
Andrey Vasnetsov
e76132b6e7 enable sparse snapshots (#5183) 2024-10-06 17:50:54 +02:00
dependabot[bot]
fa55b92ade build(deps): bump async-trait from 0.1.82 to 0.1.83 (#5155)
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.82 to 0.1.83.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.82...0.1.83)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-01 09:20:58 +02:00
Jojii
8980483416 [Strict mode] Merge StrictMode config types (#5137)
* merge StrictModeConfig and StrictModeConfigDiff into one type

* review remarks
2024-09-26 12:36:39 +02:00
Jojii
3595310706 [Strict mode] migrate toc_new -> toc (#5120)
* Replace all remaining calls of toc() with toc_new

* mirgate toc_new -> toc
2024-09-25 15:15:58 +02:00
Jojii
791d064bde [Strict mode] default config (#5037)
* add default config for strict mode

* add default values as example to config/config.yaml

* improve implementation

* update grpc docs
2024-09-25 14:22:36 +02:00
Jojii
fddb20ba1a [Strict mode] Finish REST requests (#4990)
* add strict mode to more requests

* add timeout check from request query

* unify timeout checking

* adjust functions not requiring strict mode

* add missing checks

* add Prefetch check for query api

* review remarks
2024-09-25 12:42:30 +02:00
Jojii
792bbb7523 Trigger optimizers when uploading snapshots (#5140)
* Trigger optimizers when uploading snapshots

* Trigger optimizers through new method when optimizer config is updated

* review remarks

* Add comment on why ignoring channel send errors is fine

* Remove obsolete return value omitting

---------

Co-authored-by: timvisee <tim@visee.me>
2024-09-24 17:52:03 +02:00
Arnaud Gourlay
d527ab9cd0 Promote atomicwrites to workspace (#5135) 2024-09-24 09:44:12 +02:00
dependabot[bot]
f6246b0e44 build(deps): bump atomicwrites from 0.4.3 to 0.4.4 (#5130)
Bumps [atomicwrites](https://github.com/untitaker/rust-atomicwrites) from 0.4.3 to 0.4.4.
- [Commits](https://github.com/untitaker/rust-atomicwrites/compare/0.4.3...0.4.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 21:24:50 +02:00
Roman Titov
318dd2f68a Refactor local_shard_points::delete_points API into cleanup_shard API (#5024)
Co-authored-by: timvisee <tim@visee.me>
2024-09-18 15:03:47 +02:00
dependabot[bot]
6c8da1669f build(deps): bump anyhow from 1.0.87 to 1.0.89 (#5094)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.87 to 1.0.89.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.87...1.0.89)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-17 07:29:52 +02:00
Andrey Vasnetsov
f179b67432 abort shard transer on delete of replica + check that we dont delete last active (#5079) 2024-09-16 14:37:33 +02:00
Andrey Vasnetsov
0585b70ba6 disable sparse tar arcive creation for backward compatibility (#5081) 2024-09-14 23:33:00 +02:00
xzfc
4ee7d87206 Switch to sparse tar implementation (#4943) 2024-09-10 14:07:47 +00:00
dependabot[bot]
21e96329fc build(deps): bump anyhow from 1.0.86 to 1.0.87 (#5047)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.86 to 1.0.87.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.86...1.0.87)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-10 07:45:06 +02:00
Andrey Vasnetsov
53f0186391 use atomic write to initially create alias mapping (#5039) 2024-09-07 15:29:41 +02:00
Roman Titov
1e2d513688 Abort resharding when aborting resharding shard transfer (#5020)
* Abort resharding when aborting resharding shard transfer

* fixup! Abort resharding when aborting resharding shard transfer

Fix typo 🙄
2024-09-06 17:39:09 +02:00
Jojii
004b5e5d26 [Strict-mode] Verification check in API (#4935)
* verification check in API

* review remarks

* minor review fixes [skip-ci]

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-09-04 14:19:02 +02:00
dependabot[bot]
2c6591bf01 build(deps): bump async-trait from 0.1.81 to 0.1.82 (#5010)
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.81 to 0.1.82.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.81...0.1.82)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-03 07:52:05 +02:00
Roman Titov
a5960f7ad2 Check that peer still exist, when applying finish transfer operation (#4968)
* Check that peer still exist, when applying finish transfer operation

* Simplify `Collection::finish_shard_transfer` method

* Simplify "peer exists" check

* Handle destination replica before source replica

* Only remove source replica, if destination replica is `Active`

* Tweak destination replica handling to be more like original impl
2024-08-31 09:38:05 +02:00
Jojii
e9bad464ff [Strict-Mode] Basic implementation (#4887)
* add CollectionRequestVerification

* add to api

* rebase

* improve implementation

* implement strict mode for SearchRequest+Batch

* improve code + fix Clippy

* improve error handling

* restructure StrictModeVerification trait

* generate docs

* check `enabled` option

* review remarks

* rename StrictModeConfigDiff in grpc

* use missing payload detection from issue api

* performance improvement

* decouple extractor from issues (#4945)

* some review remarks

* don't default to empty functions in StrictModeVerification trait

* update openapi

* filter_limit => query_limit

* replace discovery_max_context_size and recommend_max_examples with max_input_examples

* review remarks

* review fix: include possible index types into error message

* review remarks

---------

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2024-08-29 10:49:23 +02:00
Roman Titov
84a8b41e8c Cleanup actix::helpers module (#4951) 2024-08-27 10:19:28 +02:00
Andrey Vasnetsov
abd51d984a Implement better handling of UUID index (#4961)
* rename keyword -> string for internal data structures

* implement MatchAny and expect for filter on UUID mmap index

* implement MatchAny and expect for cardinality estimation on UUID mmap index

* refactor PayloadFieldIndex filter for handling incorrect empty query parsing case
2024-08-27 00:53:30 +02:00
Luis Cossío
045fb7038c Facets in REST (#4848)
* rename to FacetRequestInternal

* add rest endpoint

* fix correctness by fetching the whole list of values

* fix mmap map index variant

Also removes test for sorted output, for now

* add ytt spec

* fix clippy

* use hashmap inside of local shard

* rename operation to `facet`, add access test

* whitelist endpoint

* change api

* make limit optional
2024-08-19 16:03:26 -04:00
Arnaud Gourlay
caeb262e86 Search distance matrix REST API (#4884)
* Search distance matrix REST API

* apply Validator upgrade

* min sample size is 2 thanks Luis

* review: rethink pair view

* remove rows-based similarity matrix output

* fmt

* upd openapi

* we have only 70 apis now

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-08-19 00:21:55 +02:00
Arnaud Gourlay
c8844388d7 Update Validator 0.18 (#4894)
* Update Validator 0.18

* fix new test error message

* clearer geo error message

* fix error message

* fix unit tests

* Put spaces back

---------

Co-authored-by: timvisee <tim@visee.me>
2024-08-15 15:22:51 +02:00
Andrey Vasnetsov
44130a462e Mmap subcrate refactoring (#4886)
* make mmap_type independent from segment structures

* make bitvec and thiserror workspace dependencies

* move mmap_type into common/memory subcrate

* fmt
2024-08-14 11:04:56 +02:00
Luis Cossío
45eda816d5 Facet in Table of Content (#4817)
* implement facets in ToC

- implement CheckableCollectionOperation for FacetRequest
- implement facet in Collection

* complete facet of internal service + From<StorageError> refactor

- finalize connecting internal service to table of content
- make error_to_status a From implementation, refactor accordingly
2024-08-06 14:45:21 -04:00
Arnaud Gourlay
28c8639fa3 Add and fix missing timeout in the retrieve APIs (#4842)
* Add and fix missing timeout in the retrieve APIs

* no need for extra timeout handling as single ops are doing it

* don't surface timeout too high in shard transfer infra

* add todos for future work

* update timeout after first query
2024-08-06 18:59:23 +02:00
Roman Titov
c3acf332cb Add UpdateClusterMetadata consensus operation (#4766) 2024-07-31 21:34:24 +02:00
xzfc
26b0f08455 Tidy up integration tests (#4756) 2024-07-26 21:28:37 +02:00
Roman Titov
f8635ca42c Abort resharding when relevant consensus events happen (#4699)
Co-authored-by: Tim Visée <tim+github@visee.me>
2024-07-26 16:00:03 +02:00
Arnaud Gourlay
bd577c85d4 Fix Clippy 1.80 (#4752)
* Fix Clippy 1.80

* sync openapi spec

* add `check-cfg` setting to `workspace.lints.rust`

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2024-07-26 02:42:17 +00:00
xzfc
461b07a82b Bump prost and tonic (#4737)
* Bump tonic to 0.10.2 and prost to 0.12.6, keep old prost for raft

* from_i32 -> try_from
2024-07-23 20:46:01 +02:00
xzfc
a0ea3caccf Enable some of the pedantic clippy lints (#4715)
* Use workspace lints

* Enable lint: manual_let_else

* Enable lint: enum_glob_use

* Enable lint: filter_map_next

* Enable lint: ref_as_ptr

* Enable lint: ref_option_ref

* Enable lint: manual_is_variant_and

* Enable lint: flat_map_option

* Enable lint: inefficient_to_string

* Enable lint: implicit_clone

* Enable lint: inconsistent_struct_constructor

* Enable lint: unnecessary_wraps

* Enable lint: needless_continue

* Enable lint: unused_self

* Enable lint: from_iter_instead_of_collect

* Enable lint: uninlined_format_args

* Enable lint: doc_link_with_quotes

* Enable lint: needless_raw_string_hashes

* Enable lint: used_underscore_binding

* Enable lint: ptr_as_ptr

* Enable lint: explicit_into_iter_loop

* Enable lint: cast_lossless
2024-07-22 08:19:19 +00:00
Tim Visée
3aa8b173a8 On resharding start, wipe any existing state (#4682)
* Start with fresh state through SaveOnDisk directly

* Remove unused temporary directory parameter

* Add docs, init may persist on disk right away

* Apply review suggestion
2024-07-18 11:51:37 +02:00
Tim Visée
728b534086 Resume resharding driver on node restart (#4666)
* Resume resharding driver on restart if resharding is active

* Update resharding state comment started text

Using since versus started. 'Since' better clarifies that the current
state has been active since that time. While 'started at' could lead to
confusion on whether that time is for starting the whole resharding
operation or just that state.

* Add resharding resumption test during migrating points

* Recover resharding hash ring after loading shards

* Update resharding resume test, interrupt at multiple stages, less points

* Remove unused parameter

* Update collection shard count at resharding shard creation/destruction

* Apply suggestions from code review

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

* Use debug_assert_eq

* Remove trailing comma

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2024-07-17 17:02:16 +02:00
Arnaud Gourlay
bb9f9f8e94 universal-query: Grouping REST API (#4616)
* universal-query: Grouping REST API

* add API docs

* bump API count

* add jwt validation test

* fix API

* better test

* stay on CoreSearchRequest where possible

* use existing scoring helper

* push broken test to illustrate issue

* track best score per point_id to enable sort on payload

* add example test for query discover with groups

* track ScoredPoint instead of PointId

* add default values for smoother ux
2024-07-10 08:26:57 +02:00
dependabot[bot]
518a843b03 build(deps): bump async-trait from 0.1.80 to 0.1.81 (#4636)
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.80 to 0.1.81.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.80...0.1.81)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 09:33:23 +02:00
xzfc
90ce6cbd01 Add MmapHashMap (#4612)
* Promote some deps to workspace deps

* Add MmapHashMap

* Review fixups

* Use tempfile for atomicity
2024-07-08 17:44:52 +00:00
xzfc
9daf5799d2 Remove dead code (#4623) 2024-07-08 09:51:59 +02:00
Arnaud Gourlay
658a0beced Promote Rand dependency to workspace (#4606) 2024-07-03 13:11:11 +02:00
Arnaud Gourlay
e1b2af1a86 Promote log dep to workspace (#4605) 2024-07-03 12:35:04 +02:00
Ivan Pleshkov
5584ed0435 Fix colberts TODOs (#4566)
* Fix colberts TODOs

* are you happy clippy
2024-06-27 10:50:02 +02:00
Arnaud Gourlay
7c689f09db universal-query: lookup_from implementation (#4508)
* universal-query: lookup_from implementation

* pushin test demonstrating broken equivalence

* more tests and fixes

* validate fusion not use with 'using' field

* cleanup collection info propagation

* do not clone the query in CollectionQueryResolveRequest

* cleanup

* address last code review
2024-06-25 20:42:54 +02:00
dependabot[bot]
c2440938b8 build(deps): bump url from 2.5.1 to 2.5.2 (#4549)
Bumps [url](https://github.com/servo/rust-url) from 2.5.1 to 2.5.2.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v2.5.1...v2.5.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 10:22:40 +02:00
dependabot[bot]
2b5d4bd256 build(deps): bump proptest from 1.4.0 to 1.5.0 (#4548)
Bumps [proptest](https://github.com/proptest-rs/proptest) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/proptest-rs/proptest/releases)
- [Changelog](https://github.com/proptest-rs/proptest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/proptest-rs/proptest/compare/v1.4.0...v1.5.0)

---
updated-dependencies:
- dependency-name: proptest
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 09:43:52 +02:00
Tim Visée
f107b984f6 Connect resharding finish operation (#4503)
* End resharding and clean up

* Track resharding stage in `ReshardState`...

...and tweak `commit_read`/`commit_write`/`finish` ops to work properly

* Refactor hashring check for migrating and deleting migrated points

* When propagating deletes, only wait for the last batch

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2024-06-20 10:07:52 +02:00