Commit Graph

485 Commits

Author SHA1 Message Date
Arnaud Gourlay
3c19eea9ca Rate limiting for shard operations (#5582)
* Rate limiting for shard operations

* address all review comments in one go
2024-12-09 11:18:50 +01:00
Jojii
0702854477 Strict mode max collection vector size (#5501)
* Strict mode config: Max collection size

* api specs

* Add tests + set/update payload check

* Improve function names and add comments

* rename config to separate vectors and payload

* fix tests

* Adjust configs docs

* add benchmark

* improve performance by caching shard info

* add bench for size_info() and fix tests

* Also limit the batch-size for vector updates (#5508)

* Also limit the batch-size for vector updates

* clippy

* add lost commit

* Load cache on collection initialization

* add unit type to parameter name

* fix renaming in test

* clearer error message

* fix test

* review remarks

* remove unused function for now

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2024-12-09 11:18:33 +01:00
Ivan Pleshkov
4f99e728aa GPU HNSW integration (#5535)
* gpu hnsw

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2024-12-09 11:18:16 +01:00
Arnaud Gourlay
d47c8f916a Expose payload storage size in segment info (#5552) 2024-12-09 11:15:06 +01:00
Luis Cossío
c10c145a75 Compatibility for mmap sparse vectors (#5454)
* implement mmap sparse vector storage

* add to VectorStorageEnum

* clippy

* add tests, fix both simple and mmap storages

* smol correction on total_vector_count

* add sparse storage type to config

* fix reading config without storage type

* generate openapi

* use blob_store by path

* hidden setting to enable new storage

* validate existing path in `BlobStore::open()`

* use new dir for each sparse vector name

* fix and rename `max_point_offset`

Plus some extra refactors

* add storage compat test, to always check both storages work

* fix opening of storage + other misc fixes

* FIX!!!

`Unset` operations in the Tracker weren't updating the
`next_pointer_id`. So, when reopening the storage, those points wouldn't
get marked as deleted in the bitslice, thus creating the illusion that
they should exist, when they did not.

* refactor naming from `iter_*` to `for_each_*`

* fix checking for BlobStore existance

* fix typo

* fix error message

* better docs for open_or_create

* fix after rebase
2024-12-09 11:07:01 +01:00
Tim Visée
ed05a46889 Expose shard keys in telemetry (#5522)
* Add shard key to replica set

* Expose shard key in replica set telemetry

* Update OpenAPI specification

* Fix two spelling errors
2024-12-09 11:06:27 +01:00
Jojii
7b83223c8c Add max upsert batch size strict mode option (#5485) 2024-12-09 10:48:49 +01:00
Jojii
fd1b75873e Add hardware metrics to /metrics and /telemetry API (#5408)
* add hardware metrics to /telemetry and /metrics

* move all_hw_metrics function
2024-12-09 10:47:48 +01:00
Luis Cossío
21ba00d284 Transfer blob_store into this repo (#5436)
* copy-paste blob_storage

* get rid of copied utils

* fix clippy

* fmt

* audit blob_store manifest

* move `Payload` into `fixtures.rs`

* fix clippy

* put csv in google storage

* ignore hm test

* fix codespell

* improve files test

* test different block sizes

* remove unused deps

* replace StdRng with SmallRng for faster tests
2024-12-09 10:45:43 +01:00
Roman Titov
9e06d68661 Add UUID to collection config (#5378)
* Add UUID to collection...

...and recreate collection, when applying Raft snapshot, if UUID of collection is different

* fixup! Add UUID to collection...

Remove UUID field from gRPC and exclude it from OpenAPI spec 🤡

* fixup! fixup! Add UUID to collection...

Always generate collection UUID 🤦‍♀️

* Raft snapshot recreate collection no expose UUID (#5452)

* separate colleciton config structure from API

* fmt

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

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

---------

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

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
Co-authored-by: Tim Visée <tim+github@visee.me>
2024-11-18 11:19:51 +01:00
n0x29a
9f8ae97ed5 allow inference for Documents in points (grpc + rest) (#5447)
* allow inference for Documents in points (grpc + rest)
* move validation to documents & images

---------

Co-authored-by: n0x29a <n0x29a@example.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2024-11-18 11:18:12 +01:00
Andrey Vasnetsov
28a89060d1 use more stable computation of vectors_size_bytes + refactoring (#5437)
* use more stable computation of vectors_size_bytes + refactoring

* sync openapi
2024-11-18 11:16:57 +01:00
Luis Cossío
6c162656f3 Backward compatibility for mmap payload storage (#5398)
* support mmap storage backward compat

* fix clippy

* review fixes + bump + restore Cargo.lock

* fix clippy

* map_err instead of match

* add sanity tests for payload storage trait

* fix clippy

* error conversion

* test persistance too

* add config to enable mmap storage (#5434)
2024-11-18 11:11:56 +01:00
George
609d5c5d46 Make model name field mandatory in inference structures (#5431)
* Make model name field mandatory in inference structures

* fix batch tests
2024-11-18 11:09:51 +01:00
Andrey Vasnetsov
17bce6e458 Async fixes (#5426)
* expose async in telemetry

* move async scorer config to proper section (as it was documented)

* temporary disable mmap prefault

* rollback prefault_mmap_pages

* upd openapi
2024-11-12 14:40:06 +01:00
Luis Cossío
719f4f4094 Make default_on_disk_payload consistent with config file (#5396)
* make the default `on_disk_payload` match the default config value

* remove duplicate impl, update docstrings

* change default `PayloadStorageType` too

* gen openapi
2024-11-12 14:39:25 +01:00
George
c366debede update Image.image type to Value instead of string (#5403)
* update Image.image type to Value instead of string

* apply cargo fmt

* fix tests
2024-11-12 14:39:09 +01:00
Jojii
13cabb32e4 Add hardware usage to grpc API (#5333)
* Add hardware usage to grpc API

* generate grpc docs
2024-11-08 11:25:36 +01:00
Jojii
cc807cbfbc Add hardware measurements in API (#5306)
* add HwMeasurementAcc and API helpers+types

* add config to API to toggle hardware reporting in API responses

* add Default impl for HwMeasurementAcc

* comments

* review remarks

* include usage into API schema

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-11-08 11:19:25 +01:00
Andrey Vasnetsov
bcf05d9e23 HasVector filtering condition (#5303)
* include vector storage into struct vector index

* implement has_vector

* generate schemas

* refactor query filter optimizer so avoid too many function arguments

* test + fix for sparse vectors

* Update lib/segment/src/index/struct_payload_index.rs

Co-authored-by: Jojii <15957865+JojiiOfficial@users.noreply.github.com>

* Update lib/segment/src/index/query_optimization/optimizer.rs

Co-authored-by: Jojii <15957865+JojiiOfficial@users.noreply.github.com>

* fmt

---------

Co-authored-by: Jojii <15957865+JojiiOfficial@users.noreply.github.com>
2024-11-08 11:17:37 +01:00
Kumar Shivendu
390d4c4503 Track vector storage usage in bytes for each of the segments (#5292)
* Track disk usage for each of the vectors and segments

* Dont extend vector_data field

* Remove comment and improve var name

* Introduce vectors_size_bytes and rename available_size_in_bytes

* Introduce vectors_size_bytes and rename available_size_in_bytes

* fix linter

* Avoid converting to u64

* calculate vectors_size_bytes for proxy segments

* Fix OpenAPI spec

* fix typo
2024-11-08 11:16:04 +01:00
Arnaud Gourlay
b2a7f01236 Report memory usage in metrics & telemetry (#5266)
* Report memory usage in metrics & telemetry

* Fenster reparatur

* fix error handling & openapi spec

* follow naming convention

* show memory stats on level1

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-11-08 11:15:43 +01:00
Kartik Gupta
2f5e7d2eb0 Remapping tags to api docs (#5104)
* Remapping tags to

* Declare new tags, v1.12 remapping

* Declare Indexes, Aliases

---------

Co-authored-by: Anush <anushshetty90@gmail.com>
2024-11-08 11:15:37 +01:00
Tim Visée
bdf8242413 Minor improvements around the WAL delta fix (#5286)
* Restructure WAL delta logic, similar to what we had before the patch

* Tweak comments to elaborate on data race fix

* Refactor recovered function, not snapshot specific anymore

* Remove partial snapshot replica set state from schema
2024-11-08 11:12:01 +01:00
Arnaud Gourlay
d4716da8e7 fix lints for Clippy 1.82 (#5229)
* fix lints for Clippy 1.82

* regen openapi
2024-11-08 10:59:36 +01:00
Jojii
a0de9509d7 Add strict mode config to update collection API + Populate strict mode in API (#5187)
* add strict mode to update collection API

* update API specs

* clippy

* Update lib/storage/src/content_manager/toc/collection_meta_ops.rs

* Strict mode integration tests (#5189)

* Add integration tests for strict mode

* add full update test

* Apply suggestions from code review

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

* Adjust error messages

* improve checking of error response

---------

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

* prefer explicit structu conversion

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: generall <andrey@vasnetsov.com>
2024-11-08 10:59:32 +01:00
Andrey Vasnetsov
1d0ee7ea32 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-11-08 10:55:15 +01:00
Tim Visée
347c1945b1 Report CPU endianness in telemetry output (#5180)
* Report CPU endianness in telemetry output

* Make endianness optional, don't report if anonymizing telemetry

* Update OpenAPI definition

* Switch back to single compile time endianness check

* Update OpenAPI specification

* Remove cpu-endian dependency

* De-anonymize CPU endianness

---------

Co-authored-by: xzfc <xzfcpw@gmail.com>
2024-11-08 10:54:46 +01:00
Andrey Vasnetsov
a0d2eccac0 bump version to v1.12.0 (#5203) 2024-10-08 14:33:47 +02:00
Andrey Vasnetsov
8a66b38368 make operationId consistent with grpc (#5201) 2024-10-08 13:36:20 +02:00
Ivan Pleshkov
aa7e33b68b mmap geo index api (#5163)
* define mmap geo index

fix compilation

deleted flags

load new mmap

geo index tests

fix tests

fix build after rebase

add files list

* refactor get_stored_sub_regions output type

* review remanings

* mmap geo index api

* fix after rebase
2024-10-08 13:30:08 +02:00
Luis Cossío
ad6b9734f3 Facets: Support for bool payload (#5100)
* enable faceting with boolean index

* test and fix

* also test uuid
2024-10-08 13:11:36 +02:00
Jojii
05b8dca540 [Strict mode] Merge StrictMode config types (#5137)
* merge StrictModeConfig and StrictModeConfigDiff into one type

* review remarks
2024-10-08 13:10:33 +02:00
Jojii
0b236d8107 [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-10-08 13:09:56 +02:00
Luis Cossío
cf89715036 Expose on_disk text index (#5074)
* map index: fix reachable code marked as unreachable

* plumber work to get mmap text index to interfaces

* test: add fixture for mmap text index, always create mmap segment

* various fixes

- ensure dir is created for mmap
- implement is_on_disk() for text index
- invert deleted condition for filter in mmap inverted index

* update grpc docs and openapi

* implement return of files

* review nit

* fix after rebase

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-09-17 15:30:17 +02:00
Andrey Vasnetsov
1589d119fc make resharding_operations optional, so OpenAPI is properly generated (#5060)
* make resharding_operations optional, so OpenAPI is properly generated

* Return None early

---------

Co-authored-by: timvisee <tim@visee.me>
2024-09-17 15:28:36 +02:00
Kumar Shivendu
70c46bbb6f Track number of points optimized and expose in telemetry (#5000)
* Track number of points optimized and expose in telemetry

* refactor

* openapi specs

* remove dbg

* Return num points optimized from optimize() func

* fmt

* fix

* fix type in tests

* Store total points indexed on shard level instead of optimization level

* fmt

* fix test

* trigger ci

* fix openapi schema

* review fixes

* fmt

* improvements and fix test

* review fixes

* use const for indexing optimizer name

* fmt

* return segment id from optimize() func

* review fixes

* fix

* fix

* fik

* minor var name improvement

* Use Option<usize> to return segment id

* Use segment ID type rather than ambiguous usize

* fix test

* avoid intermediate check

* review fixes

* Rename total_indexed_points to total_optimized_points

* Update openapi schema

* optimize() should return number of points in new segment instead of segment id

* add else condition

* take read lock

* fmt

* remove flaky assert

* Count points on new segment without locking

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: generall <andrey@vasnetsov.com>
2024-09-17 15:28:00 +02:00
Tim Visée
4f7b675fe8 Remove max_segment_number from quick start and OpenAPI definition (#5058) 2024-09-17 15:27:53 +02:00
Andrey Vasnetsov
52700c52d8 custom key to hide kwt dashboard (#5056) 2024-09-17 15:27:12 +02:00
Tim Visée
41ea2bc75c Expose cluster metadata in telemetry (#5019)
* Expose cluster telemetry in metadata

* Only expose metadata in telemetry for details level 1 and up

* Update OpenAPI specification

* move metadata into cluster telemetry

* regen openapi

* use Option instead of raw hashmap

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2024-09-17 15:26:26 +02:00
Arnaud Gourlay
0de10604fb Distance matrix docs improvements (#5023)
* docs improvements

* improve openapi description
2024-09-17 15:26:19 +02:00
Kumar Shivendu
3568286132 Introduce grey collection status and expose shard status in telemetry (#4940)
* Expose shard status in telemetry API

* fmt

* Drop segment lock before using async fetching shard status

* Use Self in From implementation for ShardStatus to CollectionStatus mapping

* Improve comments

* Remove redundant clone

* Update openapi specs

* Isolate function for shard status

* Fix compiler error

* Avoid adding dedicated function for shard status

* review fixes

* define missing var

* lint err

* comment

* comment

* refactor

* improve comments

* Improve comments

* fix lint and update openapi specs

* improve comment
2024-09-17 15:26:09 +02:00
Arnaud Gourlay
ba57d63200 gRPC API for Distance Matrix (#5011)
* gRPC API for Distance Matrix

* generate API docs

* apply correct limit to sample

* add JWT tests

* pluralitiy

* fix COO naming

* drops COO as it trips codespell and is redundant

* clarify docs
2024-09-17 15:26:02 +02:00
Jojii
3377530c62 [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 15:24:11 +02:00
Luis Cossío
f7de6c9017 Facets: add consistency param to openapi (#4969)
* add consistency param to openapi

* interpret uuid map index as facet index too
2024-08-29 15:24:05 +02:00
Luis Cossío
4b429214cc Integer and UUID facets (#4946)
* move FacetIndex into facet_index.rs

* add support for integer facets

* add support for uuid facets

* use separate internal structure

* rename FacetValue::Keyword into FacetValue::String in REST

* fix after rebase
2024-08-28 15:18:21 +02:00
Tim Visée
29f7861d31 Expose resharding operations for collection in telemetry (#4938)
* Expose resharding operations for collection in telemetry

* Update OpenAPI spec
2024-08-28 15:18:18 +02:00
Andrey Vasnetsov
9573162ffe include peers list into telemetry (#4947) 2024-08-27 01:14:45 +02:00
Andrey Vasnetsov
35e0ef8a7d Data structures for inference (#4936)
* add document to VectorStruct

* fmt

* add document to BatchVectorStruct

* add document to VectorInput

* add document to Vector

* upd openapi
2024-08-27 01:13:19 +02:00
Luis Cossío
5f5fd25d64 Add grpc endpoint for Facet (#4933)
* add grpc endpoint

* gen grpc docs
2024-08-27 01:13:12 +02:00