HDFS-8850. VolumeScanner thread exits with exception if there is no block pool to be scanned but there are suspicious blocks. (Colin Patrick McCabe via yliu)

This commit is contained in:
yliu 2015-08-04 15:54:23 +08:00
parent c3364ca8e7
commit 9a08999906
2 changed files with 11 additions and 5 deletions

View File

@ -1109,6 +1109,10 @@ Release 2.8.0 - UNRELEASED
HDFS-8847. change TestHDFSContractAppend to not override HDFS-8847. change TestHDFSContractAppend to not override
testRenameFileBeingAppended method. (Zhihai Xu) testRenameFileBeingAppended method. (Zhihai Xu)
HDFS-8850. VolumeScanner thread exits with exception if there is no block
pool to be scanned but there are suspicious blocks. (Colin Patrick McCabe
via yliu)
Release 2.7.2 - UNRELEASED Release 2.7.2 - UNRELEASED
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -536,11 +536,13 @@ public class VolumeScanner extends Thread {
return 0; return 0;
} }
} }
long saveDelta = monotonicMs - curBlockIter.getLastSavedMs(); if (curBlockIter != null) {
if (saveDelta >= conf.cursorSaveMs) { long saveDelta = monotonicMs - curBlockIter.getLastSavedMs();
LOG.debug("{}: saving block iterator {} after {} ms.", if (saveDelta >= conf.cursorSaveMs) {
this, curBlockIter, saveDelta); LOG.debug("{}: saving block iterator {} after {} ms.",
saveBlockIterator(curBlockIter); this, curBlockIter, saveDelta);
saveBlockIterator(curBlockIter);
}
} }
bytesScanned = scanBlock(block, conf.targetBytesPerSec); bytesScanned = scanBlock(block, conf.targetBytesPerSec);
if (bytesScanned >= 0) { if (bytesScanned >= 0) {