HDDS-8175. getFileChecksum() throws exception in debug mode.#7611
HDDS-8175. getFileChecksum() throws exception in debug mode.#7611jojochuang merged 4 commits intoapache:masterfrom
Conversation
adoroszlai
left a comment
There was a problem hiding this comment.
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.)
chungen0126
left a comment
There was a problem hiding this comment.
Thanks @chiacyu for the patch.
| @@ -140,7 +140,7 @@ protected String populateBlockChecksumBuf(ByteBuffer checksumData) | |||
| }*/ | |||
There was a problem hiding this comment.
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.
I thought you wanted to switch to CrcUtil.toMultiCrcString(crcBytes)?
There was a problem hiding this comment.
applied, thanks for the reminder, almost miss that one.
|
Merged. Thanks all! |
What changes were proposed in this pull request?
The
blockChecksumForDebugwould 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.mdinto /vol1/bucket1/DEBUGmode afterchecksumcommand.The result is belowed, please take a look.