smengcl opened a new pull request, #12155:
URL: https://github.com/apache/ozone/pull/12155

   Generated-by: Claude Code (Opus 5.5)
   
   ## What changes were proposed in this pull request?
   
   When a write to the Raft log fails (for example a segment roll on a volume 
that turned read only), Ratis calls `StateMachine.notifyLogFailed` and fails 
every later write to that log until the process restarts. `SCMStateMachine` 
terminates SCM in this case, but `OzoneManagerStateMachine` does not override 
the callback, so the OM keeps running: it can neither lead nor catch up as a 
follower, and since it never exits, a process supervisor does not restart it. 
The ring silently runs with one replica fewer, even after the disk is writable 
again.
   
   This PR overrides `notifyLogFailed` in `OzoneManagerStateMachine` to call 
`ExitUtils.terminate(1, ...)` with the failed entry (or the segment) and the 
cause, the same way SCM does and the way OM already handles fatal apply errors. 
A restart recovers the OM from its intact log on disk. OM log entries carry no 
state machine data, so the other caller of this callback (reading state machine 
data) does not apply to OM.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17578
   
   ## How was this patch tested?
   
   Added `testNotifyLogFailedTerminates` to the existing 
`TestOzoneManagerStateMachine`: it checks exit status 1 with the given cause 
for a failed segment, and exit status 1 naming the term and index for a failed 
entry. The test fails without the change.
   
   The JIRA has a mini cluster reproduction attached (three OMs, a follower's 
Raft log directory made read only across a segment roll). Without the fix the 
failed OM stays up and behind the leader; with the fix it requests exit status 
1 as soon as the segment roll fails. It is not included here since it asserts 
the buggy outcome.
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to