[
https://issues.apache.org/jira/browse/HDFS-9735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15229539#comment-15229539
]
Vinayakumar B commented on HDFS-9735:
-------------------------------------
Thanks [~anu] for the update.
bq. In moveBlock(), from line 990 to line 997, finalizeReplicae(...) to
removeOldReplicas() are not atomic.
bq. After finalizedReplica(...), there is a short period of time, there are two
copies of the same replicas in the volumeMap, and both of them are visible to
others.
[~eddyxu], AFAIK, in {{finalizeReplica(..))}}, {{volumeMap.add(bpid,
newReplicaInfo);}} will ensure that there will be a single entry for each
block. Its an atomic operation. So, there is not a chance of having multiple
visible entries in volumeMap (other than it just exists on disk till
removeOldReplica() is called).
Besides, {{removeOldReplica()}} will not do any operation on VolumeMap. it just
deletes the block files on disk, and add block to IBRs list.
Hope this helps. Please let me know if anything I am missing here.
> DiskBalancer : Refactor moveBlockAcrossStorage to be used by disk balancer
> --------------------------------------------------------------------------
>
> Key: HDFS-9735
> URL: https://issues.apache.org/jira/browse/HDFS-9735
> Project: Hadoop HDFS
> Issue Type: Sub-task
> Components: balancer & mover
> Affects Versions: HDFS-1312
> Reporter: Anu Engineer
> Assignee: Anu Engineer
> Fix For: HDFS-1312
>
> Attachments: HDFS-9735-HDFS-1312.001.patch,
> HDFS-9735-HDFS-1312.002.patch
>
>
> Refactor moveBlockAcrossStorage so that code can be shared by both mover and
> diskbalancer.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)