Commit Graph

1780 Commits

Author SHA1 Message Date
Luis Cossío
7a05502e0c Full text index with generic posting list (#6565)
* integrate generic posting list in full-text index

* improve intersection fn

improve iterator intersection

* make old module just for test

* recover old implementation of MmapPostings for tests

* add compatibility test

* fix compression

* clippy

* nits

* check if first id is already greater

protects against the case where the iterator's current element hasn't
been extracted yet

* update current element when there is no greater or equal

* reuse visitor in test

* optimize alignment

* bound checks and refactor is_in_range

* review

* edit comment

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-05-27 18:53:41 -04:00
Tim Visée
a39b54b82a Actively migrate away from RocksDB based ID tracker (#6579)
* Actively migrate RocksDB ID tracker to new format on segment load

* Extract ID tracker migration logic to function

* Feature flag ID tracker migration

* Simplify ID tracker migration by moving it deeper into load function

* Move migrate function to the bottom

* Add test to assert RocksDB to mutable ID tracker migration

* Assert new mutable ID tracker is empty

* Review remarks

* On RocksDB to mutable ID tracker migration failure, clean up files

* Demote empty mutable ID tracker to debug assertion

* Copy all point versions, including deleted, set known mappings

* read links and versions separatelly

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-05-27 11:36:11 +02:00
Andrey Vasnetsov
e28f1822df use id-tracker to estimate internal points range (#6593) 2025-05-27 09:36:46 +02:00
xzfc
7ff56d61b6 Invert feature_flags.hnsw_healing (#6589) 2025-05-23 11:39:48 +02:00
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
Arnaud Gourlay
e86ab89665 Update Criterion 0.6 (#6570) 2025-05-21 13:52:12 +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
dependabot[bot]
320ad5545b build(deps): bump io-uring from 0.7.6 to 0.7.7 (#6552)
Bumps [io-uring](https://github.com/tokio-rs/io-uring) from 0.7.6 to 0.7.7.
- [Commits](https://github.com/tokio-rs/io-uring/commits)

---
updated-dependencies:
- dependency-name: io-uring
  dependency-version: 0.7.7
  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>
2025-05-20 11:38:18 +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
dependabot[bot]
381b3cc062 build(deps): bump io-uring from 0.7.5 to 0.7.6 (#6492) 2025-05-05 21:30:02 +00: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
dependabot[bot]
d176a379d7 build(deps): bump io-uring from 0.7.4 to 0.7.5 (#6453)
Bumps [io-uring](https://github.com/tokio-rs/io-uring) from 0.7.4 to 0.7.5.
- [Commits](https://github.com/tokio-rs/io-uring/commits)

---
updated-dependencies:
- dependency-name: io-uring
  dependency-version: 0.7.5
  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>
2025-04-29 07:53:19 +02:00
Luis Cossío
6be0c62bb0 Reuse space more in gridstore (#6445) 2025-04-25 18:03:36 -04: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