Commit Graph
290 Commits
Author SHA1 Message Date
Ivan Pleshkov 2aff9fc8a3 vector index as enum 2023-03-08 21:02:59 +00:00
Ivan Pleshkov 41d5ecd63b separate payload and vector index bases 2023-03-08 20:00:08 +00:00
Ivan PleshkovandAndrey Vasnetsov 5174388ab4 integrate quantized data to storages (#1311)
* integrate quantized data to storages

* revert gitignore

* are you happy clippy

* quantize in optimizer

* provide flag

* fix segfault

* skip quantization flag, update scores

* use quantization flag

* are you happy fmt

* use quantization flag

* quantized search test

* are you happy fmt

* refactor test, refactor scorer choosing

* are you happy fmt

* run quantization on segment builder

* decrease testing parameters

* simplify segment

* update version

* remove use_quantization flag

* provide quantization config

* quantization version up

* euclid dist

* add euclid test

* saveload

* fix initialization bugs

* quantization lib version up

* fix arm build

* refactor scorer selecting

* quant lib version up

* are you happy fmt

* are you happy fmt

* are you happy clippy

* add save/load test for simple storage

* add comments

* quantiles

* quantization mmap

* remove f32

* mmap test

* fix mmap slice

* fix mmap test

* use chunks for quantization storage

* fix build

* are you happy fmt

* update quantization library

* update quantization lib

* update quantization lib

* integrate api changes

* are you happy fmt

* change quantization api

* additional checks in tests

* update quantization version

* fix unit tests

* add quantization to storage config

* use quantization for all cardinality search cases

* Integrate quantization suggestions 2 (#1520)

* review api

* wip: refactor quantization integrations

* wip: refactor quantization integrations

* wip: fmt

* include quantization into snapshot

* fmt

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-03-03 17:46:17 +01:00
Ivan Pleshkov 83efed1fcf fix windows warning unused parallel_graph_build (#1513) 2023-03-01 11:10:22 +01:00
Arnaud Gourlay ea485a9029 Fix condition check for values_count (#1502) 2023-02-28 09:47:28 +01:00
Arnaud GourlayandAndrey Vasnetsov 2770a24766 Nested payload filters (#1487)
* Nested payload filters

* close ToDo + add parsing of multuiple array values

* fmt

* improve testing nested arrays

* fix NumericIndex to accumulate points_to_values mapping

* revert numberic index + strict array field access

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-02-23 15:57:12 +01:00
Arnaud Gourlay 3803af502d Access payload key through nested Array (#1465)
* Access payload key through nested Array

* support removal through array index

* propagate type changes

* fmt

* avoid allocating Vec of one element
2023-02-17 17:41:28 +01:00
Luis CossíoandAndrey Vasnetsov c15fec2a2a feat: add "any" to "match" statements (#1466)
* feat: add "any" to "match" statements

Adds support for using "any" to match on a list of different possible values

* enable proper counting in cardinality estimation

* fmt

* upd OpenAPI

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-02-15 11:11:20 +01:00
dependabot[bot]andIvan Pleshkov 1204682000 Bump rocksdb from 0.19.0 to 0.20.0 (#1461)
* Bump rocksdb from 0.19.0 to 0.20.0

Bumps [rocksdb](https://github.com/rust-rocksdb/rust-rocksdb) from 0.19.0 to 0.20.0.
- [Release notes](https://github.com/rust-rocksdb/rust-rocksdb/releases)
- [Changelog](https://github.com/rust-rocksdb/rust-rocksdb/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-rocksdb/rust-rocksdb/compare/v0.19.0...v0.20.0)

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

Signed-off-by: dependabot[bot] <support@github.com>

* fix api changes

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>
2023-02-10 10:22:34 +01:00
Andrey Vasnetsov ac251358b9 Fix flacky windows test (#1448)
* use async sleep

* fmt

* disablee test_parallel_graph_build on CI on windows untill there is a way to reproduce
2023-02-09 20:48:00 +01:00
Roman Titov 1be2f67a2e Reimplement ExtendedPointId deserialization (#1453)
Reimplement `ExtendedPointId` deserialization, to produce better error message when deserialization fails
2023-02-10 02:36:36 +10:00
Andrey Vasnetsov 26551c64ef rollback custom deserialization for point id 2023-02-08 14:13:57 +01:00
Andrey Vasnetsov 39cc731611 Windows support (#1432)
* windows-support

* fmt

* install protoc with action

* upd WAL revision
2023-02-06 14:00:23 +01:00
Andrey Vasnetsov e3066b96fc allow to overwrite max number of cpus with env variable (#1425) 2023-02-02 14:44:03 +01:00
Arnaud Gourlay 68b34b1550 Implement Deserialize for ExtendedPointId to improve error reporting (#1416)
* Implement Deserialize for ExtendedPointId to improve error reporting

* better error message
2023-01-31 19:57:39 +01:00
Arnaud Gourlay 4c0f849749 Clippy rust 1.67 (#1406)
* inline format! args

* inline format! args

* explicit lifetime could be elided

* fmt
2023-01-26 17:48:52 +01:00
Roman TitovandAndrey Vasnetsov 6b66d33398 Implemented response resolver (#1370, #1381)
- Implement `Resolve` trait that "merges" multiple `retrieve`/`scroll_by`/`search` responses
  into a single response, to ensure it's consistent across multiple nodes in the cluster
- Implement tests for the `Resolve` trait implementation
- Add a few additional derives required for the `Resolve` trait implementation

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-01-25 05:24:55 +10:00
Arnaud Gourlay 064a1389b9 Name rayon hnsw threads for clarity (#1399) 2023-01-24 19:36:16 +01:00
Andrey Vasnetsov 5877039380 Faster snapshot creation (#1353)
* deduplication after proxy snapshot recovery

* revert changes in apply_points_to_appendable

* clippy fixes

* spawn blocking in snapshot creation
2023-01-20 23:52:45 +01:00
Andrey Vasnetsov a8dad69dba enable payload field anonymization (#1368) 2023-01-19 10:23:17 +01:00
Arnaud Gourlay 8c2c4f08eb Remove some blocking IO calls on Tokio threads (#1366) 2023-01-19 07:58:45 +01:00
Andrey Vasnetsov 0c1833db7f Disable extra segments checks (#1352)
* optional segment check

* alternative implementation
2023-01-16 12:05:32 +01:00
Roman TitovandAndrey Vasnetsov ced0abb4c7 Fix segment snapshotting (#1321) (#1334)
* WIP: Fix `Segment::take_snapshot`

TODO:
- This commit, probably, breaks snapshotting of segments with memmapped vector storage
- `ProxySegment::take_snapshot` seems to potentially similar bug

* WIP: Fix `Segment::take_snapshot`

- Fix snapshotting of `StructPayloadIndex`
- Fix snapshotting of segments with memmapped vector storage
- Temporarily break `ProxySegment::take_snapshot`

* Fix `ProxySegment::take_snapshot`

* Remove `copy_segment_directory` test

* nitpicking

* clippy fixes

* use OperationError::service_error

* Cleanup `TinyMap` trait bounds and derive `Debug`

* Fix `test_snapshot` test

- Derive `Debug` for `NamedVectors`

* Move utility functions from `segment.rs` to `utils` module

* Contextualize `segment::utils::fs::move_all` a bit more carefully

* Fix a typo

* add backward compatibility with old snapshot formats

* fmt

* add snapshot for compatibility test

* git lfs is a piece of shit

* Nitpicking

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-01-13 11:44:42 +01:00
Arnaud GourlayandAndrey Vasnetsov 72dadee806 Repair segment data while checking consistency (#1314)
* Repair segment data while checking consistency

* code review

* code review

* code review

* code review drop_by_internal_id

* refactoring

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-01-10 20:02:43 +01:00
Roman Titov 2ed11d544b Add configuration option to select "memory advice" used for memmapped storage
- Add a simple abstraction/wrapper over `memmap2::Advice` and a global switch
  to select "memory advice" used for memmapped storage to the `segment` crate
- Add `mmap_advice` configuration option to the `storage::types::StorageConfig`
- Implement `search-points` benchmark
2023-01-06 21:02:57 +10:00
Andrey Vasnetsov bd05a69a5f Id mapper inconsistency (#1302)
* always flush wal

* always flush wal fix

* always flush wal fmt

* flush wal during background flush

* async wal flush

* use id-tracker internal id for next-id instead of vector storage

* add flush order and recovery comment

fix merge bug

* longer timeout in test
2022-12-25 22:36:31 +01:00
Andrey Vasnetsov 431fcbb4ca better validation for transfer initiation 2022-12-23 21:16:13 +01:00
Arnaud Gourlay d77debf122 Clippy for Rust 1.66 (#1284) 2022-12-16 10:53:51 +01:00
Ivan Pleshkov 02071314bd remove obsolete internal scorer (#1271) 2022-12-14 14:47:22 +04:00
Andrey Vasnetsov aeba32ba3e Shard build refactoring (#1280)
* refactor some code of shard creation and optimizers

* Shard build refactoring debug (#1279)

* add debig code

* debug code

* debug code

* debug code

* debug code

* debug code

* debug code

* debug code

* debug code

* debug code

* debug code

* refactor stop-checking during the optimization

* remove debug logs

* improve delete-renaming schema

* fmt

* move collection file removing to the async task

* rename check_optimization_stopped into more general check_process_stopped
2022-12-14 10:11:46 +01:00
Andrey Vasnetsov d05b2def10 allow set different M param for default HNSW and payload-related links (#1257)
* allow set different M param for default HNSW and payload-related links

* review fixes
2022-12-06 13:53:42 +01:00
Andrey Vasnetsov 0925d02667 include backtrace for service errors (#1256) 2022-12-06 12:31:38 +01:00
Andrey Vasnetsov a23adcdd82 Missed points on update fix (#1255)
* add context to point-not-found error

* fmt

* add backtrace

* use upgradable lock

* unique points in insert operation

* remove debug code
2022-12-06 12:31:24 +01:00
Ivan PleshkovandAndrey Vasnetsov ac9538d5af Hnsw links memmap (#1211)
* add on disk key

* remove obsolete graph initialization

* remove obsolete max level

* update openapi

* graph links trait

* use mmap option

* same format for ram and mmap

* fix segment unit tests

* are you happy fmt

* are you happy clippy

* fix ci and add mmap test

* review fixes

* remove unused try-from

* fix version compatibility

* avoid loading from disk during conversion

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-11-25 11:47:52 +01:00
Arnaud GourlayandAndrey Vasnetsov c5558ab22b Probabilistic search sampling for better limit (#1199)
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-11-16 20:53:58 +01:00
Andrey Vasnetsov 7e4424ab57 Cosine dist zero vectors (#1198)
* skip pre-processing of zero-length vector for cosine distance

* fmt
2022-11-08 17:36:20 +01:00
Ivan Pleshkov d555a244c2 Hnsw links storage (#1171)
* hnsw compact links storage

* dump links memsize

* are you happy fmt

* fix build

* calculate capacity and add shrink

* fmt

* remove garbage

* fix unit tests

* default values for graph layers

* remove obsolete fields

* add comments

* more comments

* use one flattened links structure

* refactor and add unit tests

* move merge into graph builder

* fix messages in test_hnsw_graph_properties
2022-11-08 13:42:50 +04:00
98fc5b2fa4 0.11.1 cherry picks (#1193)
* Complete feature road-map

* docs: add erare-humanum as a contributor for code (#1181)

* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>

* update rust version and fix clippy complains (#1190)

* handle collections transition from single-node to cluster (#1189)

* Update to v0.11.1 (#1191)

* update to v0.11.1

* also default version

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>

* consensus_state to consensus_state

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
2022-11-07 11:31:12 +01:00
Ivan PleshkovandAndrey Vasnetsov 017df52528 Use less ram for id tracker (#1176)
* use less ram for id tracker

* are you happy clippy

* use vec for internals

* use versions for internal ids

* keys test

* Use less ram for id tracker fixes (#1182)

* WIP: internal_to_version

* fmt

* fix unit tests

* add comment

Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-10-31 10:44:00 +04:00
erare-humanumandAndrey Vasnetsov 93a4499859 Update: unmaintained crate memmap -> memmap2 (#559) (#1160)
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-10-30 11:50:27 +01:00
Andrey Vasnetsov 071d1948b0 update and improve openapi definitions 2022-10-24 16:04:31 +02:00
Andrey Vasnetsov ab19576c5d Force sync vector storage offset (#1110)
* simplify vector storage `update` semantic, always assume inplace vector replacement

* fmt
2022-10-24 12:34:26 +02:00
Andrey Vasnetsov 54e0857708 ignore points with missing expernal ids instead of panic (#1109) 2022-10-24 12:33:43 +02:00
Arnaud Gourlay 1ff09516a0 limit set to zero returns an empty result (#1083) 2022-10-24 12:32:46 +02:00
Andrey Vasnetsov 21754ef2ef report indexed payload points in info api + other fixes (#1164)
* report indexed payload points in info api + other fixes

* rollback debug changes

* clippy

* clippy
2022-10-24 09:43:02 +02:00
Ivan PleshkovandAndrey Vasnetsov 516dcd7020 Telemetry level of detail (#1049)
* telemetry level of detail

* rename duration aggregator

* are you happy fmt

* move total searches sum

* separate levels

* optional bucket size

* search telemetry improvements

* separate web telemetry into methods

* tonic telemetry methods

* merge optimizations

* are you happy fmt

* better rounding

* qdrant configs on level 1

* provide collection params

* add peers count

* collection points count

* update openapi

* use pattern in actix telemetry

* are you happy fmt

* merge dev

* are you happy fmt

* fix merge conflicts

* update openapi

* fix build

* are you happy fmt

* add exact searches statistics

* process replica set

* update openapi

* fix wrong name

* fix naming

* fix unwrap

* review

* fmt

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-10-23 00:48:55 +02:00
Ivan PleshkovandAndrey Vasnetsov 44626bc80a exact search parameter (#1150)
* exact search parameter

* exact search test

* decrease attempts count because of test speed

* minor review fixes

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-10-20 15:39:21 +04:00
Andrey Vasnetsov bf48066145 Full reassign payload on upsert (#1148)
* set_full_payload on upsert

* fmt

* fix clippy
2022-10-20 10:26:33 +02:00
Andrey Vasnetsov ef7b4ac2a7 propagate payload index to temporary segment during optimization (#1133) 2022-10-18 10:49:37 +02:00
Arnaud GourlayandAndrey Vasnetsov 9324be1d60 [Replication] Add replicas (#1085)
* Add replicas to ReplicaSet

* unproxify shard & miscs

* no exlusive write locking while adding replicas

* on_optimizer_config_update on Shard with async. recursion

* no exlusive write locking while removing replicas

* shortcut replica set propagation #1101

* remove unused field

* make RequestShardTransfer callback sync.

* promote local & remote to replica state

* fixes for replica sync api (#1123)

* code review

* fix replica set update - fail only if all failed

* Add replica redesign (#1131)

* refactor shard/mod.rs

* wip

* fmt

* it compiles

* temporary disable replica placemeant change on replication factor

* fmt

* finish todos

* small refactoring

* remove change::add

* replica-set -> shard-replica-set

* fmt

* upd openapi

* fix finish transfer logic

* fix existing integration tests

* shard transfer validation

* fmt

* review fixes

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-10-17 20:12:10 +02:00