Commit Graph

1062 Commits

Author SHA1 Message Date
Roman Titov
f9cc4e06f4 Merge take_snapshot and take_partial_snapshot methods (#6232) 2025-03-31 16:20:45 +02:00
Jojii
a8c7a034ce Measure Payload IO reads on index creation (#6252) 2025-03-31 16:20:20 +02:00
dependabot[bot]
f230629fa0 build(deps): bump log from 0.4.26 to 0.4.27 (#6247)
* build(deps): bump log from 0.4.26 to 0.4.27

Bumps [log](https://github.com/rust-lang/log) from 0.4.26 to 0.4.27.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.26...0.4.27)

---
updated-dependencies:
- dependency-name: log
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

* put variables inside the strings for log macros

* also for pyroscope

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2025-03-31 16:19:55 +02:00
Jojii
5cd7239b61 Measure Payload Index IO Writes (#6137)
* Prepare measurement of index creation + Remove vector deletion
measurement

* add hw_counter to add_point functions

* Adjust add_point(..) function signatures

* Add new measurement type: payload index IO write

* Measure payload index IO writes

* Some Hw measurement performance improvements

* Review remarks

* Fix measurements in distributed setups

* review fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-03-31 16:19:19 +02:00
Andrey Vasnetsov
ad4743a85f vector-io-read measurement on query (#6197)
* remove mut getters from HardwareCounterCell, as mutability is not useful

* introduce vector-io multiplier

* remove RealCpuMeasurement structure

* set vector-io reads multipliers

* account vector reads in dense scorers

* fmt

* fix tests

* propagate hw_counter into posting list iterator

* fmt

* fix test

* wip: measure of sparse iterator

* fmt

* optimize skip_to

* minor refactoring

* keep current PointOffset in iterator to prevent unnecessary reads from memory

* adjust sparse search cpu cost - account for datatype

* fix test

* refactor search_context tests

* move tests into a module

* introduce more tests

* grammar

* review fixes

* fix clippy

* fix clippy again

* change disposable -> new
2025-03-31 16:19:02 +02:00
Tim Visée
126d4f839a Add feature flag to skip RocksDB in immutable payload indices (#6226) 2025-03-31 16:18:02 +02:00
Roman Titov
c5bbcf8a9d 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-03-21 12:00:43 +01:00
Andrey Vasnetsov
7726126e5b (Potentially) Fix missing CF on flush on payload index change (#6214)
* Handle missing CF on the payload index flush level

* move error handling on the payload field level, so other fields are not skipped if one fails to flush

* Merge nested match statement

---------

Co-authored-by: timvisee <tim@visee.me>
2025-03-21 11:47:07 +01:00
Kumar Shivendu
c9b48bccd1 Snapshot logging improve (#6192)
* Add details to snapshot logging for more details

* Format code and improve log msg

* Remove unused import and improve logs

* Improve terminology for logging

* Minimize noise using logging levels

* Log when moving local shard

* Apply suggestions from code review

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>

* fmt fix

---------

Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2025-03-21 11:46:55 +01:00
Roman Titov
03dc95c74c Check use_mutable_id_tracker_without_rocksdb feature flag when building new segment (#6211) 2025-03-21 11:46:51 +01:00
Andrey Vasnetsov
25ebe796e3 dont anonymize shard transfers (#6208)
* dont anonymize shard transfers

* rabbit review fix

* Remove unused Anonymize derive

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-03-21 11:46:35 +01:00
Tim Visée
1cf51c8656 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-21 11:46:32 +01:00
Tim Visée
8a2e1d82d2 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-21 11:46:24 +01:00
Tim Visée
949ae0af23 Fix typo (#6205) 2025-03-21 11:46:20 +01:00
Luis Cossío
a0a72e8449 [score boosting] Value retrievers return multivalues (#6195)
* retrievers return multivalues

* adjust integration

* fix payload retriever

* graceful conversion
2025-03-21 11:46:17 +01:00
Tim Visée
abf433e6c0 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-21 11:46:14 +01:00
Tim Visée
97a98aab81 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-21 11:46:04 +01:00
Jojii
5f49aa746f 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-21 11:45:51 +01:00
Luis Cossío
7428eba455 [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-21 11:45:46 +01:00
Luis Cossío
0184e2d390 [score boosting] Error on unexpected type (#6187)
* helper for getting payload value

* Error instead of silent default

* fix clippy

* fix openapi test
2025-03-21 11:45:42 +01:00
Andrey Vasnetsov
6df1879e28 fix loading of on-disk payload indexes (#6191) 2025-03-21 11:45:27 +01:00
Tim Visée
69ca59f058 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-21 11:45:21 +01:00
Andrey Vasnetsov
13f0a87c80 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-21 11:45:04 +01:00
Tim Visée
b109e1379d 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-21 11:45:01 +01:00
Luis Cossío
d289a92a55 [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-21 11:44:58 +01:00
Jojii
56a7cfdb20 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-21 11:44:55 +01:00
Tim Visée
ae71337b11 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-21 11:44:47 +01:00
Tim Visée
dcecc54c54 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-21 11:44:28 +01:00
Tim Visée
dfc7d8c163 Embed storage type bytes into enum itself (#6164) 2025-03-21 11:44:18 +01:00
xzfc
9499f56750 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-21 11:44:11 +01:00
xzfc
d5fe14a44e Add Anonymize macro (#6160)
* Add Anonymize macro

* Use Anonymize macro

* anonymize metadata

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-03-21 11:44:06 +01:00
Jojii
9554383a1e Payload fulltext index IO read measurements (#5954)
* FullTextIndex filter measurements

* Clippy

* Add test for `new_accumulator`
2025-03-21 11:44:01 +01:00
xzfc
724b45f182 Add BitSliceExt::get_bit (#6162) 2025-03-21 11:43:57 +01:00
Jojii
6d53bd9184 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-21 11:43:45 +01:00
Tim Visée
fa0fddd17e Reformat simple ID tracker, preallocate internal to version list (#6156) 2025-03-21 11:43:40 +01:00
Tim Visée
82220f3ee1 Fix incorrect assertions in immutable ID tracker test (#6155) 2025-03-21 11:43:36 +01:00
Jojii
9676f9a2c6 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-21 11:43:31 +01:00
Jojii
a2d7947917 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-21 11:42:40 +01:00
Arnaud Gourlay
af5b5bedd7 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-21 11:42:11 +01:00
Luis Cossío
15e7c73196 by_zero_default is the default result, not denominator (#6116) 2025-03-21 11:41:57 +01:00
xzfc
a17e122557 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-21 11:41:54 +01:00
Arnaud Gourlay
3232de86dc Simplify StrictModeConfig hashing (#6112) 2025-03-21 11:41:42 +01:00
Andrey Vasnetsov
c7090e62e8 fix json path anonymization (#6108)
* implement proper anonymization for json path

* fmt
2025-03-21 11:41:37 +01:00
Luis Cossío
34fe874e77 [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-21 11:41:33 +01:00
Luis Cossío
bc227eed5c [score boosting] extract first element of arrays (#6106)
* if a value is an array, extract the first element

* extract variable from geodistance
2025-03-21 11:41:29 +01:00
Andrey Vasnetsov
706b1a3166 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-21 11:41:12 +01:00
Arnaud Gourlay
b5de28db80 Struct deconstruction leftovers (#6071) 2025-03-21 11:40:13 +01:00
Luis Cossío
58c23cabe1 add formula to internal grpc api (#6057) 2025-03-21 11:40:04 +01:00
Luis Cossío
9899b6fda7 [score boosting] add more expressions (#6054)
* sqrt, pow, exp, log, ln, abs

* upd openapi and grpc

* handle undefined math as negative infinity
2025-03-21 11:40:00 +01:00
Ivan Pleshkov
23b40def25 Gpu singleton for tests (#6031)
* gpu singleton for tests

* remove device singleton

* fix basic test

* review remarks

* review remarks
2025-03-21 11:39:21 +01:00