[
https://issues.apache.org/jira/browse/HDFS-16422?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17503858#comment-17503858
]
Jing Zhao commented on HDFS-16422:
----------------------------------
Looks like we already have r/w lock protection in AbstractNativeRawDecoder and
its subclasses (NativeRSRawDecoder and NativeXORRawDecoder). So does that mean
the extra protection is only necessary for other decoder implementations (such
as RSRawDecoder)?
HADOOP-15499 used r/w lock to replace the original object monitor (i.e.
synchronized) so as to improve performance. Now looks like we're adding
"synchronized" back to the APIs defined in the parent class.
I guess instead of updating the decode APIs in RawErasureDecoder, we may want
to only fix the subclasses without lock protection. What do you think,
[~weichiu] [~cndaimin] ?
> Fix thread safety of EC decoding during concurrent preads
> ---------------------------------------------------------
>
> Key: HDFS-16422
> URL: https://issues.apache.org/jira/browse/HDFS-16422
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: dfsclient, ec, erasure-coding
> Affects Versions: 3.3.0, 3.3.1
> Reporter: daimin
> Assignee: daimin
> Priority: Critical
> Labels: pull-request-available
> Fix For: 3.4.0, 3.2.3, 3.3.3
>
> Time Spent: 3h 40m
> Remaining Estimate: 0h
>
> Reading data on an erasure-coded file with missing replicas(internal block of
> block group) will cause online reconstruction: read dataUnits part of data
> and decode them into the target missing data. Each DFSStripedInputStream
> object has a RawErasureDecoder object, and when we doing pread concurrently,
> RawErasureDecoder.decode will be invoked concurrently too.
> RawErasureDecoder.decode is not thread safe, as a result of that we get wrong
> data from pread occasionally.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]