Skip to content

[fix](compaction) Back off repeated compaction failures - #69920

Open
YenchangChan wants to merge 2 commits into
apache:masterfrom
YenchangChan:compaction-failure-backoff
Open

YenchangChan wants to merge 2 commits into
apache:masterfrom
YenchangChan:compaction-failure-backoff

Conversation

@YenchangChan

Copy link
Copy Markdown

What problem does this PR solve?

Issue Number: close #66299

Related PR: None

Problem Summary:

When a tablet repeatedly fails compaction, the current scheduler retries it after the fixed tablet_sched_delay_time_ms delay. A permanently failing tablet can therefore be selected every few seconds and continuously consume compaction threads and storage I/O without making progress.

This implementation follows the analysis and proposed direction in #66299. Thanks to @furquan39 for the detailed investigation and production evidence.

This PR:

  • tracks consecutive failures independently for cumulative and base compaction;
  • applies exponential backoff starting from tablet_sched_delay_time_ms;
  • caps the delay at compaction_failure_backoff_max_second, which defaults to 300 seconds;
  • resets the failure count after a successful compaction;
  • avoids counting the same failure more than once;
  • exposes the consecutive failure counts in the tablet compaction status.

With the default configuration, retry delays increase as follows:

5s -> 10s -> 20s -> 40s -> ... -> 300s

The existing behavior for tablets without compaction failures remains unchanged.

This PR focuses on bounded retry backoff. It does not introduce a quarantine state or new metrics, which can be discussed separately based on operational needs and feedback.

Release note

Add capped exponential backoff for tablets with consecutive compaction failures.

Check List (For Author)

  • Test

    • Regression test
    • Unit Test
      • TestTablet.compaction_failure_backoff
    • Manual test
      • Injected persistent compaction failures and observed the retry delay increase from 5 seconds to the configured 300-second cap.
    • No need to test or manual test.
  • Behavior changed:

    • No.
    • Yes. Tablets with consecutive compaction failures are retried with capped exponential backoff.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

### What problem does this PR solve?

Issue Number: None

Related PR: None

Problem Summary: Link libsframe when available because binutils 2.40 moves SFrame symbols out of libbfd.

### Release note

None

### Check List (For Author)

- Test: No need to test (CMake feature detection only)
- Behavior changed: No
- Does this need documentation: No
### What problem does this PR solve?

Issue Number: close apache#66299

Related PR: None

Problem Summary: Add capped exponential backoff for consecutive base and cumulative compaction failures, and reset the failure count after a successful compaction.

### Release note

Add capped exponential backoff for repeatedly failing compaction tasks.

### Check List (For Author)

- Test: Unit Test (TestTablet.compaction_failure_backoff)
- Behavior changed: Yes (delay retries after consecutive compaction failures)
- Does this need documentation: No
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

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.

[Enhancement] Compaction scheduler retries permanently-failing tablets every 5s at full I/O cost with no backoff or failure counter

2 participants