[ 
https://issues.apache.org/jira/browse/HDFS-12942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16298948#comment-16298948
 ] 

Virajith Jalaparti commented on HDFS-12942:
-------------------------------------------

Hi [~ajayydv], thanks for posting the patch to fix this. A few comments:

# Is it necessary to call {{processBlockInvalidation}} in 
{{cleanupNewReplica}}? The {{newReplicaInfo}} passed in isn't used for reading 
as it is just temporary for the block move. This call will invalidate any 
references to the original replica which was used to create the 
newReplicaInfo}}. So, I think this call is not required.
# The rest of the code in {{cleanupNewReplica}} is same as the deletion logic 
in {{removeOldReplica}}. If this method is being added, it would be useful to 
refactor {{removeOldReplica}} and call {{cleanupNewReplica}} instead of having 
the same logic in two places. I would rename {{cleanupNewReplica}} to say 
{{cleanupReplica}} when this refactoring is done.
# I think a method name like {{FsDatasetImpl#copyReplicaToVolume}} instead of 
{{FsDatasetImpl#createNewReplicaObj}} would make it clearer what that method is 
doing. I would also clarify in the javadoc that the method creates a 
{{TEMPORARY}} replica in the volume passed in.
# A javadoc for {{TestFsDatasetImpl#createNewReplicaObj}} would be useful.
# {{"Generation Stamp should be monotonically increased. That assumption is 
violated here."}} I think the latter part of the message ({{"That assumption is 
violated here"}}) isn't required.


> Synchronization issue in FSDataSetImpl#moveBlock
> ------------------------------------------------
>
>                 Key: HDFS-12942
>                 URL: https://issues.apache.org/jira/browse/HDFS-12942
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Ajay Kumar
>            Assignee: Ajay Kumar
>         Attachments: HDFS-12942.001.patch
>
>
> FSDataSetImpl#moveBlock  works in following following 3 steps:
> # first creates a new replicaInfo object
> # calls finalizeReplica to finalize it.
> # Calls removeOldReplica to remove oldReplica.
> A client can potentially append to the old replica between step 1 and 2.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to