Skip to content

Commit 9b88bd5

Browse files
v0y4g3revenyag
authored andcommitted
fix: avoid suppress manual compaction (#5399)
* fix/avoid-suppress-manual-compaction: **Refactor Compaction Logic** - Removed `PendingCompaction` struct and integrated its functionality directly into `CompactionStatus` in `compaction.rs`. - Simplified waiter management by consolidating waiter handling logic into `CompactionStatus`. - Updated `CompactionRequest` creation to directly handle waiters without intermediate structures. - Adjusted test cases in `compaction.rs` to align with the new waiter management approach. (cherry picked from commit 87e2d1c) * fix/avoid-suppress-manual-compaction: ### Add Support for Manual Compaction Requests - **Compaction Logic Enhancements**: - Updated `CompactionScheduler` in `compaction.rs` to handle manual compaction requests using `Options::StrictWindow`. - Introduced `PendingCompaction` struct to manage pending manual compaction requests. - Added logic to reschedule manual compaction requests once the current compaction task is completed. - **Testing**: - Added `test_manual_compaction_when_compaction_in_progress` to verify the handling of manual compaction requests during ongoing compaction processes. These changes enhance the compaction scheduling mechanism by allowing manual compaction requests to be queued and processed efficiently. (cherry picked from commit bc38ed0) * chore: fix conflicts * fix/avoid-suppress-manual-compaction: ### Add Error Handling for Manual Compaction Override - **`compaction.rs`**: Enhanced the `set_pending_request` method to handle manual compaction overrides by sending an error to the waiter if a previous request exists. - **`error.rs`**: Introduced a new error variant `ManualCompactionOverride` to represent manual compaction being overridden, and mapped it to the `Cancelled` status code. * fix: format * fix/avoid-suppress-manual-compaction: **Add Error Handling for Pending Compaction Requests** - Enhanced error handling in `compaction.rs` by adding logic to handle errors for pending compaction requests. - Introduced a mechanism to send errors using `waiter.send` when a pending compaction request fails, ensuring proper error propagation and context with `CompactRegionSnafu`. * fix/avoid-suppress-manual-compaction: **Fix Typo and Simplify Code Logic in `compaction.rs`** - Corrected a typo in the license comment from "langucage" to "language". - Simplified the logic for handling `pending_compaction` in `CompactionStatus` by removing unnecessary pattern matching and directly accessing `waiter`. * fix: typo
1 parent 4a338a9 commit 9b88bd5

File tree

2 files changed

+234
-67
lines changed

2 files changed

+234
-67
lines changed

0 commit comments

Comments
 (0)