Repository navigation
fix(#8898): keep Ratis's JVM-pause close out of reach and log in-place restarts loudly - #8902
Conversation
…e restarts loudly Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
ReviewSmall, focused change, and the PR description is honest about what it does and does not fix. Imports ( What looks good
Suggestions (non-blocking)
Conventions: tests use the Overall: LGTM once the minor description cleanup is considered. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
🟢 Coverage 50.00% diff coverage
Metric Results Coverage variation Report missing for a4a69bb1 Diff coverage ✅ 50.00% diff coverage Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (a4a69bb) Report Missing Report Missing Report Missing Head commit (3dfa7e3) 239272 188459 78.76% Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#8902) 12 6 50.00% Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%1 Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 🧰 Additional context used📚 Code guidelines (1)No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe change adds a configurable JVM-pause close threshold for Ratis and updates lifecycle checks and logs during Ratis restart. ChangesHA pause recovery
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to No actionable merge-blocking issue is identified. The threshold behavior is covered by the reported tests, and the restart changes improve reporting. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change is narrowly scoped to pause recovery and preserves the existing replacement sequence. No new privilege expansion or attack path was established. Independent leader fencing during long pauses remains partially verified, and restoring the previous policy is only established when a new server instance is constructed. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Linked Issues checkExplanation Issue Resolution Implement the remaining
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…egative branch Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ReviewSmall, focused change. Overall LGTM, with a few non-blocking notes. What I checked
Notes / suggestions
No security or performance concerns. Nothing here blocks merge; item 1 is the one I would most like to see addressed (here or in #8900). |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ReviewSmall, focused change. Imports are present, both `build()` call sites (startup and `restartRatis`) go through the same builder, and the leader step-down path (separate threshold) is untouched. The tests cover default, zero/negative and custom values, and follow the `assertThat` style. No dependencies, no `System.out`. No blocking issues. Suggestions (non-blocking)
LGTM once point 1 (docs/release note) is considered. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ReviewSmall, focused change, and the tests are honest about what they cover. No blockers. Notes below. What looks good
Points to consider
Performance and security: none affected. This is a config-time change with no hot-path code. Overall: LGTM once the docs and release-note point (1) and the health-monitor confirmation (2) are addressed or explicitly deferred. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8902 +/- ##
============================================
- Coverage 76.41% 76.41% -0.01%
- Complexity 3810 3812 +2
============================================
Files 2106 2106
Lines 206663 206672 +9
Branches 43569 43572 +3
============================================
+ Hits 157930 157931 +1
- Misses 31729 31745 +16
+ Partials 17004 16996 -8 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Closes #8898
Summary
A follower paused for more than 60s had its Raft division closed by Ratis's own JVM-pause monitor (
raft.server.close.threshold). ArcadeDB then restarted Ratis in place, but the follower never took another append, and the health monitor ended up reformatting its storage. This PR removes that trigger. The newarcadedb.ha.jvmPauseCloseThresholdMsdefaults to0, which keeps the Ratis close out of reach, so long-pause recovery stays with ArcadeDB's own monitors. A leader still steps down on a long pause, because that uses a separate threshold. A positive value restores the stock Ratis close.restartRatisalso stops hiding failures. An error closing the old server is logged at WARNING instead of FINE. A successful restart is logged at INFO instead of HALog BASIC. A new WARNING fires when the old server is not CLOSED afterclose().What this does not fix: why an in-place restart can leave the leader appending to a CLOSED division is still unproven. That is tracked in #8900 together with the regression IT. The needless stale-term reformat is tracked in #8901.
Test plan
RaftPropertiesBuilderTest:jvmPauseCloseThresholdIsOutOfReachByDefault,jvmPauseCloseThresholdCanBeRestoredToACustomValue(fail on main by construction, since Ratis's stock value is 60s)RaftPropertiesBuilderTest+HealthMonitorTest: 56/56 passRaftHealthMonitorRecoveryIT,Issue4839RecoveryRewiresStateMachineITpass (both log the new INFO restart line)Coverage
Invariant: the Ratis JVM-pause monitor cannot close the division unless the operator opts in.
grep -rn "RaftPropertiesBuilder.build(" ha-raft/src/main e2e-ha/src:RaftPropertiesBuilder.buildRaftPropertiesBuilderTestrestartRatisRaftPropertiesBuilder.buildKnown gaps
restartRatisdoes not verify the gRPC shutdown, the leader does not rebuild the follower's appender onServerNotReadyException,getRaftLifeCycleState()reports RUNNING, and the regression IT is missing.Adversarial pass
close()does nothing. Real: the comment now says so, and the gap is filed as HA: in-place Ratis restart can leave the leader appending to a CLOSED division (restart verification, leader-side appender rebuild, regression IT) #8900.Review cycles
JVM_PAUSE_CLOSE_DISABLEDconstant, tests assert against itDeferred items
HealthMonitorTestcase) showing that a node paused >60s with the close disabled actually rejoins and catches up" / "confirm in HA: in-place Ratis restart can leave the leader appending to a CLOSED division (restart verification, leader-side appender rebuild, regression IT) #8900 that the health monitor does detect a follower that is alive but stuck after a long pause": deferred to HA: in-place Ratis restart can leave the leader appending to a CLOSED division (restart verification, leader-side appender rebuild, regression IT) #8900, with a comment there.RaftServer" for the new WARNING: skipped. The project avoids mocks, and the restart path's IT is HA: in-place Ratis restart can leave the leader appending to a CLOSED division (restart verification, leader-side appender rebuild, regression IT) #8900.ha-raft(e.g.HealthMonitor,RaftHAServer).Final state
max-cycles-reached(4/4, every cycle LGTM with only non-blocking suggestions)🤖 Generated with Claude Code
Summary by CodeRabbit
0disables pause-triggered closure; positive values set the threshold in milliseconds.