umamaheswararao commented on a change in pull request #2831:
URL: https://github.com/apache/ozone/pull/2831#discussion_r749498911
##########
File path:
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedStripeInputStream.java
##########
@@ -422,12 +467,15 @@ public synchronized boolean hasSufficientLocations() {
int availableLocations =
availableDataLocations() + availableParityLocations();
int paddedLocations = repConfig.getData() - expectedDataBlocks;
+ int failedLocations = failedDataIndexes.size();
- if (availableLocations + paddedLocations >= repConfig.getData()) {
+ if (availableLocations + paddedLocations - failedLocations
+ >= repConfig.getData()) {
return true;
} else {
Review comment:
Should this be an error instead of warn? We can't proceed right
##########
File path:
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/read/TestECBlockReconstructedStripeInputStream.java
##########
@@ -354,8 +355,8 @@ public void testErrorThrownIfBlockNotLongEnough() throws
IOException {
try {
ecb.readStripe(bufs);
Assert.fail("Read should have thrown an exception");
- } catch (IOException e) {
- Assert.assertTrue(e.getMessage().matches("^Expected\\sto\\sread.+"));
+ } catch (InsufficientLocationsException e) {
Review comment:
Instead of empty catch, we could also add header annotation in test
(expected = InsufficientLocationsException.class). But I am not worried though.
##########
File path:
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/io/ECBlockReconstructedStripeInputStream.java
##########
@@ -210,12 +224,28 @@ public synchronized int readStripe(ByteBuffer[] bufs)
throws IOException {
return EOF;
}
validateBuffers(bufs);
- assignBuffers(bufs);
- clearParityBuffers();
- // Set the read limits on the buffers so we do not read any garbage data
- // from the end of the block that is unexpected.
- setBufferReadLimits(bufs, toRead);
- loadDataBuffersFromStream();
+ while(true) {
+ try {
+ assignBuffers(bufs);
+ clearParityBuffers();
+ // Set the read limits on the buffers so we do not read any garbage
data
+ // from the end of the block that is unexpected.
+ setBufferReadLimits(bufs, toRead);
+ loadDataBuffersFromStream();
+ break;
+ } catch (IOException e) {
+ // Re-init now the bad block has been excluded. If we have ran out of
Review comment:
I think we should log here about the retry?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]