Commit Graph

473 Commits

Author SHA1 Message Date
Roman Titov
3f4dbe50a4 Remove resharding driver (#5782)
* Remove resharding driver

* Trigger CI 🙄

* fixup! Remove resharding driver

Update OpenAPI spec
2025-01-13 14:46:42 +01:00
Jojii
9ad886691e IO metrics in hw counter types (#5769)
* io metrics in hw counter types

* Add new metrics to `new_with`
2025-01-10 18:28:34 +01:00
Tim Visée
306f4a88ce Resharding: expose operations in cluster info (#4599)
* Expose resharding operations in cluster info

* Fix collection info conversion to gRPC
2025-01-10 11:50:31 +01:00
Tim Visée
f4c927d3eb Make resharding UUID required, hide field in OpenAPI schema (#5750) 2025-01-07 11:36:21 +01:00
Tim Visée
5cd8b645fd Resharding: add UUID to resharding operation (#5736)
* Add optional UUID to resharding operations

* Generate random UUID for resharding if not specified by user

* Update OpenAPI specification
2025-01-07 09:54:24 +01:00
Andrey Vasnetsov
c8553a6863 add details-level params to openapi (#5719) 2025-01-03 10:22:43 +01:00
Tim Visée
5bf2af35b3 Expose the PartialSnapshot replica state (#5715) 2025-01-02 16:27:45 +00:00
xzfc
46d87700e9 Add Tango.rs doc (#5688) 2024-12-24 21:23:36 +00:00
Roman Titov
8beb1106a6 Abort scale-down resharding on update error (#5670) 2024-12-24 13:58:32 +01:00
Tim Visée
fc690e7727 Add task to clean local shard in the background (#5677)
* First naive implementation of local shard clean task

* Add wait and timeout parameters to clean shard API

* Cancel shard cleaning and mark as dirty when changing hash rings

* Expose shards undergoing cleaning in telemetry

* Properly cancel shard clean task, add drop guard to enforce

* Ensure we have a local shard to clean

* Replace existing local shard cleanup API

* Refactor how we create, manage and await clean tasks

* Invalidate only affected shards when committing read hash ring

* Expose all local shard clean task statuses in telemetry

* Properly invalidate shards when aborting resharding

* Add review remark comments

* Log clean task errors, extract task in dedicated function

* Join task when invalidating so we wait for completion

* Invalidate shard clean tasks in a batch to more efficiently join them

* Expose clean progress with number of deleted points

* Annotate cancel safety

* Fix comment

* When calling clean endpoint, ensure we have the specified local shard

* Invalidate shard cleaning when a local shard is being dropped

* Prevent anonymous type in shard clean status telemetry

* Cancel shard clean task directly by dropping future, fix possible deadlock

Before this change trying to invalidate shard cleaning tasks could
deadlock. The actual task only had two cancel points inside a read lock
on the shard holder. The shard holder is constantly released and
relocked.

In some of the places we can trigger invalidation already hold a shard
holder write lock. The task itself would have to grab a read lock in
order to reach the cancel point, in which case the locks would be
fighting each other.

Because invalidation also joins the task and waits for it to abort this
could get stuck forever.

Now we don't have cancellation points anymore and simply drop the whole
future in case of cancellation. That'll prevent it getting stuck.
2024-12-23 14:06:52 +01:00
Tim Visée
2f7cde3d45 Fix collection creation validation, disallow replication factor 0 (#5643)
* Validate default collection config in settings

* Validate shard number, replication/write consistency factor in gRPC

* Cleanup

* Add more validation rules

* Also validate strict mode config in gRPC CollectionConfig

* Update OpenAPI specification
2024-12-20 12:07:58 +01:00
Jojii
97da5a2942 [Strict Mode] Max collection size in distributed setup (#5592)
* Strict Mode: distributed checking of max collection size

* add size projections in distributed mode

* Add consensus tests

* New Test: All nodes in cluster

* fix tests

* Update lib/collection/src/collection/mod.rs

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

* increase upsert delay

* add TODO for resharding

* wait for strict mode config to be applied on second node

* remove delays

* Also wait for strict mode in other test

* clearify strict mode config option

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2024-12-19 16:38:30 +01:00
Luis Cossío
daef7134e2 Enable resetting max_optimization_threads to automatic (#5634)
* Allow max-optimization-thread config to be set to null on update

* add new field. Support both, but prepare for deprecation.

* better openapi

* only introduce change in OptimizersConfigDiff

* move to `api::rest::schema`

* update openapi

* improve test, fix diff to config conversion

* upd grpc docs

* clippy

* remove schemars from common common

---------

Co-authored-by: Gulshan Kumar <kumargu@amazon.com>
2024-12-18 17:17:47 -03:00
Arnaud Gourlay
229fa94f69 Strict mode for payload storage (#5588)
* Strict mode for payload storage

* Don't increment counter multiple times per request

* Add (loose) integration tests for payload storage limit

* Minor improvements

* minor renaming

* Update lib/api/src/grpc/proto/collections.proto

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

---------

Co-authored-by: jojii <jojii@gmx.net>
Co-authored-by: Jojii <15957865+JojiiOfficial@users.noreply.github.com>
Co-authored-by: Tim Visée <tim+github@visee.me>
2024-12-17 17:33:46 +01:00
Luis Cossío
14c1979a47 Integrate mmap bool index (#5571)
* add on_disk option for bool index

* test that all files are covered

* generate openapi and docs

* clippy

* remove `populate` changes

* use `walkdir` crate

* Apply clippy suggestions

---------

Co-authored-by: timvisee <tim@visee.me>
2024-12-16 20:35:10 -03:00
Andrey Vasnetsov
4ec6cdb536 Allow telemetry endpoint for JWT-limited requests (#5631)
* WIP: per-collection telemetry permissions

* upd telemetry

* fix clippy

* fix test

* Update src/actix/api/service_api.rs

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2024-12-16 16:24:26 +00:00
Arnaud Gourlay
2a2a7033db Rate limit requests per minute (#5597)
* Rate limit requests per minute

* rename to remove time unit for API
2024-12-10 00:26:37 +01:00
Arnaud Gourlay
1e21a4a179 Rate limiting for shard operations (#5582)
* Rate limiting for shard operations

* address all review comments in one go
2024-12-06 11:02:18 +01:00
Jojii
42fd2e27e2 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-05 17:28:09 +01:00
Ivan Pleshkov
73259267ae GPU HNSW integration (#5535)
* gpu hnsw

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2024-12-05 00:58:49 +01:00
Arnaud Gourlay
3ce506ec93 Expose payload storage size in segment info (#5552) 2024-12-02 11:23:36 +01:00
Luis Cossío
2de122adea 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-11-27 11:45:16 -06:00
Tim Visée
fe0a5769e5 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-11-27 14:57:37 +01:00
Jojii
5417428951 Add max upsert batch size strict mode option (#5485) 2024-11-19 19:06:57 +01:00
Jojii
55b193a2c8 Add hardware metrics to /metrics and /telemetry API (#5408)
* add hardware metrics to /telemetry and /metrics

* move all_hw_metrics function
2024-11-19 15:08:04 +01:00
Luis Cossío
b895bcd872 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-11-18 12:43:52 -06:00
Roman Titov
7e7348613e 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-15 19:03:50 +01:00
n0x29a
7833fba05f 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-15 10:31:05 +01:00
Andrey Vasnetsov
c53ad9c103 use more stable computation of vectors_size_bytes + refactoring (#5437)
* use more stable computation of vectors_size_bytes + refactoring

* sync openapi
2024-11-13 16:52:14 +01:00
Luis Cossío
d902422203 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-13 08:49:42 -06:00
George
15656e9110 Make model name field mandatory in inference structures (#5431)
* Make model name field mandatory in inference structures

* fix batch tests
2024-11-12 17:00:27 +01:00
Andrey Vasnetsov
edfb52ea4b 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 12:31:03 +01:00
Luis Cossío
5d3379ae01 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-11 10:38:43 -06:00
George
ccc5551701 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-08 20:50:27 +01:00
Jojii
e35ec150df Add hardware usage to grpc API (#5333)
* Add hardware usage to grpc API

* generate grpc docs
2024-11-05 16:15:39 +01:00
Jojii
70646af7a8 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-10-29 09:53:22 +01:00
Andrey Vasnetsov
633d996e61 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-10-25 18:47:03 +02:00
Kumar Shivendu
31ce928fcf 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-10-25 15:09:31 +05:30
Arnaud Gourlay
9541125882 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-10-25 10:32:33 +02:00
Kartik Gupta
f5e47707f7 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-10-24 20:35:18 +02:00
Tim Visée
db1e225983 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-10-23 12:34:12 +02:00
Arnaud Gourlay
3de4e107d4 fix lints for Clippy 1.82 (#5229)
* fix lints for Clippy 1.82

* regen openapi
2024-10-14 13:13:58 +02:00
Jojii
27883dbb41 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-10-14 10:27:00 +02:00
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
b22e177584 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-10-08 14:50:40 +02:00
Andrey Vasnetsov
68179bf697 make operationId consistent with grpc (#5201) 2024-10-07 22:02:22 +02:00
Ivan Pleshkov
080352cc56 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-07 14:35:17 +02:00
Luis Cossío
045779233a Facets: Support for bool payload (#5100)
* enable faceting with boolean index

* test and fix

* also test uuid
2024-10-01 09:17:50 -03: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
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