Commit Graph

215 Commits

Author SHA1 Message Date
Tim Visée
15ee747a74 Fix WalConfigDiff not being validated (#1881)
* Fix WalConfigDiff not being validated

* Update OpenAPI specification
2023-05-17 11:25:09 +02:00
Ivan Pleshkov
75cb07c7e4 Product quantization (#1615)
* product quantization

* update quantization version

* refactor

* change api

* PQ -> product rename

* fix grpc comment

* fix tests

* are you happy clippy

* quantization version up

* update quantization

* provide max threads for kmeans

* fix test build

* pq unit tests

* update quantization lib

* update quantization version

* update deleted flags for quantized raw scorer

* fix build

* are you happy fmt

* update grpc docs

* update openapi

* restore storage_builder.try_reserve_exact

* Update lib/segment/src/segment_constructor/segment_builder.rs

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

* Update lib/segment/src/vector_storage/quantized/quantized_raw_scorer.rs

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

* change pub to pub(super)

* Update lib/segment/src/vector_storage/quantized/quantized_vectors.rs

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

* rename to config_exists

* Product quantization compression api (#1834)

* product quantization compression api

* update openapi and grpc docs

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

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

* fix test build

* are you happy fmt

* update grpc docs

---------

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

* product quantization with stopper (#1874)

* product quantization with stopper

* quantization version up

* fix build

* small comment fix

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2023-05-17 11:24:56 +02:00
Arnaud Gourlay
0f0c213c2a Nested object filter (#1602)
* nested object filter

* code review

* add support for must_not in nested

* extract functions

* support and test must_not in SimpleConditionChecker

* add index matching unit test (to be continued)

* remove extra clone

* test with should

* WIP: Nested object filter suggestions (#1855)

* switch to bitvec

* fix clippy

* more tests

* fmt

* fix some tests

* add test with text

* support for nested should

* do not rely on indexes for nested queries & fix test

* use index to make index-aware checks in nested payload

* fix value-count tests

* re-fa-cto-ring

* fmt

---------

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

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-05-17 11:24:52 +02:00
Andrey Vasnetsov
45ae3e048b Dynamic mmap vector storage (#1838)
* wip: chunked mmap

* Fix typo

* insert and get methods

* dynamic bitvec

* clippy

* wip: vector storage

* wip: fmt

* wip: mmap chunks

* wip: mmap problems

* Share transmuted mutable reference over mmap

* option to enable appendable mmap vectors

* fmt

* rename storage status file

* update tests

* fix get deleted value range

* add recovery to vector storage tests

* add flush to tests

* fix transmute from immutable to mutable

* make transmuted pointer private

* remove unused unsafe functions

* force WAL flush if wait=true

* move wal flush into updater thread

* remove flush from update api

* Minimize pub visibility for specialized/dangerous functions

* Allocate vector with predefined capacity

* Inline format parameters

* Assert we have multiple chunks while testing, test is useless otherwise

* Remove unnecessary scope

* Remove unnecessary dereference

* Random bool has 0.5 as standard distribution, use iter::repeat_with

* Replace RemovableMmap::new with Default derive

* Rename len to num_flags

* Use Option replace as it is convention alongside take

* Add FileId enum to replace error prone manual ID rotating

* Use debug_assert_eq where applicable

* Refactor drop and set to replace

* Change default chunk size for chunked mmap vectors to 32MB

This change is made as per GitHub review, because allocating a few
storages with 128MB would take a significant amount of time and storage.

See: https://github.com/qdrant/qdrant/pull/1838#discussion_r1187215475

* Replace for-loops with iterators

* Draft: add typed mmap to improve code safety (#1860)

* Add typed mmap

* Replace some crude mmap usages with typed mmap

* Use typed mmap for deleted flags

* Simplify dynamic mmap flags a lot with new typed mmap, remove flags option

* Reformat

* Remove old mmap functions that are now unused

* Reimplement mmap locking for mmap_vectors

* Add MmapBitSlice tests

* Replace MmapChunk with new typed mmap

* Update docs

* Clean-up

* Disable alignment assertions on Windows for now

* Rename mmap lock to mlock to prevent confusion with lockable types

* one more small test

* Some review fixes

* Add aliasing note

* Add basic error handling in typed mmap constructors

* Use typed mmap error handling throughout project

* Move mmap type module to common

* Fix transmute functions being unsound

See https://github.com/qdrant/qdrant/pull/1860#discussion_r1188593854

---------

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

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
2023-05-17 11:24:32 +02:00
Tim Visée
f9b679a66e Add REST interface to update/delete optional named vectors (#1836)
* Add update/delete REST endpoints

* Add update/delete vector REST endpoints to OpenAPI specification

* Fix update vector with no changes not triggering a validation error

* Update OpenAPI specification for updated request type
2023-05-17 11:22:50 +02:00
Tim Visée
5805811ad4 Add gRPC interface to update/delete optional named vectors (#1816)
* Add segment entry function to update named vectors

* Use already available function to update existing vectors

We already had a segment function to update existing named vectors. This
change ensure we use that instead of separating it separately. As a
bonus, this adds support for setting multiple named vectors at once.

* Update set vectors ourselves, don't drop omitted vectors

* Refactor vector updating functions, separate update and replace

* Add basic vector ops, add update/delete functionality to segment updater

* Add internal and public gRPC types and actions for vectors

* Add gRPC API actions

* Reformat

* Add VectorOperations to vector ops, add basic validation

* Validate gRPC vector types

* Validate vector operation structs

* Construct PointIdsList through From trait

* Update gRPC docs

* Use VectorsSelector for vector deletions in gRPC

* Add support for updating multiple points/vectors in update vectors API

* Update gRPC docs

* Fix incorrect gRPC type numbering

* Return point ID error from vector update/delete functions if not found

* Fix disbalanced vectors test
2023-05-17 11:22:45 +02:00
Luis Cossío
49dba4dd92 Disable indexing and memmap with 0 (#1824)
* feat: use 0 as disable for indexing and memmap

* amend: edit test, update doc comments, remove validation

* fix: use constant instead of literal, reword doc comments

* test: update test for loop and timeout

* fix: remove validation on OptimizerConfigDiff and fix test_validatioin.py

* fix: remove validation from build.rs, remove internal hack from  doccomments

* fix: update grpc docs

* revert max_optimization_threads validation in test

* update config comments and minor test change

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-05-17 11:22:34 +02:00
Andrey Vasnetsov
f4c1e6c8d0 remove invalid validation (#1840) 2023-05-17 11:22:28 +02:00
Andrey Perelygin
483e5075fc Collection Cluster API via GRPC (#1774)
* Collection Cluster API via GRPC

* Conversations fix; map_err fix
2023-05-17 11:20:22 +02:00
Luis Cossío
0cff1564a5 Allow indexing_threshold=null to disable indexing (#1702)
* feat: allow indexing_threshold=null to disable indexing

* fix: continue refactor

* amend: continue refactor

* amend: restore docstring

* update openapi.json

* test: add sanity test

* test: refactor test
2023-05-17 11:00:42 +02:00
Andrey Vasnetsov
8a71d32716 v1.1.3 (#1849) 2023-05-06 19:40:50 +02:00
Ivan Pleshkov
4030bf6e6c v1.1.2 (#1800)
* v1.1.2

* update openapi

* update lib api version

* update openapi version
2023-04-27 19:24:37 +02:00
Ivan Pleshkov
99cc1d10a2 remove m validation for hnswconfig (#1798) 2023-04-27 18:02:05 +02:00
Ivan Pleshkov
8caba26c31 Revert hnsw m min value validation (#1797)
* revert hnsw m min value

* grpc goo

* update openapi
2023-04-27 17:45:03 +02:00
Andrey Vasnetsov
b5f4720c59 up to v1.1.1 (#1700) 2023-04-11 19:36:46 +02:00
Luis Cossío
ac4302f555 [WIP] Include startup date in telemetry (#1676)
* feat: add boot time to telemetry

* refactor: rename boot -> startup

* review fixes

* update openapi

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-11 14:32:02 +02:00
Tim Visée
868626f409 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-11 14:31:34 +02:00
Luis Cossío
e1d494d6be Include "last_responded" in telemetry (#1668)
* feat: include "last_queried" in /telemetry

* fix: anonymize responses in the WebApiTelemetry and GrpcTelemetry Anonymize impls

* fix: anonymize the last_queried field

* fix: use YYYY/MM/DD hh:mm:ss format on 'last_queried'

* tests: add and fix telemetry test

* refactor: rename last_queried -> last_responded

* cargo fmt

* update openapi models

* refactor: rename last_request_time -> last_response_date

* tests: update test

* review changes

* add chrono to schemars

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-11 14:31:28 +02:00
Tim Visée
66ba8f17af 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-11 14:31:18 +02:00
Tim Visée
e8002b2781 Verify quantization configuration on collection creation (#1681)
* Verify quantization configuration on collection creation

* Update OpenAPI specification

* Update range in doc to match validation definition

* Update OpenAPI specification
2023-04-11 14:30:54 +02:00
Tim Visée
f09d19e125 Add CI job to enforce generated OpenAPI and gRPC file consistency (#1667)
* Add test script to ensure OpenAPI files are consistent with sources

* Add CI job to test OpenAPI file consistency

* Add CI task to test gRPC file consistency

* Tweak consistency scripts a bit, touch temp file to trigger gRPC rebuild

* Don't test .gitignored files

* Mention updating the OpenAPI specification is enforced by CI

* Update CI job configuration

* Also check consistency of gRPC docs

* Rename temporary files to have a .diff prefix

* Add docs to consistency checking scripts
2023-04-11 14:30:45 +02:00
Arnaud Gourlay
7657d79f0d cleanup and document openapi issue (#1665) 2023-04-11 14:29:55 +02:00
Alex Huang
de93c75bf3 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-11 13:42:11 +02:00
Ibrahim M. Akrab
2ddce557b2 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-11 13:40:59 +02:00
Tushar Dahiya
8aa0c71ae7 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-04-11 13:38:25 +02:00
Ibrahim M. Akrab
21641346aa add upload snapshot functionality using multipart request (#1578)
* add upload snapshot functionality using multipart request

* remove unnecessary printing

* Add proper error handling

* add snapshot upload integration tests

* Fix maximum uploaded snapshot size limit

* review changes

* update OpenAPI with upload endpoint

* add missed query param in openapi

* remove unused function

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-11 13:37:39 +02:00
Moaz bin Mokhtar
e15e8867b2 doc: added steps to install Qdrant in local dev env (#1576)
* doc: added steps to install Qdrant in local dev env

* doc: move local dev guidance to development.md

* Update DEVELOPMENT.md

fix `rm` command
2023-03-22 00:30:19 +01:00
Andrey Vasnetsov
b452ed2d94 v1.1.0 (#1579) 2023-03-17 17:33:49 +01:00
Tim Visée
e2cb357914 Add /metrics endpoint for OpenTelemetry/Prometheus (#1494, #1541) 2023-03-15 16:30:51 +01:00
Andrey Vasnetsov
8b7e508d27 Quantization re scoring param (#1538)
* parameter to disable rescoring with quantization

* fix

* fix default

* review fixes

* upd api autogen
2023-03-15 16:27:32 +01:00
Andrey Vasnetsov
d7379f0706 Fix recover snapshot peer (#1534)
* allow to recover distributed snapshot on local intance + allow recover non-existing collections

* async snapshot recovery

* fix tests

* be polite earlier
2023-03-15 16:27:10 +01:00
Ivan Pleshkov
128e49fcc3 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-15 16:26:00 +01:00
Luis Cossío
c414a77105 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-03-15 16:20:11 +01:00
Roman Titov
5149d39146 Add /cluster/recover API endpoint (#1451)
- Add required internal `raft::raw_node::RawNode::report_snapshot` calls
- Add methods to propagate `raft::raw_node::RawNode::request_snapshot` call to the consensus thread
- Add `/cluster/recover` API endpooint
- Add `test_collection_recovery.py` integration test (disabled on CI; documents current, incorrect behavior)
2023-03-15 16:19:59 +01:00
Andrey Vasnetsov
8c067bc977 upd to v1.0.3 (#1523) 2023-03-05 21:11:40 +01:00
Andrey Vasnetsov
99d94cbebe upd version (#1486) 2023-02-21 18:36:21 +01:00
Andrey Vasnetsov
486737d7b5 v1.0.1 2023-02-08 14:00:55 +01:00
Arnaud Gourlay
f66031ffdf Update to v1.0.0 (#1434)
* Update to v1.0.0

* resync v1.0.0 openapi
2023-02-08 09:12:02 +01:00
Andrey Vasnetsov
1687e71f74 remove /collections/aliases (#1440) 2023-02-07 08:51:32 +01:00
Andrey Vasnetsov
baed8cfd95 RFC for 2023 roadmap (#1309)
* RFC for 2023 roadmap

* upd bage

* upd titles
2023-02-06 15:23:52 +01:00
Andrey Vasnetsov
3ba631b9bd remove deprecate point ids param in gprc (#1305)
* remove deprecate point ids param in gprc

* upd docs
2023-02-06 15:22:14 +01:00
Roman Titov
34bdbc2fe6 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-06 15:21:43 +01:00
Andrey Vasnetsov
90c6b784f5 add init state to replica set (#1404)
* add init state to replica set

* update openapi

* disallow activating shard from non-initialize state

* fmt

* remove useless operation confirm on collection creation

* clippy fixes

* fix test
2023-02-06 15:20:20 +01:00
Andrey Vasnetsov
80af394d32 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-02-06 15:18:58 +01:00
Andrey Vasnetsov
8cd4fe15ed 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-02-06 15:17:01 +01:00
Arnaud Gourlay
fe06844c48 Delete snapshots API (#1377)
* Delete snapshots API

* remove unecessary plurals
2023-02-06 15:16:33 +01:00
Arnaud Gourlay
25d1383496 List aliases API (rest & gRPC) (#1363)
* List aliases API (rest & gRPC)

* rework api to avoid conflicts
2023-02-06 15:15:52 +01:00
Andrey Vasnetsov
313fa9fe80 upd to v0.11.7 (#1342) 2023-01-13 16:03:56 +01:00
Andrey Vasnetsov
7b59d2b48f up to v0.11.6 - 1.0 release candidate (#1304) 2022-12-27 13:06:48 +01:00
Andrey Vasnetsov
a1f651fbd6 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-25 22:51:36 +01:00