Commit Graph

1140 Commits

Author SHA1 Message Date
Arnaud Gourlay
2bba1017d9 Strict mode allows fullscan for multitenant payload index (#6498)
* Strict mode allows fullscan for multitenant payload index

* different error for missing payload index in multitenant case

* handle payload_m

* add simple test

* handle hnsw.m not set

* add another simple test

* fix test

* fallback to global HSNW config

* new error status code

* do not block on global HNSW and improver error reporting

* clearer error reporting

* review fixes

* fix test error messages

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-05-22 10:42:47 +02:00
Tim Visée
ba71f9059c Add RocksDB feature flag to ID trackers (#6572)
* Move point ID conversions

* Extract segment ID tracker creation into function

* Feature flag RocksDB based ID tracker
2025-05-21 17:01:45 +02:00
Tim Visée
11945b1a57 Add RocksDB feature flag to vector storage (#6566)
* Add no-rocksdb feature flag, disable dense vector storage using RocksDB

* Disable multi dense vector storage using RocksDB

* Feature flag now unused function arguments

* Invert no-rocksdb, use rocksdb and enable by default

* RocksDB is required in some benches

* Feature flag RocksDB based sparse vector storage

* Propagate rocksdb feature flag to root crate

* Feature flag stored point, only used in context of RocksDB

* Mention what disabling RocksDB feature does in Cargo.toml
2025-05-21 16:37:13 +02:00
Tim Visée
4581c5694e Add volatile sparse vector storage (#6569)
* Add volatile sparse vector storage

* Add and use volatile sparse vector test

* Update OpenAPI spec

* Resolve review remarks
2025-05-21 16:07:19 +02:00
Tim Visée
1cf4b620d5 Add volatile multi dense vector storage (#6564)
* Add volatile multi dense vector storage

* Add and use volatile multi dense vector storage test
2025-05-21 14:35:38 +02:00
Tim Visée
8c2eba2b99 Add volatile dense vector storage, use in tests (#6561)
* Add volatile dense vector storage

* Use volatile dense vector storage in tests

* Fix compilation error in GPU module

* Simplify constructor

* Use volatile storage in more tests
2025-05-21 14:07:50 +02:00
Tim Visée
da81a35329 Bump MSRV to 1.87 (#6558)
* Bump MSRV to 1.87

* Resolve TODOs
2025-05-20 12:58:01 +02:00
xzfc
e5d3f4e631 HNSW healing (#6543)
* Let SearchContext::new create empty context

* FixedLengthPriorityQueue: add `is_full()`

* Implement HNSW healing

* Apply review suggestions

* review comments and docstrcigs

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-05-19 15:47:37 +00:00
Tim Visée
6742e9b023 Add full text payload index congruence test (#6546)
* Add congruence test for full text payload index

* Report what index variants we're testing

* Use string references

* deterministic keywords

* linting

* Use truncate instead of drain

* Don't check cardinality on deletion, indices behave differently

* Include index type in iterator

* Fix test compilation

---------

Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2025-05-19 12:48:41 +02:00
xzfc
7f6d22c533 Remove some generics from scorer (#6544)
* Make TInputQuery constructor parameter, not struct parameter

* VectorElementType could be implicit
2025-05-16 08:57:08 +00:00
Arnaud Gourlay
5ae56b3777 Fix unecessary unsafe in Clippy 1.87 (#6540)
* Fix unecessary unsafe in Clippy 1.87

* bump Rust version for intrinsics safe API

* ignore until we can bump the MSRV with cargo-chef

* remove unecessary change

* mark clearly as TODO
2025-05-15 21:41:30 +02:00
Luis Cossío
e2d1e6422b Use null index more (#6504)
* take max_point_offset into consideration

* add null index even if index selector is for rocksdb

* fmt

* better cardinality estimation, check deleted inside filtered iter

* fix count indexed points, add primary conditions to estimator

* use len for count_indexed_points, adjust test

* remove deleted check from filtered iter

* cleaner removal
2025-05-14 14:55:49 -04:00
Jojii
37a586726e Make gridstore Advise::Random and add function for sequential read (#6510)
* Make gridstore Advise::Random and add function for sequential read

* Reduce duplicate code in gridstore

* use sequential implementation in iterator

* actually use the sequential read

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2025-05-14 15:09:37 +02:00
Tim Visée
c654c33460 Fix immutable mmap index files not included in snapshot (#6535)
* Fix immutable text index not listing files for snapshot

* Other tweaks
2025-05-14 13:50:04 +02:00
Tim Visée
932d9532e2 Merge pull request #6503
* Add storage enum to geo index

* Construct immutable geo index from mmap geo index

* Load immutable geo index from mmap storage if on-disk is false

* When immutable geo index is loaded into memory, clear mmap cache

* Adjust immutable geo index from mmap loading, consider point deletions

* Rename get_db_wrapper to db_wrapper

* Add immutable mmap geo index test, currently still failing

* Properly load geo index

* Add congruence test

* Also test with deletions

* Fix clipping warnings
2025-05-13 13:06:22 +02:00
dependabot[bot]
0454146a74 build(deps): bump tempfile from 3.19.1 to 3.20.0 (#6523)
* build(deps): bump tempfile from 3.19.1 to 3.20.0

Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.19.1 to 3.20.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.19.1...v3.20.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-version: 3.20.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

* Use keep now as into_path is deprecated

---------

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>
2025-05-13 10:48:57 +02:00
Arnaud Gourlay
46f00d5fdb Fix Clippy 1.87 bis (#6518) 2025-05-12 19:54:13 +02:00
Tim Visée
7c43f25544 Use more write buffers, and flush them (#6514)
* Explicitly flush buffered writers so that we catch errors

* Buffer IO in more places

* Tweaks

* Apply review suggestions
2025-05-12 17:37:51 +02:00
Arnaud Gourlay
1e3017b304 Clippy 1.87 autofix (#6516)
* Clippy 1.87 autofix

* fmt
2025-05-12 15:51:34 +02:00
Tim Visée
01e61aed64 Add in-memory payload index on mmap storage (full text) (#6495)
* Add storage enum to full text index

* Add compressed mmap posting list iterator

* Don't check second condition and return early if possible

* Use helper function for creating empty iterator

* Construct immutable inverted index from mmap inverted index

* Construct immutable text index from mmap text index

* Load immutable text index from mmap storage if on-disk is false

* Match implementation for mutable to immutable inverted index, drop empty

* Point tokens should be none if empty

* Fix chunk reader iterator not buffering remaining postings correctly

* Add immutable mmap full text index to congruence test

* Debug assert deleted points have no tokens

* Add another test

* Fix point deletion regression in immutable full text index

* Use consistent function naming

* Restructure full text index opening and loading, make it consistent

* When immutable full text index is loaded into memory, clear mmap cache

* Remove init from immutable text index

* Prevent potential panic

* avoid panic

* Fix custom iterator size reporting, add test for it

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-05-12 10:58:36 +02:00
xzfc
998675e33c Heuristic optimization (#6501)
* Refactor out LinksContainer

This commit extracts Vec<PointOffsetType> and heuristic related
functions from graph_layers_builder.rs into a new file.

No significant changes in logic are made.

* Optimize LinksContainer

* Add illustration

* Fixups

* Add more comments and rename `score` to `cached_score`
2025-05-09 21:48:52 +00:00
Andrey Vasnetsov
aa95b9d82a Batched reader for segment construction (#6487)
* naive implementation of batched reader for segment construction

* Make reads sequential in BatchedVectorReader (#6508)

* Add sequential reads and improve BatchedVectorReader

* implement get_many_sequential

---------

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

* implement get_many_sequential

---------

Co-authored-by: Jojii <15957865+JojiiOfficial@users.noreply.github.com>
2025-05-09 16:24:42 +02:00
Tim Visée
833f310c3d Buffer all file IO when used as reader or writer (#6513) 2025-05-09 15:48:50 +02:00
Tim Visée
424de4bf9f Add in-memory payload indices on mmap storage (numeric, map) (#6444)
* Add RAM wrapper to mmap numeric index

* Add RAM wrapper to mmap map index

* Fix test compilation

* Merge RAM wrappers into existing immutable indices

Do this to minimize code duplication since the majority of the code is
exactly the same.

* Minor tweaks

* Remove unnecessary pub visibility, remove unused assertion

* Test immutable numeric index on mmap

* In numeric index test, remove some points

* Add map index test

* Restructure index opening and loading, make it consistent

* don't pre-collect intermediate mapping

* review nits

* Make init unreachable for immutable and mmap, clear must consume index

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2025-05-08 12:34:52 +02:00
Luis Cossío
93dea164e8 Deterministic HNSW builder (#6477)
* pass a RNG to hnsw index building

* use single-threaded build for accuracy-measuring tests

* clippy
2025-05-07 11:20:19 -04:00
Arnaud Gourlay
fc64334e29 Validate IntegerIndexParams (#6494)
* Validate IntegerIndexParams

* focus
2025-05-07 16:35:57 +02:00
Ivan Pleshkov
737c15c71d Don't reallocate gpu resources between payload blocks (#6462)
* dont reallocate gpu resources between payload blocks

* are you happy codespell

* fix review remarks

* fix gpu tests

* are you happy clippy
2025-05-05 14:42:09 +02:00
Arnaud Gourlay
b8698cf88b Fix strict mode unindexed group_by path (#6363)
* Fix strict mode unindexed group_by path

* check index schema for matching support

* Handle disabled lookup on integer index
2025-05-02 15:19:50 +02:00
Tim Visée
659874d82c Use byte strings for geohash (#6437)
* Use byte strings for geohash

* Don't take references
2025-04-30 15:50:20 +02:00
Roman Titov
76012bb222 Make segment RocksDB optional, only initialize if required (#6441) 2025-04-29 16:28:58 +02:00
Tim Visée
71213ec06a Fully replace SmolStr with ecow string (#6427)
* Replace SmolStr with EcoString

* Directly format GeoHash, remove intermediate string
2025-04-25 00:54:55 +02:00
Arnaud Gourlay
d4f1f57cb6 Debug assert a missing column family or not loaded payload index (#6193)
* assertion on non built index

* Remove old custome storage for gridstore
2025-04-24 23:52:21 +02:00
Luis Cossío
e36cf799ab [#6266] Remove incorrect assertion (#6428) 2025-04-24 12:26:59 -04:00
Tim Visée
fd775cf03a Use ecow string for shard keys (#6426) 2025-04-24 14:20:41 +02:00
Roman Titov
438fcf86cb Add partial snapshot API endpoints (#6304) 2025-04-24 13:08:13 +02:00
xzfc
44341bb78d Move filtering logic from RawScorer to FilteredScorer (#6245) 2025-04-23 18:23:25 +00:00
Tim Visée
2f310e2e2c Use from rather than into (#6425) 2025-04-23 19:37:06 +02:00
Tim Visée
e39a7c6208 Use smol string as shard key (#6420)
* Use SmolStr as shard key type

* Simplify conversion
2025-04-23 16:28:54 +02:00
Andrey Vasnetsov
2a7c931aee careful index creation (#6403)
* make sure to delete existing index, if it is not compatible with a new one

* fmt

* fix tests

* review fixes
2025-04-23 15:36:31 +02:00
Luis Cossío
23b5f352f1 [mutable text index] No need to wrap vec in option (#6391) 2025-04-22 14:47:51 -04:00
Luis Cossío
56addec5be [rate limits] consider length of multivectors for query cost (#6356)
* consider length of multivectors for rate limiter

* add openapi test

* organize imports

* better cost estimation for sparse vectors

* restore groups openapi test

* address @timvisee's review

* Fix consensus test
2025-04-22 14:10:21 -04:00
Luis Cossío
3749fb6db6 [full-text index] return earlier in text query parsing (#6264) 2025-04-22 13:16:43 -04:00
Andrey Vasnetsov
13bf907261 fill ready-list after initial CPU build (#6410) 2025-04-22 10:18:09 +02:00
Tim Visée
9bf8340001 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:13:40 +02:00
Kumar Shivendu
d3d639ea9d 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-18 15:31:37 +02:00
Andrey Vasnetsov
c57d748dd4 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-17 23:32:10 +02:00
Tim Visée
1370e01d58 Use ahash for maps/sets holding point IDs, offsets or similar (#6388) 2025-04-17 23:11:35 +02:00
xzfc
9fedc65bc4 Clear disk cache after read (#6396)
* Move clear_disk_cache to memory::fadvise

* Add memory::fadvise::OneshotFile

* Use OneshotFile
2025-04-17 10:57:47 +02:00
Andrey Vasnetsov
6d0da2e552 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-15 16:58:38 +02:00
Tim Visée
10ef9eef72 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-15 14:06:23 +02:00