HDDS-13734. Create debug tool for inspecting the contents of container checksum file
What changes were proposed in this pull request?
Create debug tools for inspecting container merkle trees locally on a datanode.
Inspecting a single container's content and checksums could also be done with the file.
-
ozone debug datanode container checksum <tree1>
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/HDDS-13734
How was this patch tested?
Added Unit tests
Sample JSON output
[ {
"containerID" : 12345,
"containerMerkleTree" : {
"dataChecksum" : "f62520b4",
"blockMerkleTrees" : [ {
"blockID" : 1,
"deleted" : false,
"dataChecksum" : "e88231c3",
"chunkMerkleTrees" : [ {
"offset" : 0,
"length" : 4194304,
"checksumMatches" : true,
"dataChecksum" : "f130f21e"
}, {
"offset" : 1,
"length" : 4194304,
"checksumMatches" : true,
"dataChecksum" : "85331923"
}, {
"offset" : 2,
"length" : 4194304,
"checksumMatches" : true,
"dataChecksum" : "f132df67"
}, {
"offset" : 3,
"length" : 4194304,
"checksumMatches" : true,
"dataChecksum" : "f3ea6b43"
} ]
}, {
"blockID" : 2,
"deleted" : false,
"dataChecksum" : "75c48c87",
"chunkMerkleTrees" : [ {
"offset" : 0,
"length" : 4194304,
"checksumMatches" : true,
"dataChecksum" : "c9620575"
}, {
"offset" : 1,
"length" : 4194304,
"checksumMatches" : true,
"dataChecksum" : "cdc4009e"
}, {
"offset" : 2,
"length" : 4194304,
"checksumMatches" : true,
"dataChecksum" : "ae085dad"
}, {
"offset" : 3,
"length" : 4194304,
"checksumMatches" : true,
"dataChecksum" : "1e588f83"
} ]
}, {
"blockID" : 3,
"deleted" : false,
"dataChecksum" : "41524ae2",
"chunkMerkleTrees" : [ {
"offset" : 0,
"length" : 4194304,
"checksumMatches" : true,
"dataChecksum" : "81951cc8"
}, {
"offset" : 1,
"length" : 4194304,
"checksumMatches" : true,
"dataChecksum" : "f596f7f5"
}, {
"offset" : 2,
"length" : 4194304,
"checksumMatches" : true,
"dataChecksum" : "f13a6a83"
}, {
"offset" : 3,
"length" : 4194304,
"checksumMatches" : true,
"dataChecksum" : "62045839"
} ]
} ]
}
} ]
Thanks for the review @errose28 . Updated the PR as per review comments.
This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.
This PR has been marked as stale due to 21 days of inactivity. Please comment or remove the stale label to keep it open. Otherwise, it will be automatically closed in 7 days.