-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HDDS-8175. getFileChecksum() throws exception in debug mode. #7611
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @chiacyu for the patch.
It can tested by CI.
I don't think it is tested by CI, since it is passing without the fix. Referring to CI is enough for refactoring, when no functional change is expected. For functional changes (like fixing an error) we need to reproduce the problem and verify the fix with the same steps. Of course CI is also useful in this case, as it may catch regressions in other areas.
Please try to reproduce the exception with log level for BaseFileChecksumHelper
set to DEBUG
. I think you can use ozone sh key checksum
for checksum calculation. Then verify that the exception no longer happens with the fix.
It seems to me ECFileChecksumHelper
may need the same fix. Please test with both RATIS and EC keys.
Also, the two implementations of populateBlockChecksumBuf
look identical. Can we move it up to BaseFileChecksumHelper
? (Please leave this as last step, just in case I'm missing some detail in these classes.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @chiacyu for the patch.
@@ -140,7 +140,7 @@ protected String populateBlockChecksumBuf(ByteBuffer checksumData) | |||
}*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the comments could be removed.
Ah good catch we missed it in #7264 |
case COMPOSITE_CRC: | ||
byte[] crcBytes = blockChecksumByteBuffer.array(); | ||
if (LOG.isDebugEnabled()) { | ||
blockChecksumForDebug = CrcUtil.toSingleCrcString(crcBytes); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought you wanted to switch to CrcUtil.toMultiCrcString(crcBytes)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
applied, thanks for the reminder, almost miss that one.
Merged. Thanks all! |
What changes were proposed in this pull request?
The
blockChecksumForDebug
would throw exception due to some of the checksum data is not a single CRC, it would be better to usetoMultiCrcString()
to avoid exception for debug information.What is the link to the Apache JIRA
Please check HDDS-8175 for more details, thanks.
How was this patch tested?
README.md
into /vol1/bucket1/DEBUG
mode afterchecksum
command.The result is belowed, please take a look.