|
@@ -2389,9 +2389,11 @@ public class DataNode extends Configured
|
|
streams.checksumOut,
|
|
streams.checksumOut,
|
|
SMALL_BUFFER_SIZE));
|
|
SMALL_BUFFER_SIZE));
|
|
}
|
|
}
|
|
|
|
+ } 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);
|
|
@@ -2805,7 +2807,7 @@ public class DataNode extends Configured
|
|
if (responder != null) {
|
|
if (responder != null) {
|
|
responder.interrupt();
|
|
responder.interrupt();
|
|
}
|
|
}
|
|
- removeBlock();
|
|
|
|
|
|
+ cleanupBlock();
|
|
throw ioe;
|
|
throw ioe;
|
|
} finally {
|
|
} finally {
|
|
if (responder != null) {
|
|
if (responder != null) {
|
|
@@ -2819,10 +2821,10 @@ public class DataNode extends Configured
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- /** 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
|
|
data.unfinalizeBlock(block);
|
|
data.unfinalizeBlock(block);
|
|
}
|
|
}
|