smengcl opened a new pull request, #11747:
URL: https://github.com/apache/ozone/pull/11747
Generated-by: Claude Code (Opus 5.5)
## What changes were proposed in this pull request?
SCM 1.3.0 to 2.0.x write SCM Ratis log entries for
`DeletedBlockLogStateManager.increaseRetryCountOfTransactionInDB` and
`resetRetryCountOfTransactionInDB`. 2.1.0 stopped writing them (HDDS-13520) but
kept both methods so it can still apply old entries. HDDS-14916 later turned
them into `default` no-op methods of the interface, and the generated
`DeletedBlockLogStateManagerInvoker.invokeLocal` has no case for default
methods. Applying such an entry throws `IllegalArgumentException("Method not
found: ...")`, which is not an `SCMException`, so
`SCMStateMachine.applyTransaction` terminates the SCM. The entry stays
unapplied, so the SCM terminates again on every restart.
This can hit an SCM on 2.2.x or master that did not apply such an entry
before the upgrade, for example one that was behind its ring on 1.3.x to 2.0.x,
or one stopped uncleanly before a flush or snapshot covered the entry.
Same approach as HDDS-16169:
- Both methods are abstract again in `DeletedBlockLogStateManager` (still
`@Deprecated` and `@Replicate`), with no-op implementations in
`DeletedBlockLogStateManagerImpl`, and `DeletedBlockLogStateManagerInvoker` is
regenerated.
- `resetRetryCountOfTransactionInDB` now returns `void`. With the old `int`
return type, applying the entry still fails (`Failed to resolve int`), because
`SCMRatisResponse.encode` cannot encode a primitive. The return value has no
caller.
- `TestScmInvokerCodeGenerator` now checks, for every SCM handler interface,
that each `@Replicate` method has a case in `invokeLocal` and does not return a
primitive.
No Raft log or proto change.
## What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-17447
## How was this patch tested?
- `TestScmInvokerCodeGenerator` fails for `DeletedBlockLogStateManager`
without the fix and passes with it.
- The reproduction test attached to the JIRA (one real SCM, appends a legacy
entry of each kind byte for byte as SCM 2.0.0 writes it, then restarts) shows
the SCM terminating on unmodified master, and both entries applied with this
patch.
- `TestDeletedBlockLog`, `TestSCMStateMachine`,
`TestSCMHATransactionBufferMonitorTask` and
`TestScmCodecFactoryReplicateCoverage` pass.
🤖 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]