|
@@ -107,9 +107,11 @@ class BlockReceiver implements java.io.Closeable, FSConstants {
|
|
datanode.blockScanner.deleteBlock(block);
|
|
datanode.blockScanner.deleteBlock(block);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ } catch (BlockAlreadyExistsException bae) {
|
|
|
|
+ throw bae;
|
|
} catch(IOException ioe) {
|
|
} catch(IOException ioe) {
|
|
IOUtils.closeStream(this);
|
|
IOUtils.closeStream(this);
|
|
- removeBlock();
|
|
|
|
|
|
+ cleanupBlock();
|
|
|
|
|
|
// check if there is a disk error
|
|
// check if there is a disk error
|
|
IOException cause = FSDataset.getCauseIfDiskError(ioe);
|
|
IOException cause = FSDataset.getCauseIfDiskError(ioe);
|
|
@@ -557,7 +559,7 @@ class BlockReceiver implements java.io.Closeable, FSConstants {
|
|
if (responder != null) {
|
|
if (responder != null) {
|
|
responder.interrupt();
|
|
responder.interrupt();
|
|
}
|
|
}
|
|
- removeBlock();
|
|
|
|
|
|
+ cleanupBlock();
|
|
throw ioe;
|
|
throw ioe;
|
|
} finally {
|
|
} finally {
|
|
if (responder != null) {
|
|
if (responder != null) {
|
|
@@ -571,10 +573,10 @@ class BlockReceiver implements java.io.Closeable, FSConstants {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- /** Remove a partial block
|
|
|
|
|
|
+ /** Cleanup a partial block
|
|
* if this write is for a replication request (and not from a client)
|
|
* if this write is for a replication request (and not from a client)
|
|
*/
|
|
*/
|
|
- private void removeBlock() throws IOException {
|
|
|
|
|
|
+ private void cleanupBlock() throws IOException {
|
|
if (clientName.length() == 0) { // not client write
|
|
if (clientName.length() == 0) { // not client write
|
|
datanode.data.unfinalizeBlock(block);
|
|
datanode.data.unfinalizeBlock(block);
|
|
}
|
|
}
|