Commit Graph

89 Commits

Author SHA1 Message Date
Tim Visée
f5a14449a0 Add vector specific quantization configuration (#1680)
* Add QuantizationConfigDiff type

* Add quantization config diff to vector parameters

* Prefer vector config over collection config for quantization

* Update OpenAPI specification

* Validate quantization configuration quantile in 0.5-1.0 range

As per https://github.com/qdrant/qdrant/pull/1681

* Add test if check if vector specific quantization config is persisted

* Alias quantization to quantization_config in vector parameters

* Remove quantization config diff, use full vector specific config instead

* Regenerate OpenAPI specification and gRPC docs

* Fix compilation error

* Add error handling to quantization config conversions

* Fix quantization integration test, make HNSW test stricter
2023-04-10 21:39:43 +02:00
Tim Visée
b7c1ecfd5f Add vector specific HNSW configuration (#1675)
* Validate VectorConfig/VectorParams, remove obsolete validation

* Add HNSW config diff to vector parameters

* Validate params in collection config

* Add HNSW config to segment vector data config

* Add VectorsConfig params iterator for more elegant conversions

* Prefer vector HNSW config over collection config for building HNSW index

* Base segment vector param HNSW config on collection config

* General improvements

* Rewrite HNSW ef_construct extract function to also consider vector configs

* Update OpenAPI specification

* Add test to check if vector specific HNSW config is persisted

* review changes

* review changes

* Regenerate gRPC docs

* Fix test on Windows

* Regenerate OpenAPI specification

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-10 17:16:56 +02:00
Tim Visée
80918f2ffd Add validation to gRPC (#1634)
* Implement validation on generated gRPC point types

* Validate gRPC point API requests

* Nicely describe validation errors

* Add validation extensions for special types used in gRPC

* Validate gRPC collection API requests

* Validate gRPC Raft and snapshot API requests

* Simplify validation builder, guess derives from fields, fix two fields

* Remove point recommending limit constraint to fix gRPC tests

* Clean up validation logic for gRPC in build.rs

* Validate internal gRPC requests, don't error but show warnings in log

* Optimize gRPC validation extensions, remove unused bits

* Validate gRPC collection creation configuration

* Add custom validators for special gRPC types

* Value is automatically attached to validation error

* Cleanup

* Remove obsolete tests

* Add basic gRPC validation test

* Add some gRPC request payload validation tests

* Set max collection name length to 255 in validation to match Actix
2023-04-10 17:04:27 +02:00
Tim Visée
e0778a69d4 Simplify for loop picking a minimum item (#1686)
See https://github.com/qdrant/qdrant/pull/1682#discussion_r1161605970
2023-04-10 17:03:09 +02:00
Andrey Vasnetsov
e034b0ea35 Try to fix dying shards (#1682)
* use common channel pool for healthcheck requests

* add dynamic channel pool

* fmt

* lower parallel connections num

* fmt

* fix clippy

* fix clippy

* better status error message

* smarter channel dropping conditions

* per-channel stats

* refactor pool

* rollback dockerfile

* health-check timeout

* prevent reporting last active peer as dead

* introduce update rate limit

* only rate-limit client requests

* ability to save snapshot without locking wal (#1685)

* ability to save snapshot without locking wal

* fix empty wal saving

* skip waiting on local shard in listener mode even if it is a direct request to listener shard

* snapshot recovery test + better handling of segment versions

* use latest wal

* review changes
2023-04-10 15:29:39 +02:00
Alex Huang
d1e5498ff8 feat: add wait param for all snapshot API (#1571)
* feat: add wait parm for all snapshot API

* update openAPI

* avoid unwrap

* remove all unwarp

* return HTTP 202 when no waiting on snapshot creation

* return 202 when non wait

* update open API

* update param on python test

* update and test api

* optimize the test

* return 202 when non-wait delete

* recover fixes

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-04 12:08:13 +02:00
dependabot[bot]
fc68f733dc Bump tonic from 0.8.3 to 0.9.0 (#1636)
* Bump tonic from 0.8.3 to 0.9.0

Bumps [tonic](https://github.com/hyperium/tonic) from 0.8.3 to 0.9.0.
- [Release notes](https://github.com/hyperium/tonic/releases)
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/commits)

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

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

* tonic-build 0.9.0

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2023-04-03 13:17:46 +02:00
Ibrahim M. Akrab
f85ae02ab6 add isNull condition for payload filtering (#1617)
* add minimal working is_null filter

* add is_null condition to grpc api (backward compatible)

* add unit tests is_null and is_empty conditions

* add is_null to  points.proto file

* add some failing OpenAPI tests

* fix a failing test due to change in collection data

* refactor MultiValue's check for is_null

* fix is_empty condition not picking up "key":[]

* remove duplicate OpenAPI integration test

* reuse same variable in condition checker tests

* update grpc docs

* fix is_null cardinality estimation to match is_empty

* update openapi specs

* remove unused debug statements

* add new test points to original test_collection

* fix failing tests according to newly added points

* add the `"key":[null]` test_case
2023-04-01 20:46:50 +02:00
Tushar Dahiya
d632cfbf27 fixed typos in *.proto files (#1569)
* Update README.md

* Update DEVELOPMENT.md

* Update docs.md

* Update roadmap-2022.md

* Update collections.proto

* Update collections.proto

* Update json_with_int.proto

* Update points.proto

* Update points_service.proto

* fixes and resync

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2023-03-22 16:05:37 +01:00
stencillogic
21f1d90cea Add tls support (#1581)
* add TLS support

* update github workflow

* fix formatting

* fix tests

* fix clippy warning

* fix PR remarks
2023-03-20 20:59:49 +01:00
Andrey Vasnetsov
c6dd977c5e Quantization re scoring param (#1538)
* parameter to disable rescoring with quantization

* fix

* fix default

* review fixes

* upd api autogen
2023-03-09 11:51:29 +01:00
Ivan Pleshkov
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
Luis Cossío
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
Andrey Vasnetsov
99eaabc31a remove deprecate point ids param in gprc (#1305)
* remove deprecate point ids param in gprc

* upd docs
2023-02-06 13:37:18 +01:00
Roman Titov
a50e7bdcd4 Add read_consistency parameter to the APIs (#1371) (#1407)
* WIP: Add `read_consistency` parameter to the APIs

* WIP: Add `read_consistency` parameter to the APIs

TODO:
- Add documentation

* `cargo fmt`

* Add gRPC documentation

* Add OpenAPI documentation

* Cleanup

* fixup! Add OpenAPI documentation

* fixup! Add gRPC documentation

Who would have known there's `generate_grpc_docs.sh`!? 🥲🙈🤦‍♀️

* generate openapi

* Fix `read_consistency` query parameter deserialization

* Further improve `read_consistency` query parameter deserialization

* `cargo clippy`

* Fix `Payload` comparison during read operation result resolving

* Fix grammar

* rename `read_consistency` -> `consistency` and add integration test

* use majority for test

* fix tests

* Fix tests

* fixup! Fix tests

Apply the same fix to `ScoredPoint`

* Remove an `unwrap`

* fixup! Fix tests

Gotta love those negative conditions, or how a missed `!` can ruin your day... 🤦‍♀️

* Make internal API calls strictly "local-shard only"

* Implement a few basic traits for `ResolverRecord`

* fixup! Implement a few basic traits for `ResolverRecord`

* Revert "Make internal API calls strictly "local-shard only""

This reverts commit 25378e61ff.

* Fix `Record::payload` and `ScoredPoint::payload` serialization

* Revert "Fix `Record::payload` and `ScoredPoint::payload` serialization"

This reverts commit b566bea49b.

* Fix `Record::payload` and `ScoredPoint::payload` visibility

* fixup! Fix `Record::payload` and `ScoredPoint::payload` visibility

Remove `todo!()`

* refactoring

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-02-03 01:12:28 +01:00
Arnaud Gourlay
2d9e015905 Forward write request according to write consistency (#1405)
* Forward write request according to write consistency

* use gRPC internal update API by making shard_id optional

* improve and test

* mark leader peer as failed in case of service error during forward

* forward write ordering param
2023-01-30 15:02:21 +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
Andrey Vasnetsov
f356455b07 add write consistency param to rest and grpc api (#1397)
* add write consistency param to rest and grpc api

* fix grpcurl + refactor grpc for better extencibility

* upd grpc docs

* fix conversion
2023-01-25 11:49:01 +01:00
Andrey Vasnetsov
61d970ef90 Init collection from (#1364)
* WIP

* WIP: add shards selection

* fmt

* WIP: collection init from other collection

* fmt

* fix bugs

* add collection write lock + use collection manager runtime instead of search runtime

* fmt

* integration test

* better names ?

* payload indexes transfer
2023-01-22 01:16:55 +01:00
Arnaud Gourlay
86b8ff6b7f Delete snapshots API (#1377)
* Delete snapshots API

* remove unecessary plurals
2023-01-20 19:28:56 +01:00
Arnaud Gourlay
6f284da22e List aliases API (rest & gRPC) (#1363)
* List aliases API (rest & gRPC)

* rework api to avoid conflicts
2023-01-19 07:59:02 +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
926a058c73 Fixing missed leader inconsistency (#1286)
* WIP: introduce local state

* WIP: sync local state with consensus in idle

* fmt

* rm extensive debug

* update triple replication test

* update triple replication test

* rm debug logs

* fix check for established leader + only sync local if no proposals

* remove unused file

* test compatible with python 3.8

* test compatible with python 3.8

* longer wait for consensus

* longer wait for consensus

* extra sleep in test

* remove extra sleep

* Fixing missed leader inconsistency - transfers (#1298)

* explicit request timeout

* explicit request timeout

* explicit request timeout

* explicit request timeout

* explicit request timeout

* prevent double handelling of the transfer termination

* kill the process

* log on inconsistency

* log on inconsistency

* log on inconsistency

* debug

* revert debug in test

* forward updates to partial shards, abort transactions on dead node report

* fmt

* disable retry of transfer, if the transfer was cancelled + allow predictable ports in test

* fix import
2022-12-23 00:45:04 +01:00
Andrey Vasnetsov
a2c5de586b Recommendation with other collection (#1283)
* WIP: move recommendation API out of collection

* recomendations with external source of vectors

* fix test

* fmt

* fixes + test

* review fixes
2022-12-22 09:29:36 +01:00
Arnaud Gourlay
584cdfa801 update all dependencies Cargo.lock (#1293) 2022-12-20 10:30:49 +01:00
Arnaud Gourlay
e3c6bb8a53 update tonic 0.8 & prost 0.11 (#1285)
* update tonic 0.8 & prost 0.11

* install protoc via package manager
2022-12-19 15:30:33 +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
04434f02b6 Update points by filter (#1249)
* allow to set remove payload by selector

* fmt
2022-12-01 09:16:07 +01:00
Andrey Vasnetsov
9f36ac60ee Full payload update (#1245)
* implement api to fully overwrite payload of the point

* fmt
2022-11-28 13:46:58 +01:00
Ivan Pleshkov
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 Gourlay
6266d9bcdc enable compression for gRPC (#1186)
* enable compression for gRPC

* add benchmarks

* fix grpc benchmark

* discardResponseBodies to reduce memory usage

* improve & split benchmarks

* do not use gzip for inter node communication as benchmarks are not conclusive
2022-11-18 13:34:49 +01:00
Arnaud Gourlay
286ca9f5e4 0.11.0 cherry picks (#1174)
* implement concern-factor, forbig disabling the last node, improve tes… (#1168)

* implement concern-factor, forbig disabling the last node, improve test stability

* upd docs

* improve test_recover_dead_node

* rename to write_consistency_factor

* Fix bug: applied index higher than commit on restart (#1172)

* create collection with default status = dead + await for activation on create_collecton_op_submit

* fmt

* fix unit tests

Co-authored-by: Egor Ivkov <e.o.ivkov@gmail.com>

* upd integration tests

* fix transaction handling

* upd protobuf

* upd to v0.11.0

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
Co-authored-by: Egor Ivkov <e.o.ivkov@gmail.com>
2022-10-27 10:16:21 +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 Pleshkov
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
Egor Ivkov
9a3fad44b2 Revert "Revert replication changes (#1055)" (#1056)
This reverts commit a2ed0cf5db.
2022-09-23 16:46:06 +03:00
Egor Ivkov
a2ed0cf5db Revert replication changes (#1055)
* Revert "Replication set `Change` enum"

This reverts commit 28e8487542.

* Revert changes (#1053)

* Revert "Generate API - replication follow up (#1043)"

This reverts commit 183ea9e5e3.

* Revert "Replication related API changes (#1037)"

This reverts commit d690b700ff.

* Revert "Persist replica state (#1035)"

This reverts commit 31c3ae482d.

* Revert "[replication] Account for replicas in shard distribution (#1009)"

This reverts commit e332d482b0.

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-09-23 16:33:07 +03:00
Egor Ivkov
183ea9e5e3 Generate API - replication follow up (#1043)
Also removes `JsonSchema` from structs not exposed in API
2022-09-22 14:53:00 +03:00
Egor Ivkov
d690b700ff Replication related API changes (#1037)
* Replication related API changes

* minor proto file fix
2022-09-21 18:49:47 +03:00
Andrey Vasnetsov
dc07b01e1f remove deprecated fields from API (#1030)
* remove depricated fields from API

* fmt

* upd openapi and integration tests

* fix grpc test

* regenerate storage reference data

* improve docs

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2022-09-19 13:51:03 +02:00
Andrey Vasnetsov
03d08236a8 better struct for fts (#1026) 2022-09-16 14:07:50 +02:00
Ivan Pleshkov
f6b2186193 [WIP] Many named vectors per point (#958)
* many named vectors per point (segment-level)

* operation result for dim function

* beautifulized vector name

* fix naming bug

* segment version migration

* fmt

* add segment tests

* are you happy clippy

* fix build

* [WIP] many named vectors per point (collection-level) (#975)

* config and search

* fix placeholders for proxy segment move

* remove VectorType from collection

* are you happy fmt

* vectors in grps messages

* create collections with vectors

* segment holder fixes

* are you happy fmt

* remove default vector name placeholders

* are you happy fmt

* are you happy clippy

* fix build

* fix web api

* are you happy clippy

* are you happy fmt

* record vector&vectors

* openapi update

* fix openapi integration tests

* segment builder fix todo

* vector names for update from segment

* remove unwrap

* backward compatibility

* upd openapi

* backward compatible PointStruct

* upd openapi

* fix record back-comp

* fmt

* vector configuration backward compatibility

* fix vetor storage size estimation

* fmt

* multi-vec segment test + index test

* fmt

* api integration tests

* [WIP] Named vectors struct (#1002)

* move to separate file

* named vectors as struct

* use cow

* fix build

* keys iterator

* avoid copy in PointStruct -> get_vectors

* avoid another copy

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

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2022-09-11 20:59:23 +02:00
Andrey Vasnetsov
24ac939b4a Sync Points API (#985)
* shard sync operation

* fnt

* tests

* fix test

* Update lib/collection/src/collection_manager/segments_updater.rs

Co-authored-by: Egor Ivkov <e.o.ivkov@gmail.com>

* Update lib/collection/src/collection_manager/segments_updater.rs

Co-authored-by: Egor Ivkov <e.o.ivkov@gmail.com>

* match payload after vector only

* Update lib/collection/src/collection_manager/segments_updater.rs

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

Co-authored-by: Egor Ivkov <e.o.ivkov@gmail.com>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2022-09-05 15:09:39 +02:00
Andrey Vasnetsov
c3bc5b3873 rename grpc fields + re-generate docs (#980) 2022-09-01 18:59:47 +02:00
Andrey Vasnetsov
b9eee55a9f Full text search (#963)
* allow additional params for payload field index

* fmt

* wip: full text index building

* fmt

* text search request

* text search request

* full text index persitance and loading

* fmt

* enable fts index in mapping

* clippy

* fix tests + add integration test

* review fixes: extend payload index test

* revert incedental change
2022-09-01 12:50:12 +02:00
Arnaud Gourlay
03c10fc310 Batch recommendation API (#954) 2022-08-22 09:41:22 +02:00
Andrey Vasnetsov
a2acca0345 Segment batch search (#813)
* batch search benchmark

* collect filter iterator in indexed search

* fmt

* fix

* fix

* fmt

* use new tempfile create

* auto batching

* Clippy fixes

* REST, gRPC and internal APIs

* fix bugs & less duplication

* two steps payload retrieval mechanism & fix duplication

* add proxy_segment implementation & tests

* add gRPC docs

* remove unused code (#950)

* only filter ids within a batch

* add more equivalence tests

* add integration test search vs batch

* assert more search options in tests

* cleanup assertions

* fix offset panic

* rename search batch API

* openapi spec

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2022-08-18 14:48:17 +02:00
Egor Ivkov
a4e760af34 AddPeer in one consensus operation (#923)
* AddPeer in one consensus operation
2022-08-09 17:00:38 +03:00
Andrey Vasnetsov
00e965fc96 Configuration change on peer removal (#914)
* propose configuration change along with removal of the peer

* fmt
2022-08-04 14:47:49 +02:00
Andrey Vasnetsov
60c7131cc6 Indexed vectors in collection info (#879)
* include number of indexed points into the info api

* fmt

* await for a certain level of indexing progressing before promoting shard

* log before waiting

* await for index fixes

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2022-08-03 16:19:19 +02:00
Andrey Vasnetsov
826165cfcf fix enum conversion in gRPC (#898) 2022-08-03 09:48:30 +02:00