Commit Graph

399 Commits

Author SHA1 Message Date
Arnaud Gourlay
fc64334e29 Validate IntegerIndexParams (#6494)
* Validate IntegerIndexParams

* focus
2025-05-07 16:35:57 +02:00
Arnaud Gourlay
9d6a08e3ce Fix missing gRPC query validations (#6485) 2025-05-05 15:58:48 +02:00
LesserPanda
82439deaf2 fix-typo (#6465)
* fix-typo

* Update openapi.json fix-typo
2025-04-29 16:12:31 -04:00
Andrey Vasnetsov
0ea6bc0b25 Faster wal-delta transfer (#6458)
* implement internal batch-update api

* use batch update in wal-delta

* fix ci
2025-04-29 19:31:50 +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
Tim Visée
1370e01d58 Use ahash for maps/sets holding point IDs, offsets or similar (#6388) 2025-04-17 23:11:35 +02:00
Luis Cossío
f9a537174c [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-04 13:52:01 -03:00
Luis Cossío
5670a7c917 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-03 09:01:39 +02:00
Luis Cossío
ec544ff627 [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-02 12:40:00 -03:00
Andrey Vasnetsov
fbf1ce4d17 implement missing validation for sparse and milti-vectors in grpc (#6274) 2025-03-31 11:22:53 +02:00
Jojii
ae64690c7a 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-24 19:39:17 +01:00
Andrey Vasnetsov
82af7aa481 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-24 13:15:04 +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
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
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
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
Jojii
1fded093b7 Measure hardware IO for update operations (#5922)
* Measure update operations hardware IO

* Add support for distributed setups

* also measure update_local

* Add consensus tests for HW metrics of update operations

* add test for upserting without waiting

* Disable HW usage reporting when not waiting for update API

* Review remarks

* Fix resharding collecting hw measurements

* Fix metric type

* New struct HardwareData for better accumulation

* Ensure we always apply CPU multiplier

* Apply suggestions from code review

* Update src/actix/api/update_api.rs

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

* Fix assert_with_upper_bound_error threshold calculation.

* Clarifying why we don't measure shard cleanup

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2025-03-06 15:03:23 +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
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
Arnaud Gourlay
1d5d997615 Remove validation on CollectionInfo response type (#6107) 2025-03-04 17:30:24 +01: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
Arnaud Gourlay
5b8619729c Struct deconstruction leftovers (#6071) 2025-02-26 15:57:06 +01:00
Luis Cossío
64a117f81e [score boosting] openapi test for formula (#6064)
* add formula to internal grpc api

* add openapi test for formula
2025-02-26 10:28:12 -03: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
Arnaud Gourlay
69a9150bbd Struct deconstruction in conversions (#6066)
* Struct deconstruction in conversions

* payload ops conversions

* inference conversions

* RecordInternal conversion

* shard operation conversions
2025-02-26 12:42:10 +01:00
Arnaud Gourlay
fbf8dfd350 Struct deconstruction in gRPC conversions (#6062)
* Struct deconstruction in gRPC conversions

* explicit conversion
2025-02-26 09:44:25 +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
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
Luis Cossío
08cf86c421 [score boosting] Connect formula to query (#6024)
* finish connecting formula query

* upd openapi
2025-02-21 09:36:18 -03:00
Luis Cossío
c2312d0e50 [score boosting] create query structures and parse them (#5990)
* create REST, CollectionQuery, and ShardQuery structures. Parse all variables and conditions

* move stuff around, rename segment Expression to ParsedExpression

* rename to MultExpression

* add Div in REST, use unique geo_distance tag

* review fixes

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2025-02-21 09:03:25 -03:00
Tim Visée
7a56fd143b Fix mix ups in read/write rate limit settings (#6029) 2025-02-20 10:15:32 +01:00
Arnaud Gourlay
d88e76f90d Fix Clippy 1.85 (#6011)
* Fix Clippy 1.85

* fix false positive
2025-02-18 10:41:28 +01:00
Arnaud Gourlay
1a7e2701d7 Add strict mode for max points count (#5967)
* Add strict mode for max points count

* clarify estimated nature
2025-02-12 11:10:51 +01:00
Kumar Shivendu
9d56dcfa7a fix typo (#5960) 2025-02-08 17:05:53 +05:30
Jojii
bae4c08a2a Measure IO reads for vectors (#5912) 2025-02-03 11:56:43 +01:00
Jojii
5a321d6f09 HwCounter rename IO metrics (#5898)
* Rename io metrics and add vector_io_write

* Chore: Cleanup obsolete TODOs and simplify retrieving HardwareCounterCells (#5899)
2025-01-30 10:23:35 +01:00
Luis Cossío
af74d1b96a bump and migrate to rand 0.9.0 (#5892)
* bump and migrate to rand 0.9.0

also bump rand_distr to 0.5.0 to match it

* Migrate AVX2 and SSE implementations

* Remove unused thread_rng placeholders

* More random migrations

* Migrate GPU tests

* bump seed

---------

Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2025-01-28 16:19:11 +01:00
xzfc
d90a68137b Add VectorName type alias (#5763)
* Add VectorName/VectorNameBuf type aliases [1/2]

* Add VectorName/VectorNameBuf type aliases [2/2]
2025-01-24 01:29:01 +00:00
n0x29a
1796c76e35 Strict mode sparsevector (#5841)
* Strict mode sparse vectors
* Update gRPC docs
* Use deny_unknown_fields (#5868)

---------

Co-authored-by: n0x29a <n0x29a@example.com>
Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2025-01-23 17:34:38 +00:00
xzfc
12137d2264 Fix cargo doc warnings (#5854) 2025-01-23 09:37:20 +01:00
Arnaud Gourlay
4dee0c5bf4 Strict mode multivector (#5757)
* strict mode for multivector

* simplify impl

* regen docs
2025-01-20 15:53:35 +01:00
Tim Visée
47de3955db Fix deleted threshold validation in gRPC, should be in range [0.0, 1.0] (#5810) 2025-01-15 15:39:32 +01:00
Tim Visée
7d57ee485f Resharding: expose direction in gRPC API (#5794)
* Expose resharding direction in gRPC API

* Trim whitespaces
2025-01-14 14:18:51 +01:00
Jojii
3e96fae333 [Strict mode] limits for filter and conditions (#5754)
* Add limits for filter and conditions

* clippy

* Review remarks + nested condition test

* Fix opnapi specs

* Improve error message by giving info about limits and usage
2025-01-14 11:07:27 +01:00
Jojii
9ad886691e IO metrics in hw counter types (#5769)
* io metrics in hw counter types

* Add new metrics to `new_with`
2025-01-10 18:28:34 +01:00
Tim Visée
306f4a88ce Resharding: expose operations in cluster info (#4599)
* Expose resharding operations in cluster info

* Fix collection info conversion to gRPC
2025-01-10 11:50:31 +01:00
Tim Visée
db80432f8b Filter out empty filter conditions from gRPC (#5690)
* Filter out empty filter conditions from gRPC rather than error

* Link pull request
2024-12-24 21:36:56 +00:00
Roman Titov
8beb1106a6 Abort scale-down resharding on update error (#5670) 2024-12-24 13:58:32 +01:00
Tim Visée
2f7cde3d45 Fix collection creation validation, disallow replication factor 0 (#5643)
* Validate default collection config in settings

* Validate shard number, replication/write consistency factor in gRPC

* Cleanup

* Add more validation rules

* Also validate strict mode config in gRPC CollectionConfig

* Update OpenAPI specification
2024-12-20 12:07:58 +01:00