[ 
https://issues.apache.org/jira/browse/HDDS-7303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Attila Doroszlai updated HDDS-7303:
-----------------------------------
    Fix Version/s: 1.3.0
       Resolution: Fixed
           Status: Resolved  (was: Patch Available)

> EC: ECBlockReconstructedStripeInputStream should set initialized false on 
> re-init
> ---------------------------------------------------------------------------------
>
>                 Key: HDDS-7303
>                 URL: https://issues.apache.org/jira/browse/HDDS-7303
>             Project: Apache Ozone
>          Issue Type: Sub-task
>          Components: EC Client
>            Reporter: Stephen O'Donnell
>            Assignee: Stephen O'Donnell
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.3.0
>
>
> In ECBlockReconstructedStripeInputStream, when an exception occurs reading a 
> block, the code calls the `init()` method to setup the missing indexes and 
> buffers.
> If an InsufficientLocations exception is thrown part way through that method, 
> the class ends up partly re-initialized. If something then ignores / handles 
> the InsufficientLocations and tries to call read again, it can cause strange 
> results. In one case, we get an illegalArgumentException, which I think is 
> related to the above:
> {code}
> Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
>       at 
> org.apache.hadoop.ozone.client.io.ECBlockReconstructedStripeInputStream.assignBuffers(ECBlockReconstructedStripeInputStream.java:289)
>       at 
> org.apache.hadoop.ozone.client.io.ECBlockReconstructedStripeInputStream.read(ECBlockReconstructedStripeInputStream.java:360)
>       at 
> org.apache.hadoop.ozone.client.io.ECBlockReconstructedStripeInputStream.readStripe(ECBlockReconstructedStripeInputStream.java:345)
>       at 
> org.apache.hadoop.ozone.client.io.ECBlockReconstructedInputStream.readStripe(ECBlockReconstructedInputStream.java:214)
>       at 
> org.apache.hadoop.ozone.client.io.ECBlockReconstructedInputStream.readAndSeekStripe(ECBlockReconstructedInputStream.java:198)
>       at 
> org.apache.hadoop.ozone.client.io.ECBlockReconstructedInputStream.seek(ECBlockReconstructedInputStream.java:192)
>       at 
> org.apache.hadoop.ozone.client.io.ECBlockInputStreamProxy.seek(ECBlockInputStreamProxy.java:224)
>       at 
> org.apache.hadoop.ozone.client.io.KeyInputStream.seek(KeyInputStream.java:340)
>       at 
> org.apache.hadoop.fs.ozone.OzoneFSInputStream.seek(OzoneFSInputStream.java:78)
>       at org.apache.hadoop.fs.FSInputStream.read(FSInputStream.java:85)
>       at org.apache.hadoop.fs.FSInputStream.readFully(FSInputStream.java:124)
>       at 
> org.apache.hadoop.fs.FSDataInputStream.readFully(FSDataInputStream.java:116)
>       at 
> org.apache.orc.impl.RecordReaderUtils$DefaultDataReader.readStripeFooter(RecordReaderUtils.java:273)
>       at 
> org.apache.orc.impl.RecordReaderImpl.readStripeFooter(RecordReaderImpl.java:308)
>       at 
> org.apache.orc.impl.RecordReaderImpl.beginReadStripe(RecordReaderImpl.java:1131)
>       at 
> org.apache.orc.impl.RecordReaderImpl.readStripe(RecordReaderImpl.java:1093)
>       at 
> org.apache.orc.impl.RecordReaderImpl.advanceStripe(RecordReaderImpl.java:1261)
>       at 
> org.apache.orc.impl.RecordReaderImpl.advanceToNextRow(RecordReaderImpl.java:1296)
>       at 
> org.apache.orc.impl.RecordReaderImpl.nextBatch(RecordReaderImpl.java:1332)
>       at 
> org.apache.hadoop.hive.ql.io.orc.RecordReaderImpl.nextBatch(RecordReaderImpl.java:157)
>       at 
> org.apache.hadoop.hive.ql.io.orc.VectorizedOrcAcidRowBatchReader$1.next(VectorizedOrcAcidRowBatchReader.java:175)
>       at 
> org.apache.hadoop.hive.ql.io.orc.VectorizedOrcAcidRowBatchReader$1.next(VectorizedOrcAcidRowBatchReader.java:171)
>       at 
> org.apache.hadoop.hive.ql.io.orc.VectorizedOrcAcidRowBatchReader.next(VectorizedOrcAcidRowBatchReader.java:871)
>       ... 26 more
> {code}
> We should simply set initialized to false at the beginning of init and set it 
> to try at the end when the full init method has completed.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to