Skip to content

Improve segment ordering in segment holder#7436

Closed
timvisee wants to merge 6 commits intodevfrom
segment-holder-improved-ordering
Closed

Improve segment ordering in segment holder#7436
timvisee wants to merge 6 commits intodevfrom
segment-holder-improved-ordering

Conversation

@timvisee
Copy link
Member

@timvisee timvisee commented Oct 21, 2025

Improves #7381, as per #7381 (comment)

Rework the segment holder and use a single list of segments. The segments are sorted by flush ordering, then by segment ID. Ordering is guaranteed to be maintained.

This unifies ordering of segments across our code base, and removes some sorts that now became unnecessary.

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?

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Comment on lines -65 to -66
// Re-sort segments for flush ordering also considering proxies, required to guarantee data consistency
segment_reads.sort_by_cached_key(|segment| segment.flush_ordering());
Copy link
Member Author

@timvisee timvisee Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, this is now removed because the segment holder itself already provides all segments in the desired order.

I've kept a debug assertion to prove the behavior remains the same.

@timvisee timvisee mentioned this pull request Oct 21, 2025
6 tasks
@timvisee timvisee force-pushed the segment-holder-improved-ordering branch from 45acc77 to 3cda23e Compare October 22, 2025 14:17
@timvisee
Copy link
Member Author

Superseded by #7850

@timvisee timvisee closed this Jan 29, 2026
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.

1 participant