HDFS-12771. Add genstamp and block size to metasave Corrupt blocks list. Contributed by Kuhu Shukla.
This commit is contained in:
parent
299d38295d
commit
4d2dce40bb
@ -775,10 +775,11 @@ public class BlockManager implements BlockStatsMXBean {
|
|||||||
String storageId = storage.getStorageID();
|
String storageId = storage.getStorageID();
|
||||||
DatanodeStorageInfo storageInfo = node.getStorageInfo(storageId);
|
DatanodeStorageInfo storageInfo = node.getStorageInfo(storageId);
|
||||||
State state = (storageInfo == null) ? null : storageInfo.getState();
|
State state = (storageInfo == null) ? null : storageInfo.getState();
|
||||||
out.println("Block=" + block.getBlockId() + "\tNode=" + node.getName()
|
out.println("Block=" + block.toString()
|
||||||
+ "\tStorageID=" + storageId + "\tStorageState=" + state
|
+ "\tSize=" + block.getNumBytes()
|
||||||
+ "\tTotalReplicas=" +
|
+ "\tNode=" + node.getName() + "\tStorageID=" + storageId
|
||||||
blocksMap.numNodes(block)
|
+ "\tStorageState=" + state
|
||||||
|
+ "\tTotalReplicas=" + blocksMap.numNodes(block)
|
||||||
+ "\tReason=" + corruptReplicas.getCorruptReason(block, node));
|
+ "\tReason=" + corruptReplicas.getCorruptReason(block, node));
|
||||||
numNodesToFind--;
|
numNodesToFind--;
|
||||||
if (numNodesToFind == 0) {
|
if (numNodesToFind == 0) {
|
||||||
|
@ -1318,8 +1318,9 @@ public class TestBlockManager {
|
|||||||
assertTrue("Unexpected text in metasave," +
|
assertTrue("Unexpected text in metasave," +
|
||||||
"was expecting corrupt blocks section!", foundIt);
|
"was expecting corrupt blocks section!", foundIt);
|
||||||
corruptBlocksLine = reader.readLine();
|
corruptBlocksLine = reader.readLine();
|
||||||
String regex = "Block=[0-9]+\\tNode=.*\\tStorageID=.*StorageState.*" +
|
String regex = "Block=blk_[0-9]+_[0-9]+\\tSize=.*\\tNode=.*" +
|
||||||
"TotalReplicas=.*Reason=GENSTAMP_MISMATCH";
|
"\\tStorageID=.*\\tStorageState.*" +
|
||||||
|
"\\tTotalReplicas=.*\\tReason=GENSTAMP_MISMATCH";
|
||||||
assertTrue("Unexpected corrupt block section in metasave!",
|
assertTrue("Unexpected corrupt block section in metasave!",
|
||||||
corruptBlocksLine.matches(regex));
|
corruptBlocksLine.matches(regex));
|
||||||
corruptBlocksLine = reader.readLine();
|
corruptBlocksLine = reader.readLine();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user