Commit Graph

477 Commits

Author SHA1 Message Date
lphuc2250gma
752b7e6b63 fix: duplicated words in metrics.rs and validation.rs comments (#9041)
Signed-off-by: Noa Levi <275430404+lphuc2250gma@users.noreply.github.com>
Co-authored-by: Noa Levi <275430404+lphuc2250gma@users.noreply.github.com>
2026-05-15 10:05:43 +02:00
Luis Cossío
ee739aff79 [UIO] Introduce Populate enum (#8946)
* introduce `Populate` enum

* fix: apply CodeRabbit auto-fixes

Fixed 6 file(s) based on 6 unresolved review comments.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>

* fix coderabbit fix

* Use from rather than into

* add `Auto` variant

* fix rebase

* fix rebase again

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Co-authored-by: timvisee <tim@visee.me>
2026-05-14 14:49:09 -04:00
Luis Cossío
bc44640216 uring only for linux (#9046) 2026-05-14 12:41:21 -04:00
xzfc
4bd0cb29f5 Replace Meta with U: UserData (#9009) 2026-05-13 00:06:27 +00:00
Andrey Vasnetsov
75b3c92018 refactor mmap hashmap (#8405)
* AlignedBuf

* UniversalHashMap

* Update wording

---------

Co-authored-by: xzfc <xzfcpw@gmail.com>
2026-05-12 04:03:51 +00:00
Luis Cossío
6599f545da [UIO] Additional UniversalRead/Write usage simplifications (#8961)
* bytemuck::Pod already implies 'static

* no supertraits

* regions gaps with TypedStorage

* StoredBitSlice with TypedStorage

* bytemuck for PostingsHeader

* bytemuck for TrackerHeader

* bytemuck for MmapRange

* bytemuck for stored_point_to_values::Header
2026-05-08 20:07:03 +02:00
Andrey Vasnetsov
64244330b1 Move element type from UniversalRead trait to method generics (#8955)
* Move element type from UniversalRead trait to method generics

Lifts the `T` parameter off `trait UniversalRead<T>` (and the matching
`UniversalWrite<T>`) and onto the read/write methods themselves. The
`ReadPipeline` associated type becomes a GAT over `T`. With per-method
generics, callers that need to read several element types from one storage
just write `S: UniversalRead` instead of stacking
`UniversalRead<u8> + UniversalRead<Counts> + ...`.

Removes the workarounds the old shape required:
- `TypedStorage<S, T>` newtype (sole purpose was disambiguating multi-bounds)
- `UniversalReadFamily` HKT shim
- `StoredGeoMapIndexStorage` four-bound trait alias
- `CachedSlice<T>` is now non-generic; `T` moves to `get_range`/`len`

No runtime behavior change: alignment in `IoUringRuntime` and `CachedSlice`
is preserved because `T` is still known at each call site.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Restore TypedStorage as a typed-access fail-safe

Reintroduces `TypedStorage<S, T>` as a transparent wrapper around
`UniversalRead`/`UniversalWrite` storage that fixes the element type to
`T`. With per-method generics on the underlying traits, callers can
otherwise read or write any `T` from the same handle; this wrapper
binds it at the type level so accidental cross-type access fails to
compile.

The wrapper exposes inherent typed methods (`read::<P>`, `read_iter`,
`write`, `len`, …) that delegate to the inner storage with `T` fixed.
It does not implement `UniversalRead`/`UniversalWrite` itself — those
are intentionally avoided to prevent the typed binding from being
bypassed via the generic trait methods.

Restores the wrapping at the previous call sites: `StoredStruct`'s
inner storage, `ImmutableIdTracker`'s version mmap, the geo and
numeric index storages, the chunked-vectors chunks, and the
immutable dense vector storage.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* Silence clippy::len_without_is_empty on TypedStorage

`TypedStorage::len` returns `Result<u64>` (a fallible byte length from
the underlying storage), so an `is_empty` companion would also be
fallible and offer nothing over `len()? == 0`. Suppress the lint at
the impl block, matching how the underlying `UniversalRead::len` is
already exempted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fmt

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 17:37:34 +02:00
Tim Visée
4bca939259 Bump dev version to 1.18.1-dev (#8960) 2026-05-08 17:27:10 +02:00
xzfc
d8e49327f8 Split mmap_hashmap into multiple files (#8933)
Co-authored-by: generall <andrey@vasnetsov.com>
2026-05-07 14:35:15 +00:00
Daniel Boros
dddc6e9b6f feat/vector-storage-read-only (#8889)
* feat: add vector storage read enum

* fix: linter

* chore: remove open functions

* fix: compiler error

* review fix 1: remove constructiors (for now), use UniversalReadFamily, implement 1st part of VectorStorageReadEnum

* fmt

* read only chucked_vector_storage

* fnt

* feat: add dense chunked variants to vector storage read enum (#8916)

* feat: add multi dense chunked (#8918)

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2026-05-06 13:31:23 +02:00
xzfc
d5789bb78b Callback-based InvertedIndex::for_each_token_id (#8905)
* TokenizerTextKind

* IteratorExt::try_any

* Callback-based InvertedIndex::for_each_token_id
2026-05-05 22:25:13 +00:00
Luis Cossío
fb051280a4 Properly handle O_DIRECT in io-uring (#8833)
* handle o_direct with custom buffer

* make separate impl

* use correct inner offset

* align buffer

* codespell

* review fixes

* use o_direct in tests

* clippy

* fix simple read impl

* simpler to_vec()

* use router function

* change todo comment
2026-05-05 11:07:36 -04:00
Luis Cossío
c1ba01ba39 [UIO] Generic dynamic flags (#8893)
* rename status

* impl simple StoredStruct

* use StoredStruct in `status`

* rename to `DynamicStoredFlags`

* Propagate `S` generic

* codespell nit
2026-05-05 10:46:10 -04:00
Roman Titov
4ef7b1e4a5 io_uring pipelinemaxxing (#8897) 2026-05-05 11:17:56 +02:00
Roman Titov
cb34d95417 UniversalRead cleanup (#8894)
* Cleanup lifetimes and generic type parameters

- Rename read pipeline lifetime from `'a` into `'file`
- Use explicit `where` clauses everywhere

* Cleanup

* fixup! Cleanup lifetimes and generic type parameters
2026-05-04 23:03:08 +02:00
Roman Titov
6942b54bfb Simplify UniversalReadPipeline (#8850) 2026-05-04 19:57:29 +02:00
generall
3eef48279b refactor(common): use EitherVariant for NumericIndexInner::stream_range
Drop the bespoke 4-arm \`NumericRangeIter\` enum introduced in the prior
commit. The existing \`common::either_variant::EitherVariant\` is the
same shape and already has \`Iterator\` plus all the standard adapter
specializations.

Adds a \`DoubleEndedIterator\` impl to \`EitherVariant\` (\`next_back\`,
\`nth_back\`, \`rfold\`, \`rfind\`) so it can be used in this position.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-04 13:31:35 +02:00
Andrey Vasnetsov
7486a57cf3 Fix missed-wakeup race in SaveOnDisk::wait_for (#8847)
* test: reproduce missed-wakeup race in SaveOnDisk::wait_for

Adds test_wait_for_no_missed_wakeup plus a #[cfg(test)]-only
test_set_pre_park_sleep_ms hook that injects a sleep inside wait_for
between releasing the read guard on data and parking on the condvar.
This widens the race window from nanoseconds to ~100ms so the writer
thread's notify_all reliably fires *before* the waiter parks, exposing
the bug as a hard failure (notification lost, wait_for hits timeout).

This commit only adds the test and the instrumentation; the bug is
still present, so the new test fails.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix: prevent missed wakeup in SaveOnDisk::wait_for

write and write_optional were calling change_notification.notify_all
without holding notification_lock. A waiter that had released its read
guard on data but had not yet parked on the condvar would miss the
notification and wait the full timeout — even though the condition was
already true.

Acquire notification_lock around notify_all (in a new notify_change
helper). The waiter holds notification_lock across the release-and-park
gap, so notify_change blocks until the waiter has actually parked,
guaranteeing delivery.

This matches the standard parking_lot Condvar pattern where the mutex
that protects the predicate is held while signalling. The new
test_wait_for_no_missed_wakeup test (added in the previous commit) now
passes; manifests in production as the flaky
test_fix_reshard_down_without_shard_key consensus test, where
wait_for_shard_key_activation timed out waiting on a replica state
that had already become Active.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* test: remove missed-wakeup race instrumentation

Removes the #[cfg(test)] test_pre_park_sleep_ms hook and the
test_wait_for_no_missed_wakeup test that depended on it. The
instrumentation existed only to deterministically reproduce the
missed-wakeup race in the unfixed wait_for; with the fix in place
(notify_change holds notification_lock around notify_all) the race is
closed and the hook has no remaining purpose.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 15:29:09 +02:00
xzfc
5eba7da9b3 UniversalReadPipeline (#8798)
* UniversalReadPipeline

* Performance: cache pointers in MmapFile

The previous commit removed `MmapFile::read_batch` method override. So,
`MmapFile` now re-uses the default `UniversalRead::read_batch` impl,
which is implemented using `UniversalReadPipeline` interface.

Unsurprisingly, it caused a slowdown in the benchmarks, particularly
this one:

    cargo bench -p common --bench universal_io -- mmap/8bytes/read_batch_full

This commit reclaims the performance back.

* remove unfulfilled lint

* Review suggestions

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2026-04-29 02:05:30 +00:00
Luis Cossío
658d952103 cfg linux imports (#8829) 2026-04-28 22:00:35 +02:00
Ivan Boldyrev
ca4ed7af69 Immutable storage for mmap numeric index (#8594)
* Immutable storage for mmap numeric index

Do not use a deleted mmap-ed storage, instead, reconstruct a bitmask
from the index and segment-level deleted mask.  It effectively makes
the mmap numeric index immutable, and immutable numeric index too as
it delegates the storage to mmap numeric index.

* Index reload tests

* Make clippy happy

* Restore deletion bitmask to reduce IO on index load

It is more compact than count data we read before to check for cleared
payloads.

* immutable payload index storage 1 bis review (#8638)

* use bitwise operations instead of loop

* [AI] Only propagate bitslice

* fmt

* Fix deleted bitmask length

It must be the same length as `point_to_values` length.

* account for ram usage

* Default missing external deletion bits to live, not deleted.

* clear doc for flush

---------

Co-authored-by: Andrey Vasnetsov <andrey@vasnetsov.com>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2026-04-27 19:29:58 +02:00
Daniel Boros
068fbc1426 feat: add internal shard level storage api (#8778) 2026-04-27 13:28:52 +02:00
Andrey Vasnetsov
d02ef48f24 Dynamic cpu pool (#8790)
* [AI] inptoduce CPU process measurement

* use parking_lot + 4 seconds refresh rate

* [AI] AdaptiveSearchHandle

* fmt

* openapi schema

* keep Runtime field

* fix test

* [AI] instead of async semaphore, use 2 runtimes

* Adjust usage window to 2 seconds

* Address CodeRabbit review comments for dynamic CPU pool

- OpenAPI / telemetry: user-facing cpu_cores_used description (2s window, when null).
- process_cpu_usage: backoff after procfs errors; serialize Linux unit tests on CACHE.
- Docs: decouple runtime thread comments from hardcoded 4× multiplier; name search_runtime in test.
- consensus test: replace stale runtime comment.

Made-with: Cursor

* chore(openapi): regenerate master spec via generate_openapi_models.sh

Replace hand-edited cpu_cores_used description with output from
schema_generator + merge pipeline so openapi_consistency_check passes.

Made-with: Cursor

---------

Co-authored-by: Cursor Agent <agent@cursor.com>
2026-04-27 12:56:29 +02:00
Arnaud Gourlay
354bbb35e6 Delete unused code (#8771)
* Delete unused code

* restore initialize_global

* drop BadShardSelection

* Remove now obsolete allow(dead_code) attributes

* Remove more dead code

---------

Co-authored-by: timvisee <tim@visee.me>
2026-04-24 11:44:21 +02:00
Arnaud Gourlay
2481fd32ed Fix panic in validate_iter when two siblings fail validation (#8762) 2026-04-22 13:58:32 +02:00
Andrey Vasnetsov
1a63fd84d7 4x search threads overcommit (#8769)
* 4x search threads overcommit

* protect from zero
2026-04-22 13:52:53 +02:00
Luis Cossío
96c3bfa160 [UIO] Dynamic mmap flags (#8760) 2026-04-21 22:57:18 -04:00
Luis Cossío
5dc27660e5 [UIO, gridstore] generic Bitmask storage (#8501)
* [AI + manual] generalize BitmaskGaps storage

* [AI + manual] use StoredBitSlice in Bitmask

* use MmapFile as default storage

* rename to read_all

* duplicate import
2026-04-21 10:07:39 -04:00
qdrant-cloud-bot
2f700b8c12 Fix Windows build linter warnings (#8754)
Gate `FsType` enum and impl with `#[cfg(fs_type_check_supported)]` to
suppress dead_code warnings on platforms where the fs type check is not
supported (e.g. Windows).

Move `CollectionError` import into the `#[cfg(unix)]` block where it is
actually used, fixing unused_imports on non-unix.

Add `#[cfg(unix)]` to `OTHER_COLLECTION_NAME` test constant that is
only referenced in unix-gated tests.

Made-with: Cursor

Co-authored-by: Cursor Agent <agent@cursor.com>
2026-04-21 14:02:56 +02:00
dependabot[bot]
f211a63bf6 build(deps): bump io-uring from 0.7.11 to 0.7.12 (#8747)
Bumps [io-uring](https://github.com/tokio-rs/io-uring) from 0.7.11 to 0.7.12.
- [Commits](https://github.com/tokio-rs/io-uring/compare/v0.7.11...v0.7.12)

---
updated-dependencies:
- dependency-name: io-uring
  dependency-version: 0.7.12
  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>
2026-04-21 08:22:04 +02:00
Andrey Vasnetsov
257d73bcce uio mmap posting (#8721)
* [AI] update docstrings

* move support strucutres from mmap_posting.rs

* rename and simplify: MmapPostingValue -> PersistedPostingValue -> ZerocopyPostingValue

* implement `with_view` method for UniversalPostings

* WIP: RawPOstingList + AsPostingListView

* wip: bathcing and pre-collection of posting lists

* wip: batch reading in UniversalPostings

* [AI] implement with_existing_postings

* fmt

* pre-collect in check_compressed_postings_phrase

* batch pre-collect for check_any and check_intersection

* get rid of iter_postings which is collected anyway

* all_postings in UniversalPostings

* missing unique for tokens in phrases

* [AI] replace MmapPostings with UniversalPostings

* mising file

* cfg(test)

* unnecessary Cow

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2026-04-21 00:20:02 +02:00
Andrey Vasnetsov
9686c8f952 low ram strict mode (#8715)
* [AI] strict mode parameter for limiting update requests if ram usage is over threshold

* opanAPI update

* [AI] end-to-end test

* fmt

* Fix e2e test: memory rejection check broken by string truncation

UnexpectedResponse.__str__() truncates the raw response body, cutting
off the `max_resident_memory_percent` hint at the end of the error
message. Use `resident memory usage` instead, which appears early
enough to survive the truncation.

Made-with: Cursor

* add grpc validation

* test check_resident_memory

---------

Co-authored-by: Cursor Agent <agent@cursor.com>
Co-authored-by: Arnaud Gourlay <arnaud.gourlay@gmail.com>
2026-04-20 15:48:39 +02:00
Tim Visée
0a1e455fe6 Bump dev version to 1.17.2-dev (#8730) 2026-04-20 12:24:32 +02:00
Andrey Vasnetsov
f321c9fe37 Low Memory mode (#8714)
* [AI] implement parameter + cover populate + cover quantized vectors

* telemetry OpenAPI schema

* [AI] hook immutable payload indexes

* fmt

* do not populate payload index if we fallback to mmap

* Reformat

* Also suppress universal IO disk cache population

---------

Co-authored-by: timvisee <tim@visee.me>
2026-04-20 11:33:35 +02:00
qdrant-cloud-bot
6e836e8328 Remove delegate macro crate, use plain method forwarding (#8722)
Made-with: Cursor

Co-authored-by: Cursor Agent <agent@cursor.com>
2026-04-19 23:49:21 +02:00
Roman Titov
9ba216b23f Remove AsyncRawScorer (#8685)
* Merge `scorer_mmap` and `vector_search` benchmarks

* Move micro-batching logic from `RawScorerImpl::score_points` into `QueryScorer::score_stored_batch`

* Propagate micro-batching logic from dense scorers...

...into `ImmutableDenseVectors`/`ChunkedVectors`

* Implement io_uring-specialized `ImmutableDenseVectors::for_each_in_batch_async`

* Implement io_uring-specialized `ChunkedVectors::for_each_in_batch_async`

* Add `UniversalRead::type_id` method for runtime storage-type queries

* fixup! Implement io_uring-specialized `ImmutableDenseVectors::for_each_in_batch_async`

Enable io_uring-specialized scoring on Linux

* fixup! Implement io_uring-specialized `ChunkedVectors::for_each_in_batch_async`

Enable io_uring-specialized scoring on Linux

* Refactor `DenseVectorStorageImpl::read_vectors`...

...to use `ImmutableDenseVectors::for_each_in_batch` instead of `read_vectors_async`

* Remove `AsyncRawScorer`

* fixup! Propagate micro-batching logic from dense scorers...

Fix bugs

* fixup! Propagate micro-batching logic from dense scorers...

* fixup! Merge `scorer_mmap` and `vector_search` benchmarks

Fix clippy 🙄

* fixup! Add `UniversalRead::type_id` method for runtime storage-type queries

Change to `UniversalRead::kind` that returns `UniversalKind` enum

* fixup! Implement io_uring-specialized `ImmutableDenseVectors::for_each_in_batch_async`

Use `UniversalRead::kind` instead of `type_id`

* fixup! Implement io_uring-specialized `ChunkedVectors::for_each_in_batch_async`

Use `UniversalRead::kind` instead of `type_id`

* review: rename point_id -> point_offset to match the type [skip-ci]

---------

Co-authored-by: generall <andrey@vasnetsov.com>
2026-04-17 20:18:00 +02:00
Andrey Vasnetsov
956dd0624f simplify uio geo index (#8681)
* rollback: iterator of errors into error of iterator

* [AI] ordering iterator

* [AI + manual] simplify geo-index iterators

* [AI] extra test for consistency

* fmt

* [AI] extend test for deleting points + fix the problem

* Update lib/segment/src/index/field_index/geo_index/mmap_geo_index.rs

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

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
2026-04-17 13:07:20 +02:00
tellet-q
8c1f408d24 Test if io_uring handles EINTR properly (#8578)
* Test if io_uring handles EINTR properly

* Fix unit test compilation after read_iter API change

Update test_io_uring_eintr_handling to match the new read_iter signature
that takes (Meta, ReadRange) tuples and returns Result<impl Iterator>.

Made-with: Cursor

* Install no-op SIGUSR1 handler in debug mode on Unix

Prevents SIGUSR1 from terminating the process with the default
disposition, so that io_uring EINTR tests can safely bombard
the process with signals.

Made-with: Cursor

* Enter tokio runtime context for SIGUSR1 handler, fix clippy

tokio::signal::unix::signal requires a reactor context, so enter
the runtime handle before installing the handler.

Also fix manual_let_else clippy warning in the EINTR unit test.

Made-with: Cursor

* Cleanup 🙄

---------

Co-authored-by: Cursor Agent <agent@cursor.com>
Co-authored-by: Roman Titov <ffuugoo@users.noreply.github.com>
2026-04-17 12:06:23 +02:00
Andrey Vasnetsov
1ad626d983 clearing cache with pageout (#8654)
* use pageout to clear mmap cache

* Also clear cache of deleted flags in mmap dense vector storage

* Add reference to madvise man pages for probe logic

* use deconstruct

---------

Co-authored-by: timvisee <tim@visee.me>
2026-04-14 14:09:19 +02:00
Andrey Vasnetsov
5a899b74de deep memory reporting (#8606)
* Add mincore-based memory stats to MmapFile

Add `resident_bytes()`, `disk_bytes()`, and `probe_memory_stats()` methods
to `MmapFile` for measuring page cache residency via `mincore(2)`. This is
the foundation for per-collection memory usage reporting.

Also extract `page_size()` as a public function in `mmap::advice`, replacing
the internal `PAGE_SIZE_MASK` with a direct page size cache.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [AI] introduce trait for reporting memory usage per component

* [AI] memory reporter implementation for vector storage

* [AI] implement MemoryReporter for QuantizedVectors

* [AI] implement MemoryReporter for VectorIndexEnum

* Implement MemoryReporter for IdTrackerEnum with RAM estimation

Add ram_usage_bytes() to all ID tracker types and their data structures:
- PointMappings, CompressedPointMappings, CompressedVersions,
  CompressedInternalToExternal, CompressedExternalToInternal
- MutableIdTracker, ImmutableIdTracker, InMemoryIdTracker

All ID trackers load their data into RAM (none use mmap for working data).
Files are reported as OnDisk (persistence only), actual RAM footprint
is reported via extra_ram_bytes. Uses struct destructuring to ensure
new fields trigger compile errors if not accounted for.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [AI] implement MemoryReporter for PayloadStorageEnum and adjust FileStorageIntent

* [AI] implement MemoryReporter for PayloadStorageEnum and adjust FileStorageIntent

* [AI] implement MemoryReporter for payload indexes: in-ram structures memory consumtion computation + caching

* [AI] implement MemoryReporter for payload indexes: in-ram structures memory consumtion computation + caching

* [AI] segment-level memory usage report

* [AI] Block 3: Aggregation Layer and Data Model + internal api for remote shard

* [AI] REST API handler

* fmt

* [AI] clippy fixes

* [AI] macos fix + proxy segment fix

* [AI] make text index estimation a bit more correct

* fix is_on_disk reporting for dense_vector_storage

* fix after rebase

* [AI] deep account for quantized vectors RAM usage + unify chunk size + shring volatile storage after load

* remove debug log

* cache in test

* make manual test easier to run

* rollback chunk size diff, but keep it for test only

* review fixes

* Use exhaustive match

* Use div_ceil on bits everywhere

It does not seem to be strictly necessary because the number of bits
should already be a multiple of the used container size bytes. Still
it's good practice to be careful with this calculation.

* Improve heap size bytes for encoded product quantization vectors

* Include vector stats for binary quantized vectors

* In volatile chunked vectors, include heap allocated vector

* Include rest of heap allocated structures for mutable map index

* In mutable geo index, the hash map is also heap allocated

* Update tests/manual/test_memory_reporting.py

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: timvisee <tim@visee.me>
Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-04-14 12:37:31 +02:00
xzfc
aa3af83403 Migrate geo_index to UIO (#8507)
* Add common::iterator_ext::fallible helpers

* refactor: counts_of_hash

* Add ReadRange::one

* UniversalRead::read_iter: return Result

* Add binary_search module

* Migrate geo_index to UIO

* minor review fixes

* Review fixups

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>

---------

Co-authored-by: generall <andrey@vasnetsov.com>
Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
2026-04-14 08:38:21 +00:00
Ivan Daschinskiy
38f9b1e093 Fix read from cold storage with O_DIRECT on linux by using aligned buffer (#8631)
* Fix read from cold storage with O_DIRECT on linux by using aligned buffer

* Review fixes

* Review fixes: 2
2026-04-10 16:14:32 -04:00
Andrey Vasnetsov
acfb6503b1 crud named vectors (#8605)
* Add empty placeholder vector storage types for named vector CRUD

Introduce EmptyDenseVectorStorage and EmptySparseVectorStorage as
placeholder storages for newly created named vectors on immutable
segments. These report all vectors as deleted, consume no disk space,
and are reconstructed from segment config on load via the new
VectorStorageType::Empty and SparseVectorStorageType::Empty variants.

Key design decisions:
- is_on_disk is derived from original user config, not hardcoded
- MultiVectorConfig is preserved for multi-vector support
- Config mismatch optimizer skips Empty storage to avoid false rebuilds
- Quantization delegates normally (handles 0 vectors gracefully)
- get_vector includes debug_assert to catch unexpected access

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* [AI] segment-level operations for creating and deleting anmed vectors

* [AI] implement named vector creation and deleting in proxy segment

* [AI] Step 3: Proxy Segment Handling for Named Vector Operations

* [AI] implement for Edge

* [AI] implement consensus operations for named vector operations

* [AI] refactor VectorNameConfig, remove VectorNameConfigInternal

* [AI] handle vector schema inconsistency in raft snapshot recovery

* [AI] rest + grpc API

* [AI] clippy

* [AI] generate openAPI schema

* fmt

* ci fixes

* [AI] fix jwt access test

* [AI] nop operation for awaiting of consensus-commited update ops

* [AI] move vector name operations into points service

* [AI] implement internal api for vector name operations

* [AI] change collection-level config along with segment level operation

* [AI] vector schema reconceliation instead of error

* fmt

* missing compile-time option

* [AI] integration test

* [AI] fix missing JWT tests

* [AI] remove NOP

* [AI] openapi test

* [AI] fix initialization of mutable segment

* [AI] more simple integration tests

* fmt

* [AI] make cluster test a bit harder

* [AI] make test less flacky

* [AI] rabbit comments

* [AI] check params compatibility before writing vector config

* [AI] make sure to register vector storages in structure payload index

* [AI] vector name validation

* lower vector length validation to 200 chars to account for prefix in filename

* [AI] proxy segment: prevent stale data leak through optimization

* fmt

* [AI] filter out removed vectors from proxy response

* [AI] handle vector name in proxy

* fmt

* adjust proxy info based on dropped vectors

* [AI] proxy segment: update filters to correct has_vector condition

* fmt

* clippy

* Fix consensus snapshot applicaiton for vector schema

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-10 14:45:18 +02:00
Leo Henon
2c07e82f34 Fix flaky test_wait_for_condition_change (#8643)
Co-authored-by: leohenon <77656081+lhenon999@users.noreply.github.com>
2026-04-10 11:05:48 +02:00
Leo Henon
f5625fd85e Return error instead of panicking for corrupted aliases file on startup (#8293)
* Return error instead of panicking for corrupted aliases file on startup

* common::fs::ops: provide file name in error messages

And drop FileStorageError in favor of std::io::Error, since we always
convert all kinds of errors into ServiceError anyway.

* TableOfContent:🆕 return errors instead of panics

Also, drop context strings. We use fs_err anyway, that should be enough.

---------

Co-authored-by: leohenon <77656081+lhenon999@users.noreply.github.com>
Co-authored-by: xzfc <xzfcpw@gmail.com>
2026-04-10 10:45:17 +02:00
Tim Visée
74e51f7339 Claude: simplify codebase (#8627)
* [ai] Replace manual into mappings with Into::into

* Reformat

* [ai] Use implicit .iter

* Don't iterate over keys too

* [ai] Replace unwrap_or

* Reformat

* [ai] Use as_deref and then_some

* [ai] Use more to_string

* [ai] Use explicitly typed into conversions

* Reformat

* [ai] More explicit into conversions

* Reformat
2026-04-09 10:02:45 +02:00
Luis Cossío
b1e9c9a9df [UIO] migrate SliceBufferedUpdateWrapper (#8518)
* migrate SliceBufferedUpdateWrapper

* fix compressed versions creation

* @xzfc's review improvements

Co-authored-by: xzfc <5121426+xzfc@users.noreply.github.com>

* fix rebase

* Drop usage of `TypedStorage`

---------

Co-authored-by: xzfc <5121426+xzfc@users.noreply.github.com>
Co-authored-by: xzfc <xzfcpw@gmail.com>
2026-04-08 13:09:55 -04:00
Luis Cossío
b1d13b9c09 Misc clippy fixes (#8624) 2026-04-07 19:58:22 -04:00
xzfc
2d9d953a45 UniversalIO: generic RequestId (#8601)
* IoUringState: generic `RequestId`

* UniversalRead: generic `RequestId`

* Simplify `gridstore::Pages::get_page_value_ranges`

Now we don't need two separate `SmallVec`s as we can put `buffer_offset`
into `RequestId`.

* Better doc comment

* Rename `RequestId` -> `Meta`
2026-04-07 17:10:40 +00:00
xzfc
8e07ccb7c3 IoUringState: replace HashMap with flat slice (#8599) 2026-04-07 12:31:55 +00:00