HDDS-16218. Fix SCM HA log messages that drop values and stack traces - #11046
Open
rjgoyln wants to merge 1 commit into
Open
HDDS-16218. Fix SCM HA log messages that drop values and stack traces#11046rjgoyln wants to merge 1 commit into
rjgoyln wants to merge 1 commit into
Conversation
SLF4J only promotes the last argument to a throwable, so the checkpoint install failure logged the exception in the slot meant for the transaction index and dropped the index itself. The revert path of the same method never recorded the index of the state SCM fell back to before terminating, and addSCM/removeSCM folded the SCM id into the format string, leaving the Ratis reply where the id belongs. These paths only run when something has already gone wrong, which is exactly when an operator needs the values.
rjgoyln
marked this pull request as ready for review
August 18, 2026 15:14
Author
Thank for the review! |
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?
Four log statements in the SCM HA code print something other than what they promise, and all of them are on failure paths. The checkpoint-install failure line advertises the checkpoint transaction index but shows the exception's text in its place, because SLF4J only treats the final argument as a throwable — so the index is dropped and that line carries no stack trace of its own. The revert path a few lines later never prints an index either: its message has one placeholder for two values, so the state SCM fell back to goes unrecorded before the process terminates. In
addSCMandremoveSCMthe SCM id is concatenated onto the format string instead of being passed as an argument, which leaves the Ratis reply in the slot meant for the id:These paths run only once something has already gone wrong, which is when an operator needs the values they omit. Behaviour is unchanged; only the rendered messages differ.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-16218
How was this patch tested?
mvn -pl :hdds-server-scm test -Dtest=TestSCMHAManagerImplpasses (3 tests; the class exercises theaddSCM/removeSCMpaths), andcheckstyle:checkon the module reports no violations. The rendering was verified against slf4j-reload4j 2.0.18, the binding Ozone ships: with the exception ahead of the index,MessageFormatterextracts no throwable, the index appears nowhere and no trace is logged; with the order corrected, the index renders and the trace is attached. No test asserts any of these strings, so none is added for text-only changes.Generated-by: Claude Code (Claude Opus 5)