Skip to content

[ISSUE #10462] Add memory backpressure to dispatch#10470

Open
lizhimins wants to merge 1 commit into
apache:developfrom
lizhimins:feature/10462-backpressure
Open

[ISSUE #10462] Add memory backpressure to dispatch#10470
lizhimins wants to merge 1 commit into
apache:developfrom
lizhimins:feature/10462-backpressure

Conversation

@lizhimins

Copy link
Copy Markdown
Member

What is the purpose of the change

Part of #10462

Add memory backpressure mechanism to the tiered storage dispatcher. When available heap memory falls below the configured threshold, dispatch is skipped to prevent OOM.

Brief changelog

  • Add tieredStoreDispatchMinFreeMemoryRatio (default 0.1) and tieredStoreDispatchMinFreeMemoryMaxBytes (default 1GB) config
  • Add isMemoryEnough() check before dispatch
  • Remove Dispatcher semaphore, rely on thread pool natural throttling
  • Rename dispatchWithSemaphore to dispatch

Verifying this change

  • mvn compile succeeds
  • mvn test -pl tieredstore passes (112 tests, 0 failures)

🤖 Generated with Claude Code

… cap 1GB)

- Add tieredStoreDispatchMinFreeMemoryRatio (default 0.1) and
  tieredStoreDispatchMinFreeMemoryMaxBytes (default 1GB) config
- Add isMemoryEnough() check before dispatch to prevent OOM
- Remove Dispatcher semaphore, rely on thread pool natural throttling
- Rename dispatchWithSemaphore to dispatch

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 69.56522% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 47.99%. Comparing base (a6fb9e2) to head (c2fb6d1).
⚠️ Report is 10 commits behind head on develop.

Files with missing lines Patch % Lines
...q/tieredstore/core/MessageStoreDispatcherImpl.java 53.33% 5 Missing and 2 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             develop   #10470      +/-   ##
=============================================
- Coverage      48.03%   47.99%   -0.05%     
- Complexity     13286    13295       +9     
=============================================
  Files           1376     1377       +1     
  Lines         100558   100645      +87     
  Branches       12985    12996      +11     
=============================================
- Hits           48305    48302       -3     
- Misses         46333    46397      +64     
- Partials        5920     5946      +26     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@oss-sentinel-ai oss-sentinel-ai left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review: Approved ✅

PR: #10470 — Add memory backpressure to dispatch
Type: Enhancement (3 files, +51/-15)

Assessment

Adds memory backpressure mechanism to prevent OOM:

  • Configurable min free memory ratio (default 0.1)
  • Max bytes cap (default 1GB)
  • isMemoryEnough() check before dispatch
  • Removes Dispatcher semaphore, relies on thread pool throttling

Verdict

✅ Critical stability improvement for tiered storage. Part of #10462.


🤖 Automated review by oss-sentinel-ai

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