HDFS-12933. Improve logging when DFSStripedOutputStream failed to write some blocks. Contributed by chencan.

This commit is contained in:
Xiao Chen 2018-02-06 22:54:17 -08:00
parent 4fadcf1631
commit e5c2fdddd6

View File

@ -1288,8 +1288,8 @@ private void logCorruptBlocks() {
int bgIndex = entry.getKey(); int bgIndex = entry.getKey();
int corruptBlockCount = entry.getValue(); int corruptBlockCount = entry.getValue();
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
sb.append("Block group <").append(bgIndex).append("> has ") sb.append("Block group <").append(bgIndex).append("> failed to write ")
.append(corruptBlockCount).append(" corrupt blocks."); .append(corruptBlockCount).append(" blocks.");
if (corruptBlockCount == numAllBlocks - numDataBlocks) { if (corruptBlockCount == numAllBlocks - numDataBlocks) {
sb.append(" It's at high risk of losing data."); sb.append(" It's at high risk of losing data.");
} }