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

ASF GitHub Bot updated HDDS-15886:
----------------------------------
    Labels: pull-request-available  (was: )

> Client unable to read newly synced data due to outdated block length
> --------------------------------------------------------------------
>
>                 Key: HDDS-15886
>                 URL: https://issues.apache.org/jira/browse/HDDS-15886
>             Project: Apache Ozone
>          Issue Type: Sub-task
>            Reporter: Chung-En Lee
>            Assignee: Chung-En Lee
>            Priority: Critical
>              Labels: pull-request-available
>
> With `ozone.client.stream.read.block` enabled, a reader that opens a file 
> that is still being written can't read all the data the writer has hsync'ed. 
> It hits EOF at the block length OM last recorded. With the setting disabled, 
> the same read succeeds.
> Why OM's block length is out of date
> To keep OM load down, BlockOutputStreamEntryPool#hsyncKey only sends the new 
> length to OM when the last block has changed. Later hsyncs that stay within 
> the same block write the data to the datanodes but don't update OM. So for 
> the last block of an hsync'ed file, OM's length can be shorter than what is 
> actually on the datanode.
> The read path expects this. KeyInputStream marks the last block of an 
> hsync'ed file as under construction (setUnderConstruction(true)). 
> BlockInputStream then gets the real length from the datanode.
> StreamBlockInputStream doesn't do this. It takes blockInfo.getLength() from 
> OM through BlockInputStreamFactoryImpl, stores it in a final field, and never 
> checks isUnderConstruction().
> This issue was found by `TestContractCreate#testSyncable` . It fails with 
> streamReadBlock enabled.



--
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