[
https://issues.apache.org/jira/browse/HDFS-14196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16742070#comment-16742070
]
Steve Loughran commented on HDFS-14196:
---------------------------------------
[~surendrasingh], [~RANith] what is your reasoning behind "making this volatile
will make the bug go away"
if all access to bufferCount is directly or indirectly in a synchronized block,
no, volatile is not needed; the synchronized is enough
[http://gee.cs.oswego.edu/dl/cpj/jmm.html].
if some access to bufferCount is happening on a codepath which isn't
synchronized, then that's potentially deadly, even with volatile, because some
of those synchronized uses seem to be assuming that bufferCount doesn't change
between operations (example insertBatch())
> ArrayIndexOutOfBoundsException in JN metrics makes JN out of sync
> -----------------------------------------------------------------
>
> Key: HDFS-14196
> URL: https://issues.apache.org/jira/browse/HDFS-14196
> Project: Hadoop HDFS
> Issue Type: Bug
> Reporter: Ranith Sardar
> Assignee: Ranith Sardar
> Priority: Major
> Attachments: HDFS-14196.001.patch
>
>
> {{2018-11-26 21:55:39,100 | WARN | IPC Server handler 4 on 25012 | IPC Server
> handler 4 on 25012, call
> org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocol.journal from
> 192.100.2.4:41622 Call#785140293 Retry#0 | Server.java:2334
> java.lang.ArrayIndexOutOfBoundsException: 500 at
> org.apache.hadoop.metrics2.util.SampleQuantiles.insert(SampleQuantiles.java:114)
> at
> org.apache.hadoop.metrics2.lib.MutableQuantiles.add(MutableQuantiles.java:130)
> at
> org.apache.hadoop.hdfs.qjournal.server.JournalMetrics.addSync(JournalMetrics.java:120)
> at org.apache.hadoop.hdfs.qjournal.server.Journal.journal(Journal.java:400)
> at
> org.apache.hadoop.hdfs.qjournal.server.JournalNodeRpcServer.journal(JournalNodeRpcServer.java:153)
> at
> org.apache.hadoop.hdfs.qjournal.protocolPB.QJournalProtocolServerSideTranslatorPB.journal(QJournalProtocolServerSideTranslatorPB.java:158)
> at
> org.apache.hadoop.hdfs.qjournal.protocol.QJournalProtocolProtos$QJournalProtocolService$2.callBlockingMethod(QJournalProtocolProtos.java:2542}}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]