Commit Graph
502 Commits
Author SHA1 Message Date
4827a362e8 Update collection: HNSW config (#2083)
* Add field to REST collection update to change HNSW config

* Add field to gRPC collection update to change HNSW config

* Update OpenAPI specification

* Update gRPC docs

* Improve optimizer filtering for excluded segment IDs

* Add config mismatch optimizer detecting basic HNSW mismatches

* Trigger optimizers when changing collection HNSW config

* Make config mismatch optimizer aware of vector specific HNSW configs

* Extract triggering optimizers after collection update into function

* Add config mismatch optimizer test for changing HNSW config

* Simplify config mismatch optimizer test

* Add config mismatch optimizer test for vector specific HNSW change

* Reformat

* Update collection HNSW params in integration test

* Validate HNSW config in collection update gRPC endpoint

* Improve description of update collection request

* Do not require to rebuild HNSW when on_disk flag changes

Ref: https://github.com/qdrant/qdrant/pull/2083#discussion_r1231002072

* Do rebuild segment with on_disk change

* Trigger optimizers in parallel

* Recreate optimizers only once on collection update

* Reformat

* Fix incorrect usage of self

* Fix deadlock in collection state config update

* Also rebuild index on full scan threshold change

* decompose worst_segment condition check

* review refactor

* Update lib/storage/src/content_manager/collection_meta_ops.rs

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>

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

Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>

* upd grpc docs

* upd grpc docs

* update openapi

---------

Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
2023-07-18 14:32:13 +02:00
dependabot[bot] 46e0e50747 Bump semver from 1.0.17 to 1.0.18 (#2278)
Bumps [semver](https://github.com/dtolnay/semver) from 1.0.17 to 1.0.18.
- [Release notes](https://github.com/dtolnay/semver/releases)
- [Commits](https://github.com/dtolnay/semver/compare/1.0.17...1.0.18)

---
updated-dependencies:
- dependency-name: semver
  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-07-18 00:23:52 -04:00
Andrey Vasnetsov dda8330e15 detect file extension better (#2272)
* detect file extension better

* fix clippy

* refactor + test
2023-07-17 17:10:52 +02:00
Zein Wen 79475ea972 Add geo_polygon filter to proto interface, complete conversion fn, and add an integration test (#2188) 2023-07-17 12:36:50 +02:00
dependabot[bot] 054ccc10a7 Bump tar from 0.4.38 to 0.4.39 (#2259)
Bumps [tar](https://github.com/alexcrichton/tar-rs) from 0.4.38 to 0.4.39.
- [Commits](https://github.com/alexcrichton/tar-rs/compare/0.4.38...0.4.39)

---
updated-dependencies:
- dependency-name: tar
  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-07-17 10:59:34 +02:00
dependabot[bot] c44b05b39b Bump geo from 0.25.1 to 0.26.0 (#2263)
Bumps [geo](https://github.com/georust/geo) from 0.25.1 to 0.26.0.
- [Changelog](https://github.com/georust/geo/blob/main/CHANGES.md)
- [Commits](https://github.com/georust/geo/commits)

---
updated-dependencies:
- dependency-name: geo
  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-07-17 10:14:09 +02:00
二手掉包工程师 a0f5f895f7 Align the fmt command with .rusty-hook.toml (#2241)
* Align the fmt command with `.rusty-hook.toml`

Signed-off-by: hi-rustin <rustin.liu@gmail.com>

* Address #[warn(clippy::useless_conversion)]

Signed-off-by: hi-rustin <rustin.liu@gmail.com>

* Address #[warn(clippy::drain_collect)]

Signed-off-by: hi-rustin <rustin.liu@gmail.com>

---------

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-07-13 10:52:01 +02:00
Yaroslav Halchenko 6624c95afd codespell: workflow, config, typos fixed (#2248)
* Add github action to codespell master on push and PRs

* Add rudimentary codespell config

* some skips

* fix some ambigous typos

* [DATALAD RUNCMD] run codespell throughout

=== Do not change lines below ===
{
 "chain": [],
 "cmd": "codespell -w",
 "exit": 0,
 "extra_inputs": [],
 "inputs": [],
 "outputs": [],
 "pwd": "."
}
^^^ Do not change lines above ^^^

* Add dev branch as target for the workflow
2023-07-12 16:30:42 +02:00
Arnaud Gourlay d984d751d7 Fix set payload index to handle type change (#2235) 2023-07-10 11:24:14 +02:00
Arnaud Gourlay 17b7731a89 Add message to unimplemented! (#2230)
* Add message to unimplemented!

* yield str id as well

* modern syntax
2023-07-07 12:09:50 +02:00
Luis Cossío 33afc616ce Expose & benchmark binary index (#2174)
* expose boolean index

* benchmark against keyword and no index

* add integration tests

* rename benchmark groups
2023-07-05 09:29:34 -04:00
Ivan Pleshkovandgenerall 12423f910d Add missed vector preprocess (#2203)
* test missed preprocess after segment update

* missed preprocess

* remove preprocess_named_vectors fn

* are you happy clippy

* fix integration tests

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-07-05 00:30:15 +02:00
dependabot[bot] b310eae791 Bump pprof from 0.11.1 to 0.12.0 (#2197)
Bumps [pprof](https://github.com/tikv/pprof-rs) from 0.11.1 to 0.12.0.
- [Changelog](https://github.com/tikv/pprof-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tikv/pprof-rs/commits)

---
updated-dependencies:
- dependency-name: pprof
  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-07-04 08:51:31 +02:00
Luis Cossío 4527f1db81 Small refactor: remove duplicated indexed_points() function (#2103)
* remove duplicated `indexed_points()` function

* update for binary index
2023-07-03 13:25:54 -04:00
cacc942b36 Add binary index (#2107)
* nitpick: use CardinalityEstimation::exact() instead of explicit struct

* wip: implement binary index

* persist binary index

* add tests, refactor binary memory

* use bitflags for BinaryItem, use early return from @timvisee 's review

* fix iterator's end +1

* fix indexed_count, keep track of falses and trues counts

* Fix true/false counts if flag for point was set already

* Remove match in filter structure

* - rename `*_count()`
- fix set_or_insert to actually set
- add more tests

* review suggestions for binary index (#2186)

* small taste refactors

* move memory into its own module

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-07-03 12:49:53 -04:00
Zein Wen a009257884 Add fn polygon_hashes and its helper functions (#2162)
This is one of a series of commits for the new feature Geo Filter by Polygon(#795) that add function polygon_hashes that retrieves as-high-as-possible with maximum of max_regions number of geo-hash guaranteed to contain the whole polygon.

It also includes two helper functions: 1) check_polygon_intersection and 2) minimum_bounding_rectangle_for_polygon.

Test cases validate the functionality for different scenarios.
2023-07-03 18:14:49 +02:00
Andrey Vasnetsov 8e1f228349 handle inconsistent vector storage in sync operation (#2185) 2023-07-03 12:38:18 +02:00
dependabot[bot] 91112ceaa4 Bump num_cpus from 1.15.0 to 1.16.0 (#2182)
Bumps [num_cpus](https://github.com/seanmonstar/num_cpus) from 1.15.0 to 1.16.0.
- [Release notes](https://github.com/seanmonstar/num_cpus/releases)
- [Changelog](https://github.com/seanmonstar/num_cpus/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/num_cpus/compare/v1.15.0...v1.16.0)

---
updated-dependencies:
- dependency-name: num_cpus
  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-07-03 09:52:50 +02:00
dependabot[bot] 12e9271263 Bump num-derive from 0.3.3 to 0.4.0 (#2179)
Bumps [num-derive](https://github.com/rust-num/num-derive) from 0.3.3 to 0.4.0.
- [Changelog](https://github.com/rust-num/num-derive/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-derive/compare/num-derive-0.3.3...num-derive-0.4.0)

---
updated-dependencies:
- dependency-name: num-derive
  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-07-03 09:51:29 +02:00
Luis Cossío dcbddebd0b fix condition to select duration measurer (#2183) 2023-07-02 13:10:32 +02:00
Andrey Vasnetsov 247ea20a4e split search_existing_point_on_level and regular search_on_level functions (#2167) 2023-06-28 18:11:21 +02:00
Tim Visée cb9dbbff87 Validate oversampling (#2100)
* Use unwrap_or_default rather than constructing it manually

* Validate oversampling parameter and surrounding structs

* Validate search limit to be 1 or higher

* Validate hnsw_ef parameter to be 4 or higher

* Also validate parameters in in gRPC

* Update OpenAPI specification

* Add unlikely to reach comment

* Remove hnsw_ef validation rules for now

* Update OpenAPI specification
2023-06-28 14:57:26 +02:00
Tim Visée 30d24c717a Add debug message when segment storage has point and vector count mismatch (#2071) 2023-06-28 14:56:33 +02:00
dependabot[bot] a1d38a497b Bump uuid from 1.3.4 to 1.4.0 (#2159)
Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.3.4 to 1.4.0.
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/1.3.4...1.4.0)

---
updated-dependencies:
- dependency-name: uuid
  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-06-28 08:45:00 +02:00
Zein Wen bdd65c7037 Add GeoPolygon and tests (#2139)
This commit introduces the GeoPolygon struct, representing a polygon defined by a list of coordinates. It includes the check_point method to determine if a given point is inside the polygon. Test cases validate the functionality for different scenarios.
2023-06-27 10:58:32 +02:00
dependabot[bot] a3c4cf1a4b Bump geo from 0.25.0 to 0.25.1 (#2154)
Bumps [geo](https://github.com/georust/geo) from 0.25.0 to 0.25.1.
- [Changelog](https://github.com/georust/geo/blob/main/CHANGES.md)
- [Commits](https://github.com/georust/geo/compare/geo-0.25.0...geo-0.25.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-06-26 22:35:06 +02:00
dependabot[bot] b8c3067d0b Bump memmap2 from 0.7.0 to 0.7.1 (#2152)
Bumps [memmap2](https://github.com/RazrFalcon/memmap2-rs) from 0.7.0 to 0.7.1.
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.7.0...v0.7.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-06-26 21:28:25 +02:00
dependabot[bot] 8a1bd35d88 Bump itertools from 0.10.5 to 0.11.0 (#2135)
Bumps [itertools](https://github.com/rust-itertools/itertools) from 0.10.5 to 0.11.0.
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/compare/v0.10.5...v0.11.0)

---
updated-dependencies:
- dependency-name: itertools
  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-06-26 09:02:22 +02:00
Andrey Vasnetsov fe53fdeb82 delete points from id tracker on flush only (#2136)
* delete points from id tracker on flush only

* move delete-on-flush logic to db wrapper
2023-06-22 23:27:08 +02:00
4f875f5d48 Configurable location of temporary snapshot files (#1960)
* Issue 1905: Configurable location for the tmp snapshot files

* Apply suggestions from code review

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

* fix code review suggestions

* clippy fix

* Propagate temp path, use configured dir for snapshot creation

* Use real temp dir in snapshot tests

* Mention default temporary snapshot file path in configuration

* Use temp everywhere rather than a mix of temp and tmp

* Use consistent naming for temporary snapshot directories

* Extract logic for temporary storage path into toc method

* Resolve clippy warnings

* Apply suggestions from code review

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2023-06-21 22:53:19 +02:00
Tim Visée 2d6f6a4019 Improve vector compatibility checks, fix dimensionality panic (#2124)
* Before inserting vector update, check for correct dimensions

* Improve vector name and data checking on segment level

* Optimize vector compatibility checking

* Remove obsolete vector dimensionality check

* Add test to ensure all segment functions catch bad input

* Test vector checking functions directly as well
2023-06-21 21:10:45 +02:00
Andrey Vasnetsov 1093401353 run all integration tests with on_disk=true and false (#2125)
* run all integration tests with on_disk=true and false

* fix env reading
2023-06-21 21:09:34 +02:00
Andrey Vasnetsov 0f10a7c635 check integrity of snapshot (#2122)
* check integrity of snapshot

* rename check_symlinks to find_symlink
2023-06-21 17:02:31 +02:00
Tim Visée 847f08c96f Fix unused io_uring warning on non-Linux platforms (#2110) 2023-06-20 13:18:04 +02:00
Tim Visée 858b3b3dbe Fix deleted.dat missing in mmap storage snapshot (#2112)
* Fix deleted.dat not being in snapshots

* Update storage test to assert the deleted file is listed

* Remove unused method
2023-06-20 12:44:22 +02:00
Andrey VasnetsovandRoman Titov 010e1686f3 oversampling (#2070)
* wip: add rest param

* WIP: Refactor `search_with_graph` to use oversampling

* fixup! WIP: Refactor `search_with_graph` to use oversampling

Fix `search_with_graph` quantization config handling

* fixup! WIP: Refactor `search_with_graph` to use oversampling

Use `truncate` instead of `shrink_to` 🤦‍♀️

* schrink -> truncate

* protection against wrong oversampling value

* Revert second "fixup! WIP: Refactor `search_with_graph` to use oversampling"

Accidentally commited the wrong file 🤦‍♀️

* fix max method notation

* rollbacK: max notation

* Add `oversampling` field to `QuantizationSearchParams` gRPC type

* Simplify `oversampled_top` calculation

* `./tools/generate_grpc_docs.sh`

* `./tools/generate_openapi_models.sh`

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2023-06-15 11:57:57 +02:00
Luis Cossío 431f59c41b Optimize is_empty (#2073)
* optimize is_empty condition for hitting index

* Optimize is_null too, simplify checker

* refactor: introduce values_is_empty() for indexes
- use `.then()` instead of `&&`

* cargo fmt

* improve comments

* Revert "Optimize is_null too, simplify checker"

This reverts commit b9ebfe5ff2.

* changes from review

* update `test_is_empty_conditions` test for comparing indexed vs not indexed results
2023-06-14 13:56:16 -04:00
Roman TitovandAndrey Vasnetsov de47d40180 Enable Segment::prefault_mmap_pages after load and optimization (#1791) (#1992)
* Enable `Segment::preheat_disk_cache` after load and optimization

* Add `black_box` to prevent compiler from optimizing memmap reads (#2081)

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-06-14 17:02:35 +02:00
Tim Visée 07dba86d08 Improve counting vectors in SegmentInfo (#2072)
* Correctly count vectors in segment info for normal segment

* Correctly count vectors in segment info for proxy segment

* Simplify available point count method

* Minor improvements

* Add unit test for point and vector counts in segment

* Add unit test for point and vector counts in proxy segment

* Improve vector counting for proxy segment
2023-06-14 12:57:06 +02:00
Andrey VasnetsovandRoman Titov 02d105db06 Uring error handelling (#2067)
* prevent garbage leak in case of uring read failure

* fmt

* Simplify `UringReader` error handling

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2023-06-13 16:13:40 +02:00
Tim Visée aa16840ac7 Assume points with no mapping/delete flag are deleted (#2061)
* In scorers, assume a point is deleted if it has no deleted flag

* Cleanup
2023-06-13 15:44:57 +02:00
Andrey VasnetsovandRoman Titov 98184f1d02 WIP: Async uring vector storage (#2024)
* async raw scorer

* fmt

* Disable `async_raw_scorer` on non-Linux platforms

* Refactor `async_raw_scorer.rs`

* Conditionally enable `async_raw_scorer` in `segment` crate

* Add `async_scorer` config parameter to the config...

...and enable `async_raw_scorer`, if config parameter is set to `true`

* fixup! Add `async_scorer` config parameter to the config...

Fix tests

* Add basic `async_raw_scorer` test

* Extend `async_raw_scorer` tests to be more extensive

* Async uring vector storage io uring (#2041)

* replace tokio-uring with just low level io-uring

* fnt

* minor fixes

* add sync

* wip: try to use less submissions

* fmt

* fix uring size

* larger buffer

* check for overflow

* submit with re-try

* mmap owns uring context

* large disk parallelism

* rollbacK: large disk parallelism

* fix windows build

* explicitly panic on uring fail

* fix windows build again

* use async scorer in the quantization re-scoring

* refactor

* rename UringReader

* refactor buffers

* fix for windows

* error checking

* fix handing

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2023-06-12 19:53:23 +02:00
Arnaud Gourlay 5bb721e1fb Add debug info for flaky test Windows (#2039) 2023-06-09 13:45:50 +02:00
dependabot[bot] 114a8dcc87 Bump memmap2 from 0.6.2 to 0.7.0 (#2049)
Bumps [memmap2](https://github.com/RazrFalcon/memmap2-rs) from 0.6.2 to 0.7.0.
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.6.2...v0.7.0)

---
updated-dependencies:
- dependency-name: memmap2
  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-06-09 08:03:36 +02:00
Andrey Vasnetsov a75420ddcc Fix batch request with duplicated filter (#2051)
* fix double usage of iterator

* tests
2023-06-09 00:05:00 +02:00
dependabot[bot] b261ae6e6d Bump tempfile from 3.5.0 to 3.6.0 (#2042)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.5.0 to 3.6.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.5.0...v3.6.0)

---
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-06-08 08:43:55 +02:00
Arnaud Gourlay fcf55b8943 merge integration binaries (segment) (#2033) 2023-06-07 08:46:49 +02:00
Roman Titov f4cfac0bde Add prefault_mmap_pages method to the GraphLinksMmap (#1791) (#2012)
* Add `prefault_mmap_pages` method to the `HNSWIndex`

* Add name to the thread spawned by `Segment::prefault_mmap_pages`
2023-06-05 11:28:46 +02:00
Tim 0ca6c647e1 Fix warnings pointed out by cargo doc (#1997) 2023-06-05 10:20:21 +02:00
Luis Cossío aac0a286b2 Lookup: add lookup feature to group_by (#1996)
* feat: add GroupBy builder
- move PointGroup to `collection` crate
- make GroupBy struct to add lookup feature in a builder pattern

* test: add happy GroupBy tests
- restructure grouping tests into own file
- fix GroupId precedence of i64 vs u64

* update openapi schema

* fix rebase

* tests: minor refactor

* refactor: integrate lookup params into GroupRequest
- rename `Lookup` -> `RetrievedLookup`
- rename `LookupRequest` -> `WithLookup`

* fix: rename `lookup` -> `with_lookup` and set options on tests
- use @timvisee 's suggestion on builder.rs

* refactor: remove `RetrievedLookup` enum

* update openapi
2023-06-02 14:26:50 -04:00