Commit Graph

2788 Commits

Author SHA1 Message Date
Luis Cossío
ef5dbdeae6 [full-text index] return earlier in text query parsing (#6264) 2025-05-22 22:46:31 +02:00
Tim Visée
3617a0111f Also use limit+offset with prefetches, we cut offset at collection level (#6412)
* Also use limit+offset with prefetches, we cut offset at collection level

* Drop comment
2025-04-22 13:31:35 +02:00
Andrey Vasnetsov
ebdb26841e fill ready-list after initial CPU build (#6410) 2025-04-22 10:18:46 +02:00
Andrey Vasnetsov
9eab25fc75 bump v1.14.0 (#6404) 2025-04-21 12:17:44 +02:00
Tim Visée
ebab363257 Qdrant 1.14: enable new shard key format by default (#6270)
* Enable the new shard key format by default now

* Remove now obsolete feature flag
2025-04-21 00:53:01 +02:00
Tim Visée
a6d57e910a Qdrant 1.14: enable mutable ID tracker by default (#6268)
* Enable mutable ID tracker by default

* Remove now obsolete feature flag for new mutable ID tracker
2025-04-21 00:51:00 +02:00
Kumar Shivendu
83af9cf3ba Improve telemetry logic and test (#6399)
* Improve telemetry logic and test

* Parametrize telemetry test

* Consistency hash peeer ID across telemetry

* clean test

* Use Option in segments telemetry

* updat openapi spec

* Avoid test failure on change in order of params
2025-04-21 00:12:26 +02:00
Andrey Vasnetsov
bbea80e7d4 Telemetry improvements (#6390)
* allow shard states in anonymize telemetry (with hashed peer ids)

* introduce level3 and level4 for telemetry, where level4 = everything, incl. segments info

* upd openapi

* fix tests

* expose vector count & size stats on shard level to avoid reading of segments

* fix spelling

* upd schema

* fix tests

* Use unwrap_or_default

* [#6390] skip serializing shard details in Level2 (#6398)

* skip serializing shard details in Level2

* upd openapi

---------

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: Luis Cossío <luis.cossio@qdrant.com>
2025-04-21 00:10:28 +02:00
Tim Visée
e59d395d80 Use ahash for maps/sets holding point IDs, offsets or similar (#6388) 2025-04-21 00:10:22 +02:00
xzfc
1f805b618e Clear disk cache after read (#6396)
* Move clear_disk_cache to memory::fadvise

* Add memory::fadvise::OneshotFile

* Use OneshotFile
2025-04-21 00:08:52 +02:00
Kumar Shivendu
cd1287a2b9 Recover dirty shards using other replicas when marked Dead (#6293)
* Test behaviour of Qdrant with shard initializing flag

* Corrupt shard directory and let Qdrant panic like prod

* Wait for shard transfer

* Restore dirty shards using other replicas

* remove unused code

* Request transfer only if replica is dead or dirty

* fmt

* remove comment

* fix clippy

* Delete shard initializing flag after initializing empty local shard

* Expect test to recover shard in existing test

* Review suggestions

* Run tests for longer

* Simplify tests

* Use 2k points

* condition for point_count

* Add comment

* fix flaky tests

* fix flaky tests

* handle edge case

* Include Active in expected states list

* Introduce is_recovery

* simplify tests

* get rid of is_dirty bool in DummyShard

* add missing negation in condition

* fix condition

* final fix for transfer condition

* Don't auto recover if in recovery mode, simplify state checking

* minor comment improvements

* tests scenario where node is killed after deleting shard initializing flag

* Fix failing CI

* Only automatically recover dead replicas

* Mark replica as dead to recover dummy shard

* fix failing test

* Sleep one second after killing peer, give time to release WAL lock

* Prevent waiting for peer to come online indefinitely

* update comment

* minor typo

---------

Co-authored-by: timvisee <tim@visee.me>
2025-04-21 00:08:45 +02:00
Kumar Shivendu
b5e5f97bf9 Abort resharding if any Resharding replica is to be marked dead (#6364)
* Abort resharding if any Resharding replica is to be marked dead

* Abort resharding before marking shard as Dead

* add comments

* Abort resharding after marking as dead (#6394)

* Force delete points when aborting resharding, even if replica is dead

* Abort resharding after marking replica as dead

* Only abort resharding if we mark related replica as dead

* Just rely on shard replica state

* Propagate shard transfer error right away

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-04-21 00:07:40 +02:00
Andrey Vasnetsov
a9795f7ce4 faster mmap numeric index (#6381)
* wip: attempt to investigate slow mmap numeric index

* fmt

* Improve performance of ConditionedCounter (#6384)

* Improve Performance of ConditionedCounter

* Remove unneeded hw_counter from signatures

* Clippy

* Fix Clippy II

* Fix Clippy III

* Fix Clippy IV

* Use static string, don't allocate string

* Remove allow dead code attribute

---------

Co-authored-by: Jojii <15957865+JojiiOfficial@users.noreply.github.com>
Co-authored-by: timvisee <tim@visee.me>
2025-04-21 00:07:08 +02:00
Tim Visée
4f6d3b928a Speed up pending changes lookups using ahash (#6385)
* Add bench for mmap_bitslice_buffered_update_wrapper

* Use ahash in buffered mmap/RocksDB types and in payload storage

* Function is used in testing only
2025-04-21 00:06:46 +02:00
Andrey Vasnetsov
2b86a4b020 Fix update wrapper (#6383)
* fix flush routine for persistent wrappers

* fmt

* rollback changes for write-only wrappers

* Use retain to drop flushed items

* Rename function

---------

Co-authored-by: timvisee <tim@visee.me>
2025-04-21 00:05:56 +02:00
dependabot[bot]
699fa59360 build(deps): bump self_cell from 1.1.0 to 1.2.0 (#6380) 2025-04-21 00:03:43 +02:00
dependabot[bot]
32c9faa745 build(deps): bump anyhow from 1.0.97 to 1.0.98 (#6374) 2025-04-21 00:03:38 +02:00
Jojii
121b2d543e Fix some wrong vector-read IO measurements (#6365)
* Fix some wrong vector_storage io measurements

* Review remarks
2025-04-21 00:02:45 +02:00
xzfc
feb06c9113 Enable incremental_hnsw_building default (#6355) 2025-04-21 00:02:36 +02:00
Tim Visée
f57796b8bf Parallelize large segment search batches (#6326)
* Parallelize large segment search batches

* Shortcut empty search and scroll requests

* Link to related GitHub issues

* Simplify query batch chunking, use fixed size chunks

* Don't measure read costs if we have a disposable counter

* Batch searches deeper down instead, keep original rate limiting
2025-04-21 00:01:58 +02:00
Luis Cossío
156c79ebdc [query api] don't propagate offset into prefetches (#6357)
* don't propagate offset into prefetches

* I want to see CI with that change

* Move import into platform specific scope

* edit test to make sure offset is not propagated

* fix planned query test

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
Co-authored-by: timvisee <tim@visee.me>
2025-04-20 23:59:01 +02:00
Luis Cossío
076bcdaa16 refactor QueryEnum::Nearest for using NamedQuery (#6349)
* refactor QueryEnum::Nearest for using NamedQuery

* use explicit `NamedQuery::from`
2025-04-20 23:58:39 +02:00
Arnaud Gourlay
b1b27c088a Fix strict mode query limit for distance matrix API (#6354) 2025-04-20 23:58:02 +02:00
xzfc
7a1a96e22b Incremental HNSW index building: append-only case (#6325)
* Pass FeatureFlags into VectorIndexBuildArgs

* Incremental HNSW index building: append-only case

* Use debug_assert

* first_few_ids

* Check deleted_point_count

* Drop unused method
2025-04-20 23:55:57 +02:00
Arnaud Gourlay
e4400c6051 Fix strict mode query limit for group APIs (#6353) 2025-04-20 23:55:48 +02:00
xzfc
3d988e66c4 Remove is_stopped from RawScorer (#6305)
* Introduce CancelledError

* Remove is_stopped from RawScorer
2025-04-20 23:55:39 +02:00
Andrey Vasnetsov
6e0ddbafa9 disk cache hygiene (#6323)
* wip: implement explicit populate and clear_cache functions for all components

* fmt

* implement clear and populate for vector storages

* fmt

* implement clear and populate for payload storage

* wip: implement explicit populate and clear_cache functions payload indexes

* implement explicit populate and clear_cache functions payload indexes

* fix clippy on CI

* only compile posix_fadvise on linux

* only compile posix_fadvise on linux

* implement explicit populate and clear_cache functions for quantized vectors

* fmt

* remove post-load prefault

* fix typo

* implement is-on-disk for payload indexes, implement clear on drop for segment, implement clear after segment build

* fmt

* also evict quantized vectors after optimization

* re-use and replace advise_dontneed
2025-04-20 23:54:40 +02:00
dependabot[bot]
f5f2a7e81d build(deps): bump smallvec from 1.14.0 to 1.15.0 (#6340)
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.14.0 to 1.15.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.14.0...v1.15.0)

---
updated-dependencies:
- dependency-name: smallvec
  dependency-version: 1.15.0
  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>
2025-04-20 23:54:25 +02:00
dependabot[bot]
986ffb9769 build(deps): bump flate2 from 1.1.0 to 1.1.1 (#6341) 2025-04-20 23:53:28 +02:00
Arnaud Gourlay
841048bbd2 Read rate limiter charge per filter condition (#6333) 2025-04-20 23:53:17 +02:00
xzfc
ab40beb65d Update hnsw_build_asymptotic benchmark (#6299)
* Update hnsw_build_asymptotic benchmark

* Comments and logs
2025-04-20 23:53:09 +02:00
Arnaud Gourlay
ce07c9ae20 Remove unused Issues dependency on Segment (#6331) 2025-04-20 23:53:02 +02:00
Arnaud Gourlay
db7dcda044 Rate limit retrieve based on number of ids (#6327)
* Rate limit retrieve based on number of ids

* fmt

* Better test
2025-04-20 23:52:54 +02:00
Luis Cossío
317f1e0dbe [strict mode | score boosting] Strict mode for formula queries (#6317)
* move problems.rs to collection crate

* change type on datetime_key expression

* extract from expression

* check for unindexed fields in formula

* clippy

* dedup code

* Only implement verification for `CollectionQuery` types (#6319)

* verify CollectionQuery's Prefetch

* remove implementation for REST query

* remove implementation for REST query groups

* add basic openapi test
2025-04-20 23:52:36 +02:00
Arnaud Gourlay
6e2191fcae Document Multivector Euclidean scoring discrepancy (#6320) 2025-04-20 23:52:28 +02:00
Arnaud Gourlay
6518a053c9 Rate limite recommendation based on number of examples (#6324) 2025-04-20 23:52:11 +02:00
Tim Visée
d854b41ac1 Migrate WAL mutex from parking lot to tokio (#6307)
* Migrate WAL from sync parking lot to async tokio mutex

* Improve logging

* Migrate tests
2025-04-20 23:52:02 +02:00
Arnaud Gourlay
9c008f4013 Make read rate limiter cost lazy (#6321) 2025-04-20 23:51:54 +02:00
Jojii
4585c3571c Fix measuring in memory inverted index (#6316)
* Fix measuring in memory inverted index

* Reduce overhead of get_token_id

* Remove not used function
2025-04-20 23:51:43 +02:00
Jojii
231d579f70 Don't measure in memory geo, map and numeric indices (#6311) 2025-04-20 23:51:37 +02:00
Jojii
dcd5674ebb Writeback counter cell (#6190)
* Add WritebackCounterCell

* Replace custom counting with WritebackCounterCell

* Update lib/common/common/src/counter/counter_cell.rs

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-04-20 23:51:26 +02:00
Jojii
07fbe5465b Don't measure in-memory hw for full text indices (#6309)
* Don't measure in-memory full text index

* Clippy

* Fix mmap_postings conditioned counting
2025-04-20 23:51:17 +02:00
Jojii
5117e24758 Only measure HW if on disk for bool index (#6296)
* Only measure HW if on disk for bool index

* Remove missed measurement
2025-04-20 23:51:08 +02:00
xzfc
ee7b764429 Use MaybeUninit in vector storages and query scorers (#6303) 2025-04-20 23:50:11 +02:00
Jojii
a276ffec1e Add ConditionedCounter (#6295) 2025-04-20 23:49:49 +02:00
Luis Cossío
e114801ebf sum_scores recommendation strategy (#6256)
* Add in rest and grpc

* add to QueryEnum

* implement Query trait

* connect to scorer creation

* upd tests

* additional changes

* fmt

* gen openapi and grpc docs

* coderabbit fix

* add changes in async scorer

* test sum_scores in more places, refactor to remove repetition
2025-04-20 23:47:58 +02:00
Luis Cossío
8084f4cac1 [score boosting] support datetime expressions (#6196)
* use f64 as internal expression score

* allow datetime as expression

* add test cases

* fix schema, generate openapi and grpc docs

* fmt

* clippy

* fix test precision

* graceful handling of too large numbers, more tests

* rename to DatetimeExpression for consistency

* use datetime's timestamp as seconds

* capture variable name when parsing

* homogenize DateTime into Datetime

* use interface distinction between datetime strings and payload keys

* fix rebase

* fix after rebase
2025-04-20 23:47:20 +02:00
Roman Titov
90340a098c Implement partial snapshot recovery (#6206)
- Fix creating partial snapshot without RocksDB backup
- Fix `segment_manifest.json` file placement
- Implement partial snapshot recovery
- Allow restoring partial snapshot for all shard types
- Validate segment manifests when recovering partial snapshot
- Log error, if streaming shard/partial snapshot failed
- Contextualize errors in `snapshot_files` function
- Tweak log messages in `Segment::take_snapshot` method
- Remove unnecessary lifetimes from `SegmentHolder` iter methods
2025-04-20 23:46:47 +02:00
Kumar Shivendu
802d0b58b5 Fix dummy shard recovery after snapshot restore failure (#6297) 2025-04-20 23:44:30 +02:00
Andrey Vasnetsov
c15a6ca442 Scroll lock: make sure no segments are modified between scroll and retrieve (#6289)
* Scroll lock: make sure no segments are modified between scroll and retrieve

* Take write lock in block_in_place to prevent blocking tokio runtime

* Use blocking write

* Recover collection snapshot on general runtime

* Make function const

---------

Co-authored-by: timvisee <tim@visee.me>
2025-04-20 23:44:25 +02:00