Commit Graph

1209 Commits

Author SHA1 Message Date
Jojii
b94d02ad30 Add error handling if vector is missing for point (#5211)
* add error handling for missing vectors

* add integration test

* add call without specifying 'using' parameter
2024-10-10 12:48:34 +02:00
Kumar Shivendu
f7b6148242 Dont consider resharding shards as unhealthy for /readyz (#5204)
* Dont consider resharding shards as unhealthy for /readyz

* clippy
2024-10-09 11:14:24 +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
Andrey Vasnetsov
f5cc150dca enable mmap vector storage by default (#5188) 2024-10-07 17:09:52 +02:00
Jojii
b210c3d09e Improve docs for new_unchecked_verification_pass (#5181) 2024-10-04 23:27:35 +02:00
xzfc
761069bc0a Restore SnapshotFormat::Streamable snapshots (#5179) 2024-10-04 16:39:56 +00:00
xzfc
98c4e605ae Support SnapshotFormat::Streamable, add REST endpoint (#5178) 2024-10-04 16:36:19 +00:00
xzfc
bc2104604c Introduce SnapshotFormat (#5175) 2024-10-04 16:09:30 +00:00
xzfc
7932286709 Update tar_ext::BuilderExt (#5112)
* tar_ext::BuilderExt: generalize and add drop workaround

- Generalize: instead of taking `std::fs::File`, take
  `impl Write + Seek`.
- Add a workaround for drop: `tar::Builder<W>::drop` might panic if the
  underlying writer panics when using in async context.

* Drop unnecessary write_fn usage

* tar_ext::BuilderExt: support both seekable and streaming variants

* tar_ext::BuilderExt: support both owned/borrowed variants
2024-10-04 14:10:09 +00:00
Tim Visée
d578c428a5 When removing a shard, remove its configuration file first (#5176) 2024-10-04 12:10:28 +02:00
Tim Visée
e2dfa6d78e Fix panic on start if resharding shard is partially created (#5169)
* Reuse shard path if it already exists

* Recreate rather than reuse shard directory
2024-10-02 11:22:17 +02:00
dependabot[bot]
a5cebd8eef build(deps): bump rstest from 0.22.0 to 0.23.0 (#5159)
Bumps [rstest](https://github.com/la10736/rstest) from 0.22.0 to 0.23.0.
- [Release notes](https://github.com/la10736/rstest/releases)
- [Changelog](https://github.com/la10736/rstest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/la10736/rstest/compare/v0.22.0...v0.23.0)

---
updated-dependencies:
- dependency-name: rstest
  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-10-01 10:13:09 +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
dependabot[bot]
52db80a292 build(deps): bump ordered-float from 4.2.2 to 4.3.0 (#5154)
Bumps [ordered-float](https://github.com/reem/rust-ordered-float) from 4.2.2 to 4.3.0.
- [Release notes](https://github.com/reem/rust-ordered-float/releases)
- [Commits](https://github.com/reem/rust-ordered-float/compare/v4.2.2...v4.3.0)

---
updated-dependencies:
- dependency-name: ordered-float
  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-10-01 09:19:46 +02:00
Jojii
a638378df2 remove obsolete timeout (#5142) 2024-09-26 12:59:17 +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
29556cebc2 [Strict mode] Unit tests (#5124)
* add tests for strict mode

* add good example for strict mode test

* Add succes case to test_request_exact

---------

Co-authored-by: timvisee <tim@visee.me>
2024-09-26 10:27:05 +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
a864d4c92e [Strict mode] GRPC verification (#5003)
* first grpc implementations

* make usage of 'scroll' more clear

* introduce 'CheckedTocProvider' trait

* implement more grpc types

* more grpc implementations

* rename StrictModeCheckedProvider to StrictModeCheckedTocProvider

* don't use deprecated feature for UncheckedTocProvider
2024-09-25 13:22:37 +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
f3a2807904 Add unit test for set_payload bug (#5132) 2024-09-24 10:38:45 +02:00
Arnaud Gourlay
d527ab9cd0 Promote atomicwrites to workspace (#5135) 2024-09-24 09:44:12 +02:00
dependabot[bot]
f9d72a0922 build(deps): bump bytes from 1.7.1 to 1.7.2 (#5128)
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.7.1 to 1.7.2.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.7.1...v1.7.2)

---
updated-dependencies:
- dependency-name: bytes
  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:43:34 +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
Arnaud Gourlay
89336e628d Fix set payload by key on non appendable segment (#5113) 2024-09-23 11:59:08 +02:00
Tim Visée
07d5efbf67 Fix race condition getting optimizers stuck, leaving collection in yellow state (#5111)
* Return whether any task was cleaned

* Retrigger optimizers after cleanup timeout if we cleared a handle

* Flatten match used as decision logic on whether to run optimizers

* Add comment to elaborate we have a branch to prevent race condition

* Rename force to ignore_max_handles

* Use swap remove as it is a bit more efficient
2024-09-23 10:42:31 +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
Roman Titov
739456d41b Cleanup shards when aborting scale-down resharding (#5021) 2024-09-18 13:03:12 +02:00
Tim Visée
9637536fda Refactor local shard status function (#5102)
* Refactor local shard status

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

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

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2024-09-18 11:16:13 +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
Ivan Pleshkov
54150f7358 remove unused WrongPayloadKey (#5086) 2024-09-16 10:54:11 +02:00
Vamshi Maskuri
e0ab73fccb fix oom issues and add logs to monitor memory usage under high contention (#4994)
* fix oom issues and add logs to monitor memory usage under high contention

---------

Signed-off-by: Vamshi Maskuri <117595548+varshith257@users.noreply.github.com>
2024-09-15 00:06:00 +02:00
Andrey Vasnetsov
e8d5cfc63c Allow explicit populate of mmap (#4923)
* expose mmap populate

* expose mmap populate in open_read_mmap

* FOR TEST, REVERSE IT: make InRamChunkedMmap default

* enable populate advise on unix

* fix clippy

* unix -> linux

* Update lib/collection/src/config.rs

* clippy fixes

* resolve conflicts

* fmt

* Runtime check for PopulateRead

---------

Co-authored-by: xzfc <xzfcpw@gmail.com>
2024-09-14 20:53:07 +02:00
Tim Visée
51b9925419 Parallelize duplicate point deletions across segments (#5073)
* Parallelize duplicate point deletions across segments

* Fix typo
2024-09-13 23:29:36 +02:00
xzfc
078402f459 Unpack snapshots with sync (#5075)
* refactor: Simplify open_snapshot_archive_with_validation

* feat: tar::Archive::set_sync(true)
2024-09-13 22:00:59 +02:00
Roman Titov
bd309c8abc Use ReshardingDirection::Up if direction field is missing when deserializing ReshardKey (#5078) 2024-09-13 17:17:25 +02:00
xzfc
a6400138f8 Direct snapshot creation (#5061) 2024-09-12 19:39:15 +00:00
Tim Visée
3624b4f2eb Make computing snapshot checksums faster in debug (#5064)
* In debug builds on Unix, use sha256sum binary because it is faster

* Add test to ensure sha256sum produces the same hash

* Apply suggestions from code review

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

* Only use sha256sum on Linux platforms

* Remove hash through binary implementation

* Enable release optimizations for sha2 crate in debug builds

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2024-09-12 11:17:11 +02:00
Andrey Vasnetsov
a2fefb48ed 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-11 20:12:16 +02:00
Roman Titov
ba418c64f7 Split operations into update_all/update_existing during resharding (#4928)
Co-authored-by: generall <andrey@vasnetsov.com>
2024-09-11 11:11:05 +02:00
xzfc
4ee7d87206 Switch to sparse tar implementation (#4943) 2024-09-10 14:07:47 +00:00
Kumar Shivendu
490688053b 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-10 16:52:38 +05:30
Roman Titov
5dd1e42f8e Fix bugs in and refactor hash_ring module (#5038)
Co-authored-by: timvisee <tim@visee.me>
2024-09-09 12:38:53 +02:00
Kumar Shivendu
8de6bea6c7 Fix shard/collection status blinking (#5043)
* Fix shard/collection status blinking

* Improve var names

* improve var names

* Improve function docs
2024-09-09 14:37:51 +05:30
Tim Visée
8b0aa6f549 Allow shard transfer from/to the same peer if from/to shard ID is different (#5034) 2024-09-09 09:15:42 +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
Arnaud Gourlay
faa7e9f8f4 Fix distance matrix min samples found (#5036) 2024-09-06 14:53:20 +02:00
Arnaud Gourlay
b2d22c9792 Remove unecessary clippy allow deadcode (#5033) 2024-09-06 12:04:49 +02:00
Kumar Shivendu
fecf747bfb Improve logging (#5027)
* Improve logging

* Update lib/collection/src/collection_manager/optimizers/merge_optimizer.rs

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

* move log to optimizer launch

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: generall <andrey@vasnetsov.com>
2024-09-06 09:56:56 +02:00