[
https://issues.apache.org/jira/browse/HDFS-16228?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17422419#comment-17422419
]
Konstantin Shvachko commented on HDFS-16228:
--------------------------------------------
Atomic variables have the same semantics as volatile, except that in addition
they provide atomic set-and-get methods.
In your patch you do call {{incrementAndGet()}}, but only for the purpose of
incrementing since you never use the returned result.
So you might as well keep it volatile.
Besides, all GSet methods should be called under a higher level lock, so they
should be safe.
> [FGL]Improve safer PartitionedGSet#size
> ---------------------------------------
>
> Key: HDFS-16228
> URL: https://issues.apache.org/jira/browse/HDFS-16228
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: hdfs, namenode
> Reporter: JiangHua Zhu
> Assignee: JiangHua Zhu
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> When multiple PartitionedEntry is working at the same time, there may be
> inconsistencies in the operation PartitionedGSet#size.
> For example, there are some size++ or size-- operations in PartitionedGSet.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]