Commit Graph

1082 Commits

Author SHA1 Message Date
dependabot[bot]
713bb1f85c Bump tonic-build from 0.9.2 to 0.10.0 (#2585)
* Bump tonic-build from 0.9.2 to 0.10.0

Bumps [tonic-build](https://github.com/hyperium/tonic) from 0.9.2 to 0.10.0.
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](https://github.com/hyperium/tonic/commits)

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

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

* Update generated gRPC code

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: timvisee <tim@visee.me>
2023-09-05 11:26:32 +02:00
dependabot[bot]
21f352a3ef Bump schemars from 0.8.12 to 0.8.13 (#2582)
Bumps [schemars](https://github.com/GREsau/schemars) from 0.8.12 to 0.8.13.
- [Release notes](https://github.com/GREsau/schemars/releases)
- [Changelog](https://github.com/GREsau/schemars/blob/master/CHANGELOG.md)
- [Commits](https://github.com/GREsau/schemars/compare/v0.8.12...v0.8.13)

---
updated-dependencies:
- dependency-name: schemars
  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-09-05 09:47:11 +02:00
dependabot[bot]
632fca1658 Bump chrono from 0.4.26 to 0.4.28 (#2581)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.26 to 0.4.28.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.26...v0.4.28)

---
updated-dependencies:
- dependency-name: chrono
  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-09-05 09:46:45 +02:00
Andrey Vasnetsov
f08676a5c5 test for snapshot operations with different volumes (#2554)
* test for snapshot operations with different volumes

* fix collection snapshot upload + test for shards snapshots

* replace persistance -> move_file

* simplify shard snapsot upload method

* fmt

* chmod + x

* replace network host

* fmt

* bash linter [skip ci]

* fix review
2023-09-04 16:07:50 +02:00
Ivan Pleshkov
2a29cf0241 immutable map index integration (#2524)
* immutable map index integration

* remove wipe

* fix unit tests

* get appendable flag from config

* minor refactoring

* fix chunked mmap appendable flag

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-09-04 15:24:52 +02:00
Andrey Vasnetsov
326ef54664 openapi definitions for shard shashots API (#2571)
* openapi definitions for shard shashots API

* review fixes
2023-09-04 14:54:08 +02:00
Andrey Vasnetsov
bfc9fb8307 Handling of shard load failure (#2563)
* deactivate failed shard o transfer if possible

* revert unused changes

* initialize empty shard in case of data transfer into dummy

* clippy fix

* account for an automatic recovery of the corrupted shard
2023-09-04 13:52:23 +02:00
Tim Visée
1d05b9f3ef Centralize common validation functions (#2548)
* Centralize generic range validation

* Centralize validate not empty

* Centralize collection name validation

* Add geo polygon validation in REST API and centralize validation

* Add tests for common validation functions

* Don't use reference in generic range validation function

* Other improvements
2023-09-04 10:57:24 +02:00
zpp12354321
51b5a8d187 fix: remove replaced id when db corrupted (#2510) 2023-09-03 14:00:34 +02:00
Roman Titov
d37c51b92a Handle errors during shard snapshot recovery (#2562)
* WIP: Handle errors during shard snapshot recovery

* fixup! WIP: Handle errors during shard snapshot recovery

Fix typo

* Set shard state to `Dead` on shard snapshot restore failure

* Log failures during error recovery 🙈

* Handle `LocalShard::clear` failure during during local replica restore

* Initialize `DummyShard` if local replica restore failed

* Mark peer as "locally disabled" if local replica restore failed

* Notify peer failure with `ShardReplicaSet::notify_peer_failure_cb`

* fixup! Notify peer failure with `ShardReplicaSet::notify_peer_failure_cb`

Fix typo

* minor refactoring

* fmt

* fmt

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-09-02 18:47:28 +02:00
Luis Cossío
1f0fcfecb6 refactor: Make preprocess() own its vector argument (#2553)
* make preprocess own its vector argument

* update doc comment
2023-09-01 08:55:22 +02:00
Ivan Pleshkov
032f760c5a Immutable map index (#2453)
* immutable map index

* use (super) instead of (crate)

* more comments

* decompose remove_point

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-08-31 15:20:55 +02:00
Arnaud Gourlay
6fd37d04f2 Delete temp snapshot files on error (#2528)
* Delete temp snapshot files on error

* shorter resulting path to please max length on Windows

* Remove one layer of tmp folder for shards

Unicity of segment tmp folder provided by Uuid
2023-08-31 12:09:59 +02:00
Tim Visée
547e602ee1 Limit vector dimension to 65536 (#2544)
* Limit vector dimension to 65536

* Add integration test for new dimension limit
2023-08-31 11:39:05 +02:00
Andrey Vasnetsov
5bf13b4b97 directories cleanup + refactoring (#2536) 2023-08-31 11:32:29 +02:00
Tim Visée
c2faf6c729 Fix missing points, vectors and payload (#2514)
* On segment flush, read-lock all segments to prevent CoW between flushes

For example, we have a point on an immutable segment. If we use a
set-payload operation, we do copy-on-write. The point from immutable
segment A is deleted, the updated point is stored on appendable segment
B.

Because of flush ordering segment B (appendable) is flushed before
segment A (not-appendable). If the copy-on-write operation happens in
between, the point is deleted from A but the new point in B is not
persisted. We cannot recover this by replaying the WAL in case of a
crash because the point in A does not exist anymore, making
copy-on-write impossible.

Locking all segments prevents copy-on-write operations from occurring in
between flushes.

* Return proper status on set payload operations in segment

* Disable propagating point deletions to its vectors, it looses vectors

* Update vector tests after disabling point delete propagation to vectors

* Implement retry with exponential backoff for read-locking all segments

* Use try_read_for rather than sleeping after lock attempts

* Simplify locking many, just lock one by one

Refs: <https://github.com/qdrant/qdrant/pull/2527>
Co-authored-by: generall <andrey@vasnetsov.com>

* Comment out now obsolete test

* Error handling in method getting segment locks by ID

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-08-31 10:03:51 +02:00
Roman Titov
36e317d623 Shard snapshot API (#2410)
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2023-08-30 12:41:29 +02:00
Arnaud Gourlay
2109b94fbe Support consensus WAL format in wal_inspector (#2244)
* Support consensus WAL format in wal_inspector

* add basic raft_state printing

* deserialize consensus operations

* fix display last element & improve rendering

* remove obsolete visibility change

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-08-30 10:57:09 +02:00
Tim Visée
c8d2d33d5d Catch optimizer panics (#2485)
* Add panic handler to stoppable task

* Define panic handler for optimizer task, report panic to segment holder

* Report panic payload message when optimizer panics

* Add function to handle and clean finished optimizer tasks

* Rewrite optimizer worker, periodically clean finished optimizer tasks

* Minor improvements and codespell fixes

* Add simple test to ensure panic callback is called

* Explicitly handle elapsed timeout errors in optimizer handle handling
2023-08-30 10:13:17 +02:00
Tim Visée
8275b42f84 Add shard queue proxy (#2421)
* Add queue proxy shard type

This is similar to the forward proxy shard, but instead of forwarding
operations to a remote it queues them. These queued operations can be
transferred to a remote at a later time.

* Add queue proxy methods for shard to replica set

* Allow to specify max ack WAL version to prevent truncating too early

* Prevent truncating WAL messages a queue proxy shard still relies on

* Fix off by one error, don't batch last item that is already sent

* Minor improvements

* Use forward_update rather than update

* Fix allowing forward proxy into queue proxy for same peer
2023-08-29 16:58:20 +02:00
dependabot[bot]
ee94ec0cd4 Bump url from 2.4.0 to 2.4.1 (#2520)
Bumps [url](https://github.com/servo/rust-url) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v2.4.0...v2.4.1)

---
updated-dependencies:
- dependency-name: url
  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-08-29 08:55:01 +02:00
Tim Visée
dd0f83dffa Report optimizer status and history in telemetry (#2475)
* Add name to optimizers

* Track optimizer status in update handler

* Remove unused optimizer telemetry implementation

* Report tracked optimizer status in local shard telemetry

* Keep just the last 16 optimizer trackers and non successful ones

* Also eventually truncate cancelled optimizer statuses

* Fix codespell

* Assert basic optimizer log state in unit test

* Remove repetitive suffix from optimizer names

* Loosen requirements for optimizer status test to prevent flakyness
2023-08-28 09:14:37 +02:00
Arnaud Gourlay
7e26730b49 Fix truncation of last element of consensus WAL (#2508) 2023-08-25 23:23:54 +02:00
Camden Cheek
9481ed2995 Add gRPC reflection server (#2483)
* add gRPC reflection server

* add basic integration tests

* only advertise public services

* appease linter
2023-08-25 17:18:17 +02:00
Arnaud Gourlay
790103f888 Fix lints for Clippy 1.72 (#2476) 2023-08-24 16:43:34 +02:00
dependabot[bot]
b500f6e446 Bump charabia from 0.8.2 to 0.8.3 (#2490)
Bumps [charabia](https://github.com/meilisearch/charabia) from 0.8.2 to 0.8.3.
- [Release notes](https://github.com/meilisearch/charabia/releases)
- [Commits](https://github.com/meilisearch/charabia/compare/v0.8.2...v0.8.3)

---
updated-dependencies:
- dependency-name: charabia
  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-08-23 12:05:59 +02:00
Ivan Pleshkov
fef89e84b9 fix flaky oversampling test (#2494)
* fix unstable oversampling test

* review fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2023-08-23 11:26:54 +02:00
Andrey Vasnetsov
e140520a15 Fix indexed only (#2488)
* fix indexed only condition + tests

* fmt
2023-08-22 19:47:44 +02:00
dependabot[bot]
1214dab600 Bump tempfile from 3.7.1 to 3.8.0 (#2480)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.7.1 to 3.8.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.7.1...v3.8.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-08-22 15:47:11 +02:00
Ivan Pleshkov
d14d2c2e36 binary quantization (#2470)
* binary quantization

* update quantization version

* fix quantizing bug

* are you happy fmt
2023-08-21 21:16:27 +02:00
Ivan Pleshkov
db3f712b4d fix quantization oversampling (#2478) 2023-08-21 18:04:38 +02:00
dependabot[bot]
0df2c25bc5 Bump ordered-float from 3.7.0 to 3.9.0 (#2472)
Bumps [ordered-float](https://github.com/reem/rust-ordered-float) from 3.7.0 to 3.9.0.
- [Release notes](https://github.com/reem/rust-ordered-float/releases)
- [Commits](https://github.com/reem/rust-ordered-float/compare/v3.7.0...v3.9.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-08-21 09:05:37 +02:00
dependabot[bot]
0a00fc44e0 Bump anyhow from 1.0.74 to 1.0.75 (#2459)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.74 to 1.0.75.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.74...1.0.75)

---
updated-dependencies:
- dependency-name: anyhow
  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-08-21 09:05:11 +02:00
dependabot[bot]
13bc878868 Bump tokio from 1.31.0 to 1.32.0 (#2460)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.31.0 to 1.32.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.31.0...tokio-1.32.0)

---
updated-dependencies:
- dependency-name: tokio
  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-08-18 08:59:42 +02:00
Tim Visée
11ff28dc40 Add internal gRPC call to request remote HTTP port (#2406)
* Add gRPC endpoint to request remote HTTP port

* Add basic gRPC test for fetching remote HTTP port

* Extract gRPC endpoint for fetching HTTP port into internal service

* Add basic internal gRPC test

* Other minor improvements
2023-08-17 09:42:27 +02:00
Tim Visée
ea89a003aa Remove Google's protobuf types (#2454)
* Use built-in well known types from prost

* Remove Google's well known protobuf types
2023-08-17 09:34:20 +02:00
Ivan Pleshkov
8a7f385e35 Map index as a enum (#2446)
* map index trait

* remove trait and move into separate files
2023-08-16 15:27:46 +02:00
Di Zhao
034b46e83e Add indexed_only to speed up search (#2431)
* add ignore_plain_index to speed up search

* remove unnecessary & for vectors_batch

* format

* add special handle for proxy segments where the wrapped segment is plain
indexed

* review refactoring

* rollback changes in google.protobuf.rs

---------

Co-authored-by: Di Zhao <diz@twitter.com>
Co-authored-by: generall <andrey@vasnetsov.com>
2023-08-16 10:56:44 +02:00
dependabot[bot]
aafe2c50ef Bump atomic_refcell from 0.1.10 to 0.1.11 (#2449)
Bumps [atomic_refcell](https://github.com/bholley/atomic_refcell) from 0.1.10 to 0.1.11.
- [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-08-16 09:47:08 +02:00
dependabot[bot]
b921e7d583 Bump anyhow from 1.0.72 to 1.0.74 (#2450)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.72 to 1.0.74.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.72...1.0.74)

---
updated-dependencies:
- dependency-name: anyhow
  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-08-16 08:57:00 +02:00
Roman Titov
6fe7410261 tracing improvements (#2187)
* Add optional `tracing` crate dependency to all `lib/*` sub-crates

* Add optional alternative "tracing-logger"...

...that works a bit better with logs produced by the `tracing` crate

* Make `tracing-logger` reuse `log_level` config parameter (and `QDRANT__LOG_LEVEL` env-var)...

...instead of default `RUST_LOG` env-var only

* Replace `env_logger` with `tracing` (#2381)

* Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log`

TODO:
- Implement slog drain that would *properly* convert slog records into tracing events
  (`slog-stdlog` is fine for now, though)

* fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log`

Fix `consensus` test

* fixup! fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log`

Forget to `unwrap` the result 🙈

* fixup! fixup! Replace `env_logger` with `tracing`/`tracing-subscriber`/`tracing-log`

`tracing_subscriber::fmt::init` initializes `tracing_log::LogTracer`
automatically with default `tracing-subscriber` features enabled 💁‍♀️

* Update `DEVELOPMENT.md` documentation regarding `tracing`

* Update default log level for development to make it less noisy

---------

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

* Implement "intelligent" default log-level filtering

---------

Co-authored-by: timvisee <tim@visee.me>
2023-08-15 18:44:44 +02:00
Andrey Vasnetsov
cef835b02d Query scorer refactoring (#2430)
* refactor query_scorer for simple raw_scorer impl

* fmt

* refactor query_scorer for simple raw_scorer impl

* refactor query_scorer for simple raw_scorer impl

* decouple scorer and storage, move storage into query scorer

* eliminate quantized raw scorer

* Update lib/api/src/grpc/google.protobuf.rs

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2023-08-15 11:57:20 +02:00
dependabot[bot]
0cd4450425 Bump io-uring from 0.6.0 to 0.6.1 (#2441)
Bumps [io-uring](https://github.com/tokio-rs/io-uring) from 0.6.0 to 0.6.1.
- [Commits](https://github.com/tokio-rs/io-uring/commits)

---
updated-dependencies:
- dependency-name: io-uring
  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-08-15 10:11:47 +02:00
dependabot[bot]
c67ce91eea Bump async-trait from 0.1.72 to 0.1.73 (#2436)
Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.72 to 0.1.73.
- [Release notes](https://github.com/dtolnay/async-trait/releases)
- [Commits](https://github.com/dtolnay/async-trait/compare/0.1.72...0.1.73)

---
updated-dependencies:
- dependency-name: async-trait
  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-08-15 09:41:06 +02:00
dependabot[bot]
f6c853ba27 Bump tokio from 1.30.0 to 1.31.0 (#2440)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.30.0 to 1.31.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.30.0...tokio-1.31.0)

---
updated-dependencies:
- dependency-name: tokio
  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-08-15 09:22:52 +02:00
dependabot[bot]
c71a045c69 Bump rstest from 0.18.1 to 0.18.2 (#2437)
Bumps [rstest](https://github.com/la10736/rstest) from 0.18.1 to 0.18.2.
- [Release notes](https://github.com/la10736/rstest/releases)
- [Changelog](https://github.com/la10736/rstest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/la10736/rstest/compare/v0.18.1...v0.18.2)

---
updated-dependencies:
- dependency-name: rstest
  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-08-15 09:21:20 +02:00
Ivan Pleshkov
9e31d594b0 Share keyword strings between points (#2420)
* share keyword strings between points

* fix points to values setup
2023-08-14 21:22:40 +02:00
Ivan Pleshkov
52795d2d47 cancel quantization without panic (#2422) 2023-08-11 18:53:35 +02:00
dependabot[bot]
7fb7c2f1f9 Bump tokio from 1.29.1 to 1.30.0 (#2411)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.29.1 to 1.30.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.29.1...tokio-1.30.0)

---
updated-dependencies:
- dependency-name: tokio
  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-08-11 10:24:37 +02:00
Ivan Pleshkov
46feabdd59 Optimize strings ram usage for map index (#2388)
* optimize strings ram usage for map index

* conversion tests

* are you happy fmt

* better unicode test

* better unicode test

* are you happy clippy

* better comment

* are you happy fmt

* Use SmolStr instead of custom string
2023-08-10 14:01:38 +02:00