Commit Graph

1780 Commits

Author SHA1 Message Date
Tim Visée
133c8d7a6d Mutable ID tracker: show warning if mapping and versions count mismatch (#6207)
* Add warning if mapping and version count mismatch, WAL should recover

* Make log messages more consistent and concrete
2025-03-20 14:35:24 +01:00
Tim Visée
61c44bfae9 Mutable ID tracker: when using new tracker, don't create RocksDB CFs (#6203)
* When using new mutable ID tracker, don't create RocksDB CFs

* Be smarter about tracker column families, include when opening old storage
2025-03-19 17:57:35 +01:00
Tim Visée
bb8d290424 Fix typo (#6205) 2025-03-19 17:13:16 +01:00
Luis Cossío
c9f673ebc3 [score boosting] Value retrievers return multivalues (#6195)
* retrievers return multivalues

* adjust integration

* fix payload retriever

* graceful conversion
2025-03-19 12:55:58 -03:00
Tim Visée
45d2fd9cf7 Mutable ID tracker integration (#6174)
* Rename mutable ID tracker mappings file

* Make new ID tracker the default, add new variant for RocksDB tracker

* In mutable ID tracker, only list files if they exist on disk

* Don't use the new mutable ID tracker yet

* Feature flag usage of new mutable ID tracker

* Simplify RocksDB check a bit

* Rename both the mutable ID tracker files
2025-03-19 13:37:54 +01:00
Tim Visée
2caa6e1ff8 Mutable ID tracker: truncate mappings file if last entry is partial (#6173)
* Keep track of how many bytes are read, truncate mappings on last partial

* Rely on reader position to detect incomplete entry at the end

* Fix typo

* Handle edge case properly, don't truncate file if fully read

* minor fix

* Add test to assert operation size equals bytes read from stream

* Functions can be constant

* Fix some nitpicks

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-03-19 10:39:53 +01:00
Jojii
3248140815 Payload Index Io measurements with Iterator (#6132)
* IteratorExt helper functions for Hw Measurements + Some impls

* More index impls; Performance improvements; Use new iterator

* Add missing measurement in hnsw search. Use disposable flag in HwCounterCell too

* use precomputed counts more

* Review nits

* Fix measurement of map_index iter_values_map

* Review remarks

* fix OnFinalCount

* remove comment

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2025-03-19 10:37:32 +01:00
Luis Cossío
e86629e8e4 [score boosting] Add decay expressions (#6154)
* Add decay expressions

* remove code duplication in conversion

* test and fix lambda roundtrip

* Remove debug print in decay midpoint validation

* Improve error messages for decay midpoint and scale validation

* use similar lambda for gauss and exp decays

* avoid abs before squaring

* add comment about decay range

* add debug assertion
2025-03-18 17:09:55 -03:00
Luis Cossío
4149e6d2b3 [score boosting] Error on unexpected type (#6187)
* helper for getting payload value

* Error instead of silent default

* fix clippy

* fix openapi test
2025-03-18 12:21:36 -03:00
Andrey Vasnetsov
1fff666939 fix loading of on-disk payload indexes (#6191) 2025-03-18 12:07:38 +01:00
Tim Visée
c2f1403075 Mutable ID tracker: implement storage for point versions (#6169)
* Persist version changes as internal to version mapping, not external

* Read and write versions into file directly

* Warn if versions file has unexpected size

* Optimize writing batch of versions, only seek if needed

* Don't explicitly resize file, it'll be done automatically

* Minor refactoring

* review nits

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2025-03-18 11:18:14 +01:00
Andrey Vasnetsov
a881d0638d Mmap in-ram payload indexes without RocksDB (#6148)
* refactor IndexSelector to support mmap with populate

* specify populate flag DynamicMmapFlags

* replace db+flag with enum StorageType

* fix flag

* disable by default

* clippy

* remove outdated comment

* remove comment

* Update lib/segment/src/index/field_index/bool_index/mmap_bool_index.rs

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-03-17 20:38:54 +01:00
Tim Visée
e86f364dab Mutable ID tracker: implement byte storage format for mappings (#6166)
* Extract common points mappings check into function

* Fully rework load/store for point mapping changes, use byte format

* Add extra serialize/deserialize test for new format

* Fuse iterator

* Add another test case

* Take mutable reader when reading point mapping entry

* Flush versions in the same way we flush mappings now

* Don't explicitly fuse reader, it's not necessary
2025-03-17 14:26:09 +01:00
Luis Cossío
a2dec6f04e [score boosting] fix proxy segment leakage (#6170)
* remove deleted bitslice from rescore_with_formula signature

* dont allocate unnecessary ahash

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-03-17 09:27:31 -03:00
Jojii
e957d6f44a Cardinality estimation IO measurements (#6117)
* Cardinality estimation measurements

* Apply hw measurements to latest changes from dev

* Clippy

* Also measure cardinality estimation for geo index

* Make measured units 'bytes'

* Use PointOffsetType instead of u32 for size calculation

* fix memory cost for check_values_any in mmap index

* fix double counting for value reading in mmap, remove hw_counter from mmap hashmap

* fmt

* fix hw measurement for text index

* Remove non necessary lifetime annotations

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-03-14 11:05:38 +01:00
Tim Visée
c0b97e2028 Add mutable ID tracker tests (#6158)
* Add mutable ID tracker tests, ported from immutable ID tracker

* Also test raw mappings, reset inverse mapping when dropping point

* Always flush mappings before version, also in test
2025-03-14 09:52:55 +01:00
Tim Visée
6a1b9de131 Mutable in-memory ID tracker without RocksDB (#6150)
* Add initial mutable ID tracker

* Correctly handle duplicate point mappings and deleted flags

* Improve error handling in flush

* Preallocate capacity for pending mappings/versions more intelligently

* Warn or error about missing ID tracker files

* Reformat

* Don't crash if just the last mapping/version entry is corrupt

* Move mapping and point parsing into separate functions

* Extract loading logic into separate functions

* Do not allow partially corrupted ID tracker files for now

* Remove TODOs

* Minor improvements

* Fsync mappings and versions file after writing to it

* Return error when fsync fails
2025-03-13 17:12:08 +01:00
Tim Visée
bbc2aa8180 Embed storage type bytes into enum itself (#6164) 2025-03-13 12:26:33 +01:00
xzfc
2a389d201d Refactor GraphLayersBuilder::link_new_point (#6161)
* Extract `link_with_heuristic` and `link_without_heuristic`

* Extract `link_new_point_on_level`

* Replace `match` with `if let`
2025-03-13 12:09:32 +01:00
xzfc
70c4c5a7e4 Add Anonymize macro (#6160)
* Add Anonymize macro

* Use Anonymize macro

* anonymize metadata

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-03-13 12:07:42 +01:00
Jojii
eeca054e22 Payload fulltext index IO read measurements (#5954)
* FullTextIndex filter measurements

* Clippy

* Add test for `new_accumulator`
2025-03-13 09:32:24 +01:00
xzfc
6a900dcba2 Add BitSliceExt::get_bit (#6162) 2025-03-12 20:27:51 +00:00
Jojii
faeba71849 IO read measurements for most Payload indices (#5951)
* Add payload index filtering IO measurements for some indices

* Add payload index metric to api and telemetry

* Also account for index access overhead

* Review remarks

* Anonymize new HardwareUsage field

* Fix tests
2025-03-12 14:31:48 +01:00
Tim Visée
6728358133 Reformat simple ID tracker, preallocate internal to version list (#6156) 2025-03-12 13:02:33 +01:00
Tim Visée
ed5538a211 Fix incorrect assertions in immutable ID tracker test (#6155) 2025-03-12 12:29:42 +01:00
Jojii
c9a6a96bcb Io measurement cleanup and tests (#5949)
* HW measurement cleanup and more tests

* Fix wrong measurements

* Use new assertion function

* Fix Payload Measurement bug. Fix tests
2025-03-12 09:59:43 +01:00
Arnaud Gourlay
4b74671377 Move Bincode to workspace and comment version lock (#6151) 2025-03-11 12:16:35 +01:00
Jojii
bf47c97257 Measure io writes for vector upsertions (#5944)
* Add counter to vector storage API

* Measuring IO write for dense vectors

* Tests, GPU and sparse

* Measure multi vectors too

* Fix comment
2025-03-10 15:27:06 +01:00
Arnaud Gourlay
293e2e9792 Separate StrictModeConfig output structure (#6114)
* Separate StrictModeConfig output structure

* happy regen

* add strict sparse config

* introduce CollectionConfigTelemetry

* upd openapi

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
2025-03-06 15:36:22 +01:00
Luis Cossío
a72835caa0 by_zero_default is the default result, not denominator (#6116) 2025-03-06 10:12:28 +01:00
xzfc
749b9b2c90 Anonymize ShardKey in ReplicaSetTelemetry (#6115)
* Anonymize ShardKey in ReplicaSetTelemetry

* Anonymize vector names in CollectionConfigInternal

* no-op: impl HardwareUsage for HardwareUsage (used in HardwareTelemetry)

* no-op: impl Anonymize for OptimizersStatus (used in OptimizerTelemetry and CollectionsAggregatedTelemetry)

* no-op: impl Anonymize for TrackerStatus in (used in TrackerTelemetry)

* no-op: Anonymize VectorParams in VectorsConfig

* no-op: Copy fields explicitly in OperationDurationStatistics

* no-op: `.clone().map(|x| x.anonymize())` -> `.anonymize()`

* no-op: impl Anonymize for ConsensusThreadStatus (used in PeerInfo and ClusterStatusTelemetry)
2025-03-05 19:04:55 +01:00
Arnaud Gourlay
0b378433ea Simplify StrictModeConfig hashing (#6112) 2025-03-05 11:13:39 +01:00
Andrey Vasnetsov
50781668c4 fix json path anonymization (#6108)
* implement proper anonymization for json path

* fmt
2025-03-04 20:49:20 +01:00
Luis Cossío
6873ed6eb5 [score boosting] Only accept finite numbers (#6092)
* return error for non-finite numbers in expression

* no internal default for division by zero

* add tests

* review suggestions
2025-03-04 16:25:04 -03:00
Luis Cossío
18eb433b91 [score boosting] extract first element of arrays (#6106)
* if a value is an array, extract the first element

* extract variable from geodistance
2025-03-04 15:07:21 -03:00
Andrey Vasnetsov
ea6dc0a91a IsEmpty/IsNull index (#6088)
* create initial strucutres

* clippy

* start field-query refactoring

* start field-query refactoring (2/N)

* start field-query refactoring (3/N): duplicate is_empty/null condiftions as field condition

* start field-query refactoring (4/N): re-instate is_empty fallback in case new index is not built yet

* filter for is_empty/is_null

* implement add/remove point

* upd schema

* open and create of null-index

* create null-index

* fix test

* Update lib/segment/src/index/query_optimization/condition_converter.rs

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

* unit test for null-index

* more unit tests

* add openapi tests

* fmt

* fix for integartion tests

* rabbit review fix

* make [null] non-empty

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-03-04 13:19:50 +01:00
dependabot[bot]
4cc46aa28d build(deps): bump tinyvec from 1.8.1 to 1.9.0 (#6101) 2025-03-03 21:53:50 +00:00
dependabot[bot]
d88be57aac build(deps): bump anyhow from 1.0.96 to 1.0.97 (#6103) 2025-03-03 21:34:15 +00:00
dependabot[bot]
1d4d21a6e5 build(deps): bump serde-untagged from 0.1.6 to 0.1.7 (#6099) 2025-03-03 21:23:08 +00:00
Arnaud Gourlay
5b8619729c Struct deconstruction leftovers (#6071) 2025-02-26 15:57:06 +01:00
Luis Cossío
697c797fa4 add formula to internal grpc api (#6057) 2025-02-26 10:27:53 -03:00
Luis Cossío
64ff5f0af5 [score boosting] add more expressions (#6054)
* sqrt, pow, exp, log, ln, abs

* upd openapi and grpc

* handle undefined math as negative infinity
2025-02-26 09:31:50 -03:00
Ivan Pleshkov
2f45954390 Gpu singleton for tests (#6031)
* gpu singleton for tests

* remove device singleton

* fix basic test

* review remarks

* review remarks
2025-02-25 14:59:24 +01:00
Ivan Pleshkov
c2acb3bb67 Gpu add memory barriers (#6021)
* gpu add memory barriers

* add comments
2025-02-25 14:59:14 +01:00
Tim Visée
3e536347e1 Bump Rust edition to 2024 (#6042)
* Bump Rust edition to 2024

* gen is a reserved keyword now

* Remove ref mut on references

* Mark extern C as unsafe

* Wrap unsafe function bodies in unsafe block

* Geo hash implements Copy, don't reference but pass by value instead

* Replace secluded self import with parent

* Update execute_cluster_read_operation with new match semantics

* Fix lifetime issue

* Replace map_or with is_none_or

* set_var is unsafe now

* Reformat
2025-02-25 11:21:25 +01:00
dependabot[bot]
30421b923a build(deps): bump rand_distr from 0.5.0 to 0.5.1 (#6049)
Bumps [rand_distr](https://github.com/rust-random/rand_distr) from 0.5.0 to 0.5.1.
- [Release notes](https://github.com/rust-random/rand_distr/releases)
- [Changelog](https://github.com/rust-random/rand_distr/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/rand_distr/compare/0.5.0...0.5.1)

---
updated-dependencies:
- dependency-name: rand_distr
  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-02-25 09:03:07 +01:00
Luis Cossío
8ec07b6267 Reuse fixture in payload index test (#6041) 2025-02-24 13:55:17 -03:00
Roman Titov
490660ab86 Extend partial segment snapshot to support ProxySegments (#5978)
* Add `SegmentManifest::segment_id` field

* Tweak `SegmentEntry::take_partial_snapshot` to support `ProxySegment`

* Track segments added into partial snapshot archive

* Debug assert that segment IDs are a valid UUID

---------

Co-authored-by: timvisee <tim@visee.me>
2025-02-24 15:47:32 +01:00
Luis Cossío
b494771e61 [score boosting] add gRPC structures (#6035)
* add grpc structures

* grpc docs

* make by_zero_default optional
2025-02-24 10:44:46 -03:00
xzfc
2c993bd9c3 gpu: zerocopy instead of transmute (#6039) 2025-02-24 11:45:29 +00:00