Skip to content

refactor(compaction): eliminate CompactionError::CollectKeyspaceError variant #12517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

problame
Copy link
Contributor

@problame problame commented Jul 8, 2025

The only differentiated handling of it is for is_critical, which in
turn is a matches!() on several variants of the enum CollectKeyspaceError
which is the value contained insided
CompactionError::CollectKeyspaceError.

This PR introduces a new error for repartition(), allowing its immediate
callers to inspect it like is_critical did.

A drive-by fix is more precise classification of WaitLsnError::BadState
when mapping to tonic::Status.

refs

problame added 2 commits July 8, 2025 18:03
…r` variant

The only differentiated handling of it is for `is_critical`, which in
turn is a `matches!()` on several variants of the `enum CollectKeyspaceError`
which is the value contained insided
`CompactionError::CollectKeyspaceError`.

This PR pushes `is_critical` down into `repartition()` and inlines it,
which follows the pattern we observe for most other usages of `critical_timline!`
which in turn enables us upstack to be undifferentiated about the
`CompactionError::CollectKeyspaceError` variant and remove it.

A drive-by fix is more precise classification of WaitLsnError::BadState
when mapping to `tonic::Status`.
@problame problame requested a review from skyzh July 8, 2025 18:08
@problame problame requested a review from a team as a code owner July 8, 2025 18:08
Copy link

github-actions bot commented Jul 8, 2025

8635 tests run: 8008 passed, 0 failed, 627 skipped (full report)


Flaky tests (2)

Postgres 14

Code coverage* (full report)

  • functions: 35.5% (8659 of 24388 functions)
  • lines: 46.7% (69571 of 149050 lines)

* collected from Rust tests only


The comment gets automatically updated with the latest test results
157166b at 2025-07-08T19:09:56.546Z :recycle:

@problame problame added this pull request to the merge queue Jul 9, 2025
Merged via the queue into main with commit aac1f8e Jul 9, 2025
103 checks passed
@problame problame deleted the problame/refactor-compaction-error-eliminate-collect-keyspace-variant branch July 9, 2025 08:53
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.

2 participants