Skip to content

Mutable ID tracker: implement storage for point versions#6169

Merged
timvisee merged 7 commits intodevfrom
mutable-id-tracker-version-storage
Mar 18, 2025
Merged

Mutable ID tracker: implement storage for point versions#6169
timvisee merged 7 commits intodevfrom
mutable-id-tracker-version-storage

Conversation

@timvisee
Copy link
Member

@timvisee timvisee commented Mar 14, 2025

Tracked in: #6157
Depends on: #6166

Implement the new storage for point versions.

This changes the mapping of versions from external ID to version to internal ID to version.

Points are kept in memory for fast access. On load we read the full list of versions. On flush we store we write all changed versions directly to the versions file.

Writing changes is optimized to properly buffer all writes. This has a great effect if writing a big batch of versions, to use a lot less intermediate syscalls.

In terms of the file format, the file on disk is just a contiguous list of version numbers similar to an array.

Tasks

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  1. Does your submission pass tests?
  2. Have you formatted your code locally using cargo +nightly fmt --all command prior to submission?
  3. Have you checked your code using cargo clippy --all --all-features command?

@timvisee timvisee changed the title Persist version changes as internal to version mapping, not external Immutable ID tracker: change version mapping from external/version to internal/version Mar 14, 2025
@timvisee timvisee changed the title Immutable ID tracker: change version mapping from external/version to internal/version Mutable ID tracker: change version mapping from external/version to internal/version Mar 14, 2025
@timvisee timvisee marked this pull request as ready for review March 14, 2025 12:38
@timvisee timvisee requested a review from generall March 14, 2025 12:39
@timvisee timvisee changed the title Mutable ID tracker: change version mapping from external/version to internal/version Mutable ID tracker: implement storage for point versions Mar 14, 2025
@timvisee timvisee requested review from agourlay, coszio and ffuugoo March 14, 2025 17:31
@timvisee timvisee force-pushed the mutable-id-tracker-version-storage branch from eae265e to 05172b4 Compare March 17, 2025 10:08
Base automatically changed from mutable-id-tracker-byte-storage to dev March 17, 2025 13:26
@timvisee timvisee force-pushed the mutable-id-tracker-version-storage branch from 05172b4 to 1c38a5d Compare March 17, 2025 13:28
@coderabbitai

This comment was marked as resolved.

@timvisee timvisee force-pushed the mutable-id-tracker-version-storage branch from 6eab330 to 836eb76 Compare March 18, 2025 09:48
@timvisee timvisee merged commit c2f1403 into dev Mar 18, 2025
34 checks passed
@timvisee timvisee deleted the mutable-id-tracker-version-storage branch March 18, 2025 10:18
timvisee added a commit that referenced this pull request Mar 21, 2025
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants