Uh oh!
There was an error while loading. Please reload this page.
HDDS-9462. DeleteBlocksCommandHandler should not print TXID at info level - #5481
Conversation
adoroszlai
commented
Oct 24, 2023
Thanks @shivaom02 for the patch. Please enable the |
shivaom02
commented
Oct 25, 2023
Thanks @adoroszlai , I've enabled all workflows from my fork. |
| DeletedContainerBlocksSummary summary = | ||
| DeletedContainerBlocksSummary.getFrom(containerBlocks); | ||
| LOG.info("Start to delete container blocks, TXIDs={}, " | ||
| if (LOG.isDebugEnabled()) { |
There was a problem hiding this comment.
Can we remove the if (LOG.isDebugEnabled()) and just change the log message to debug level, ie:
LOG.debug("Start to delete container blocks, TXIDs={}",
summary.getTxIDSummary());
Inside the logger, it applies the if (LOG.isDebugEnabled()) so if we just use a debug level log, then we can remove the extra if statement.
There was a problem hiding this comment.
Unfortunately we're better off using if (LOG.isDebugEnabled()) in this case. getTxIDSummary() performs quite a bit of stream/string processing, which we would like to avoid if the log is going to be discarded.
adoroszlai
commented
Oct 25, 2023
Great. Note: if you push multiple commits for the same branch in your fork, you might want to cancel runs for obsolete commits you no longer care about. |
shivaom02
commented
Oct 26, 2023
Okay, Thanks @adoroszlai |
shivaom02
commented
Oct 26, 2023
Thanks for the review @sodonnel. The CI checks have passed. |
adoroszlai
left a comment
There was a problem hiding this comment.
Thanks @shivaom02 for updating the patch.
In addition to restoring isDebugEnabled(), I would also consider moving the detailed debug message after the info-level summary one.
Uh oh!
There was an error while loading. Please reload this page.
shivaom02
commented
Oct 26, 2023
I've made the changes, please approve the workflows @adoroszlai |
shivaom02
commented
Oct 26, 2023
@adoroszlai, I had an indentation error, I've fixed it. Please approve the workflow. |
sodonnel
commented
Oct 26, 2023
Ah of course. I missed the expense of creating the passed parameter to the debug message. |
adoroszlai
commented
Oct 26, 2023
Thanks @shivaom02 for the patch, @sodonnel for the review. |
shivaom02
commented
Oct 27, 2023
Thank you so much @adoroszlai . |
…ID at info level (apache#5481) (apache#183) (cherry picked from commit 6bf3886) Co-authored-by: Shivam Kumar <67912385+shivaom02@users.noreply.github.com>
What changes were proposed in this pull request?
DeleteBlocksCommandHandler should not print TXID at info level.
Basically, the DeleteBlocksCommandHandler was logging all the delete block transaction IDs at info level, and thus flooding the datanode log.
Now, the transaction IDs are logged only if the Debug node is enabled, otherwise only the number of transactions are logged at info level.
This is done so that user is not overwhelmed with unimportant information, rather have cleaner and more relevant information.
What is the link to the Apache JIRA
HDDS-9462
How was this patch tested?
As it is only a logging change, no new test cases were added. But the existing tests for this module were run successfully.