Commit Graph

1780 Commits

Author SHA1 Message Date
Andrey Vasnetsov
4a7f44a446 fix broken snapshot for quantized data (#1889)
* fix quantizatio files path

* add test

---------

Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>
2023-05-15 12:51:56 +02:00
Andrey Vasnetsov
ce2763f1cf disable mlock (#1885) 2023-05-12 15:26:27 +02:00
dependabot[bot]
2491055108 Bump memmap2 from 0.6.0 to 0.6.1 (#1875)
Bumps [memmap2](https://github.com/RazrFalcon/memmap2-rs) from 0.6.0 to 0.6.1.
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.6.0...v0.6.1)

---
updated-dependencies:
- dependency-name: memmap2
  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>
2023-05-11 07:35:57 +02:00
Ivan Pleshkov
e0848a37da 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-10 20:20:52 +04:00
Arnaud Gourlay
a18f5e9802 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-10 14:20:12 +02:00
Tim Visée
e527dd4de1 Fix mmap on Windows (#1873)
* Enable alignment assertion on Windows, error on Windows if mmap is empty

* We only need std::io on Unix platforms

* Sync after resizing file

* Don't test empty mmaps on Windows, add test to assert this edge case

* Test emtpy bitslice on non-Windows platforms

* Clean-up

* Prevent divide by zero panics for zero sized mmap types

* Support zero-sized mmap types on all platforms, extend test cases

- fix divide by zero error for zero-sized types
- zero-sized types are now supported
- on Windows, don't error on empty mmap for zero-sized type
- extend tests to cover all cases

Windows does not support mmap on empty files. Instead of returning an
error on Windows for this specific case, we return an empty type or
slice at a dangling pointer that is properly aligned. That makes the
behavior of the typed mmap consistent across all platforms.
2023-05-10 13:39:04 +02:00
dependabot[bot]
046f989d69 Bump rocksdb from 0.20.1 to 0.21.0 (#1870)
Bumps [rocksdb](https://github.com/rust-rocksdb/rust-rocksdb) from 0.20.1 to 0.21.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.20.1...v0.21.0)

---
updated-dependencies:
- dependency-name: rocksdb
  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>
2023-05-10 13:07:34 +02:00
Tim Visée
0811791fe9 Update memmap2 to remove mutex from typed mmap (#1869)
* Bump memmap2 to v0.6.0

* Remove mutex from typed mmap, now we can lock without exclusive access
2023-05-09 20:20:14 +02:00
Andrey Vasnetsov
83f8b50aca 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-09 18:01:01 +02:00
dependabot[bot]
6f4ffffb3d Bump sysinfo from 0.28.4 to 0.29.0 (#1861)
Bumps [sysinfo](https://github.com/GuillaumeGomez/sysinfo) from 0.28.4 to 0.29.0.
- [Changelog](https://github.com/GuillaumeGomez/sysinfo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/GuillaumeGomez/sysinfo/commits)

---
updated-dependencies:
- dependency-name: sysinfo
  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>
2023-05-08 23:38:32 +02:00
Jesse
34055f0ddf Custom build profile for CI docker builds (#1859)
* Use custom build profile for docker builds

* trigger ci

* change source code to trigger ci with rebuild one more time

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-05-08 20:39:59 +02:00
Jesse
b67c655ddb Add caching of docker layers in CI (#1856)
* Add caching of docker layers in CI

Build required docker images for CI in a workflow step using buildkit's
gha cache type. This will populate the local layer cache from github
actions' cache. Builds in subsequent CI steps will be nearly instant,
because all layers can be reused.

* add minor change to see if build time is any faster

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-05-08 17:02:29 +02:00
Ikko Eltociear Ashimine
417386aaa5 Fix typo in graph_links.rs (#1854)
avaliable -> available
2023-05-07 22:05:52 +02:00
Andrey Vasnetsov
68d5ca063a Prevent quantization on appendable (#1847)
* extra check on loading

* fmt
2023-05-06 18:25:09 +02:00
Tim Visée
eb794795d6 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-05 16:10:46 +02:00
Tim Visée
effac50dad 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-05 15:18:19 +02:00
Tim Visée
1c48de0a8c General optional named vector improvements (#1835)
* Remove unnecessary mut

* Simplify creating option with if

* Simplify some returns

* DRY in vector name checking functions

* Use panic with attribute rather than debug_assert false

* Make update vector function plural because we can update multiple
2023-05-05 08:45:42 +02:00
Roman Titov
16b7fb7688 Improve handling out-of-RAM errors during Qdrant startup (#1777)
* WIP: Start working on out-of-RAM errors handling [skip ci]

* Implement basic handling of out-of-RAM errors during Qdrant startup

* Try to fix CI fail by allowing both V1 and V2 cgroups

* Try to fix CI fail by improving cgroups handling

* Fix cgroups path detection/handling (+ some minor stylistic changes)

* fixup! Fix cgroups path detection/handling (+ some minor stylistic changes)

* Add test

* Enable low RAM test

* fixup! Add test

* free memory checks

* rm unused function

* Oom fallback script (#1809)

* add recover mode in qdrant + script for handelling OOM

* fix clippy

* reformat entrypoint.sh

* fix test

* add logging to test

* fix test

* fix test

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-05-02 20:54:13 +02:00
dependabot[bot]
b988e47c2a Bump quantization from 299d542 to b5b1ff2 (#1821)
* Bump quantization from `299d542` to `b5b1ff2`

Bumps [quantization](https://github.com/qdrant/quantization) from `299d542` to `b5b1ff2`.
- [Release notes](https://github.com/qdrant/quantization/releases)
- [Commits](299d542ce8...b5b1ff2175)

---
updated-dependencies:
- dependency-name: quantization
  dependency-type: direct:production
...

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

* fix build

---------

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-05-02 09:14:49 +02:00
Andrey Vasnetsov
3b95a8e045 undo vector-related changes in estimate_cardinality (#1806)
* undo vector-related changes in estimate_cardinality

* fix adjust_to_available_vectors
2023-04-29 10:04:39 +02:00
Tim Visée
d48cd31a36 Add optimizer for many deleted points, make aware of deleted points and vectors (#1758)
* Minor collection optimizer cleanup

* Make optimizers better aware of available vs soft deleted points

* Fix incorrect deleted state on proxy segment for double delete

* Rename upsert_vector to upsert_point, because we work with points

* Refactor point methods for more clear and consistent naming

* Replace internal_size in IdTracker with total_point_count

* Keep track of vector deletion count on storage creation

* Add sparse index optimizer, to optimize indexes with high deletion count

* Add minimum vector count threshold to sparse index optimizer

* Add sparse index optimizer test

* Use consistent naming, write vector in full everywhere

* Simplify vacuum optimizer a bit

* Merge sparse index optimizer into vacuum optimizer

* Improve update_from in segment builder by returning early

* More accurately count vectors in segment optimizer

* Remove random from vacuum optimizer tests to make them more reliable

* Don't expose the total points in segment info, use available points

* Process review feedback

* Compare available vectors against indexed ones in vacuum optimizer

This is much better than using the number of soft-deleted vectors when
the segment was created for calculations. Not to mention that value had
other problems as well.

* Remove create_deleted_vector_count field, update vacuum test parameters

* Potentially solve out of bound panic when building index

* Review fixes:

- Propagate deleted flags into payload hnsw building
- Use `total` number of points for building HNSW instead of number of
  available points
- minor refactoring of `hnsw_config` copy -> clone
- Better detection of `indexed_points` in HNSW

* fix assert condition

* Optional named vectors optimizer reveiw 2 (#1794)

* review with Ivan

* fmt

* remove available_vector_count from segment entry

* remove total_point_count from segment entry

---------

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

* rollback changes in deleted count in proxy segment

* improve vector threshold detection logic in optimized_segment_builder

* style changes

* fix propagate deleted points to vectors

* Fix typo in method name

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>
2023-04-28 10:36:58 +02:00
Ivan Pleshkov
531abf5da7 Revert hnsw m min value validation (#1797)
* revert hnsw m min value

* grpc goo

* update openapi
2023-04-27 17:44:09 +02:00
Arnaud Gourlay
e0fe29a9f4 Support Array of Scalars in JsonPath extractor (#1784) 2023-04-26 07:55:04 +02:00
Tim Visée
9873ac88ec Make query planner aware of deleted points and vectors (#1757)
* Exclude deleted vectors from HNSW graph building stage

* When estimating query cardinality, use available points as baseline

We should not use the total number of points in a segment, because a
portion of it may be soft deleted. Instead, we use the available
(non-deleted) points as baseline.

* Add plain search check to unfiltered HNSW search due to deleted points

* Cardinality sampling on available points, ignore deleted named vectors

* Estimate available vectors in query planner, now consider deleted points

In the query planner, we want to know the number of available points as
accurately as possible. This isn't possible because we only know the
number of deletions and vectors can be deleted in two places: as point
or as vector. These deletions may overlap. This now estimates the number
of deleted vectors based on the segment state. It assumes that point and
vector deletions have an overlap of 20%. This is an arbitrary
percentage, but reflects an almost-worst scenario.

This improves because the number of deleted points wasn't considered at
all before.

* Remove unused function from trait

* Fix bench compilation error

* Fix typo in docs

* Base whether to do plain search in HNSW upon full scan threshold

* Remove index threshold from HNSW config, only use full scan threshold

* Simplify timer aggregator assignment in HNSW search

* Remove vector storage type from cardinality function parameters

* Propagate point deletes to all its vectors

* Check for deleted vectors first, this makes early return possible

Since point deletes are now propagated to vectors, deleted points are
included in vector deletions. Because of that we can check if the vector
is deleted first so we can return early and skip the point deletion
check.

For integrity we also check if the point is deleted, if the vector was
not. That is because it may happen that point deletions are not properly
propagated to vectors.

* Don't use arbitrary vector count estimation, use vector count directly

Before we had to estimate the number of vectors (for a named vector)
because vectors could be deleted as point or vector. Point deletes are
now propagated to vector deletes, that means we can simply use the
deleted vector count which is now much more accurate.

* When sampling IDs, check deleted vecs before deleted points

* On segment consistency check, delete vectors for deleted points

* Fix vector delete state not being kept when updating storage from other

* Fix segment builder skipping deleted vectors breaking offsets

* update segment to handle optional vectors + add test (#1781)

* update segment to handle optional vectors + add test

* Only update stored record when deleting if it wasn't deleted already

* Reformat comment

---------

Co-authored-by: timvisee <tim@visee.me>

* Fix missed vector name test, these are now marked as deleted

* upd test

* upd test

* Update consensus test

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-25 14:31:04 +02:00
dependabot[bot]
b5ea6352f6 Bump ordered-float from 3.6.0 to 3.7.0 (#1780)
Bumps [ordered-float](https://github.com/reem/rust-ordered-float) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/reem/rust-ordered-float/releases)
- [Commits](https://github.com/reem/rust-ordered-float/compare/v3.6.0...v3.7.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>
2023-04-25 06:34:08 +02:00
dependabot[bot]
d9a3a4c56b Bump atomic_refcell from 0.1.9 to 0.1.10 (#1779)
Bumps [atomic_refcell](https://github.com/bholley/atomic_refcell) from 0.1.9 to 0.1.10.
- [Release notes](https://github.com/bholley/atomic_refcell/releases)
- [Commits](https://github.com/bholley/atomic_refcell/commits)

---
updated-dependencies:
- dependency-name: atomic_refcell
  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>
2023-04-25 06:33:29 +02:00
Roman Titov
e240740ff3 Fix payload index snapshot restoration (#1775) 2023-04-24 21:41:11 +02:00
Roman Titov
5d3f9e167e Improve handling of out-of-disk-space errors during Qdrant startup (#1755)
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-24 13:02:29 +02:00
Arnaud Gourlay
6acaca8bc6 fix Clippy 1.69 lint 'type parameter goes unused in function definition' (#1764) 2023-04-21 14:49:00 +02:00
Tim Visée
bce35092ed Add support for deleted vectors in segments (#1724)
* Use resize rather than while-push loop

* Add deleted flags to simple vector storage

* Add deleted flag to memmap vector storage

* Map BitSlice on mmap file for deleted flags

* Use vector specific deletion BitSlice in RawScorer

* Use BitSlice for deleted points, fix check point logic, clarify names

* Extract div_ceil function to shared module

* We can use unchecked set and replace because we just checked the length

* Add deleted count function to vector storage

* Add vector storage point deletion tests

* Keep deleted state in simple vector storage with update_from, add test

* Keep deleted state in memmap vector storage with update_from, add test

* Simplify div_ceil

* Improve deletion handling in update_from in mmap vector storage

* Improve performance, use trickery to get BitSlice view over deleted mmap

* Use BitSlice where possible, construct BitVec more efficiently

* Incorporate vector specific delete flags in quantized raw scorer

* Don't pin MmapMut, it is not required

* With quantization, keep mmap deleted flags in RAM for better performance

* Advice the kernel to prepare deleted flags mmap for faster future access

* Simplify deleted bitslice access, add bound check, remove unused function

* Fix compilation on Windows

* Cleanup

* Rename delete functions to delete_{point,vec} to prevent confusion

* Use then_some rather than match a boolean

* Lock deleted flags in memory only when quantization is available

* Add docs and stabilize issue link to dev_ceil

* Flush deleted mmap when closing segment

This requires us to to wrap the memory map struct in an Arc and Mutex.
Though this may look inefficient, it doesn't have a negative side effect
on deleted flag performance, because the flags are accessed through a
BitSlice that is separate and doesn't use locking.

* Rename some point functions to vec because that makes more sense

* Simplify delete flag fetching option, use deref func instead of asterisk

* Do not calculate slice size manually, use size_of_val

* remove test raw scorer

* use deref in check

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-20 12:06:29 +02:00
Ibrahim M. Akrab
ac572256e7 Inverted index optimization (#1677)
* Change BTreeSet/BTreeMap to HashSet/HashMap
Use Vec in Document
Use Vec in Postinglist

* fix document removal index out of range

* add common vocabulary dictionary to inverted index

* use radix-trie to store vocabulary

* add documentation for seemingly dangerous unwraps

* Implement BitVec representation of PostingList
Add dynamic switching between Vec and BitVec representation
Split PostingList into its own module

* use same persistent storage for documents

* clean up

* remove unused comments

* keep stored document format the same

* add reverse dictionary for faster document building

* get rid of reverse vocabulary

* review + fix tests

* review + fix clippy

* fix typo

* use u32 as token id

* fmt

* remove patricia_tree

* fmt

* only use vec for posting

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-04-18 18:46:06 +02:00
paulotten
d855d3e146 chore: fix clippy warnings (#1740)
* chore: fix clippy warnings

- Prefer `unwrap_or_else` over `unwrap_or` as the later is always executed.
- Use `clamp`.

* chore: convert `default_quantization_ignore_value` and `default_quantization_rescore_value` to `const fn`

* chore: revert `clamp` change
2023-04-17 11:42:34 +02:00
Ivan Pleshkov
2a65308857 segment ordered deletion test (#1707) 2023-04-13 10:08:31 +03:00
dependabot[bot]
3327f0c095 Bump atomicwrites from 0.4.0 to 0.4.1 (#1719)
Bumps [atomicwrites](https://github.com/untitaker/rust-atomicwrites) from 0.4.0 to 0.4.1.
- [Release notes](https://github.com/untitaker/rust-atomicwrites/releases)
- [Commits](https://github.com/untitaker/rust-atomicwrites/compare/0.4.0...0.4.1)

---
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>
2023-04-13 08:54:14 +02:00
Tim Visée
2552fdacef Fix divide by zero panic (#1710) 2023-04-12 17:59:08 +02:00
Andrey Vasnetsov
cdb714f9a2 make is-empty condition consistent with all other conditions (#1698)
* make is-empty condition consistent with all other conditions

* review and clippy
2023-04-11 18:19:28 +02:00
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
Luis Cossío
139d3eb1e2 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-10 20:20:00 +02:00
Tim Visée
e985ff31b6 General improvements (#1687)
* Change file mode of some .sh files to make them executable

* Remove whitespace on empty lines from YAML configurations

* Fix unused import warning on Windows
2023-04-10 20:03:56 +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
f446f5c7ad 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-10 16:02:11 +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
Ivan Pleshkov
cc3f091d4a additional deleted checks in raw scorers (#1674) 2023-04-07 01:42:33 +03:00
Ivan Pleshkov
d5515ed676 fix search one day bug (#1672) 2023-04-06 16:08:07 +03:00
Andrey Vasnetsov
b73335259f Restore is empty functions as before (#1657)
* is_empty should match with value=null

* fmt
2023-04-04 12:17:07 +02:00
Ivan Pleshkov
4635481492 Add Actix and config validation (#1463)
* actix validation

* add check for memmap/indexing_threshold

* fix actix json settings

* Validate settings configuration on start, print pretty warnings on fail

* Add more validation rules for settings and nested types

* Move shared validation logic into collection/operations

* Show validation warning in log when loading some internal configs

* Show prettier actix JSON validation errors

* Stubs for pretty handling of query errors, reformat validation errors

* Use crate flatten function, the hard work was already done for us

We don't have to flatten validation errors into their qualified field
names ourselves because there is a utility function for this.

* Configure actix path validator

* Actix endpoints don't require public

* Extend validation to more actix types

* Validate all remaining actix path and query properties

* Rephrase range validation messages to clearly describe they're inclusive

* Validate all query params to respond with pretty deserialize errors

* Nicely format JSON payload deserialize error responses

* Improve error reporting for upsert point batches

* Add basic validation test that checks a path, query and payload value

* Add some validation constraints

* Add simple validation error render test

* Update Cargo.lock

---------

Co-authored-by: timvisee <tim+github@visee.me>
2023-04-03 09:43:55 +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
dependabot[bot]
d5351324d7 Bump tempfile from 3.4.0 to 3.5.0 (#1623)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/Stebalien/tempfile/releases)
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/NEWS)
- [Commits](https://github.com/Stebalien/tempfile/commits)

---
updated-dependencies:
- dependency-name: tempfile
  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>
2023-03-29 21:54:51 +02:00
Arnaud Gourlay
39e28282ee Handle ties scores in test assertions (#1597) 2023-03-27 13:47:42 +02:00
dependabot[bot]
740e1c8c4e Bump geo from 0.24.0 to 0.24.1 (#1599)
Bumps [geo](https://github.com/georust/geo) from 0.24.0 to 0.24.1.
- [Release notes](https://github.com/georust/geo/releases)
- [Changelog](https://github.com/georust/geo/blob/main/CHANGES.md)
- [Commits](https://github.com/georust/geo/compare/geo-0.24.0...geo-0.24.1)

---
updated-dependencies:
- dependency-name: geo
  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>
2023-03-24 07:47:52 +01:00