HDDS-16275. OM checkpoint pause() stops flush thread but not apply executor. - #11190
Draft
sadanand48 wants to merge 2 commits into
Draft
HDDS-16275. OM checkpoint pause() stops flush thread but not apply executor.#11190sadanand48 wants to merge 2 commits into
sadanand48 wants to merge 2 commits into
Conversation
…ecutor, risking divergence on install failure paths.
jojochuang
requested review from
jojochuang and
smengcl
and
a lite review from Copilot
September 3, 2026 15:14
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
applyTransaction() can still leak in-flight counters (and unflushed permits) if supplyAsync rejects scheduling, which can deadlock pause(), and the described executor-rejection regression coverage is currently missing.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates OzoneManagerStateMachine checkpoint pause()/unpause() behavior to quiesce the apply path (not just the double-buffer flush thread), aiming to ensure checkpoint installation doesn’t race with in-flight apply work and to avoid pause hangs.
Changes:
- Added apply-transaction quiescing via a monitor/flag plus in-flight tracking around
applyTransaction(). - Updated
pause()to wait for apply drain and double-buffer flush before stopping the double-buffer thread; updatedunpause()to resume apply in afinallyblock. - Added a unit test asserting
applyTransaction()blocks while paused and resumes afterunpause().
File summaries
| File | Description |
|---|---|
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerStateMachine.java |
Introduces apply-path pause/resume and in-flight draining integrated into pause()/unpause() and applyTransaction(). |
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerStateMachine.java |
Adds a regression test for pause/unpause blocking behavior of applyTransaction(). |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+500
to
+504
| return CompletableFuture.supplyAsync(() -> { | ||
| try { | ||
| return runCommand(request, termIndex); | ||
| } finally { | ||
| exitApplyTransaction(); |
Comment on lines
+376
to
+378
| } | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
-pause() now blocks new apply entries and waits for in-flight apply work to drain.
-if async scheduling fails (for example RejectedExecutionException), in-flight counters are released correctly to avoid pause hangs.
-Added test coverage in TestOzoneManagerStateMachine:
-verify apply is blocked while paused and resumes after unpause.
-verify executor rejection does not leave pause blocked.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16275
How was this patch tested?
Unit test