You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-issues@hadoop.apache.org by "farmmamba (Jira)" <ji...@apache.org> on 2023/07/26 03:50:00 UTC

[jira] [Commented] (HDFS-17125) Method checkAndUpdate should also resolve duplicate replicas when memBlockInfo.metadataExists() return false

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

farmmamba commented on HDFS-17125:
----------------------------------

[~hexiaoqiao] [~ayushsaxena] [~zhangshuyan] Sir, could you please give me some advise here? Thanks a lot.

> Method checkAndUpdate should also resolve duplicate replicas when memBlockInfo.metadataExists() return false
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-17125
>                 URL: https://issues.apache.org/jira/browse/HDFS-17125
>             Project: Hadoop HDFS
>          Issue Type: Improvement
>          Components: datanode
>    Affects Versions: 3.4.0
>            Reporter: farmmamba
>            Assignee: farmmamba
>            Priority: Major
>
> In method FsDatasetImpl#checkAndUpdate, there is below code snippet:
> {code:java}
> if (memBlockInfo.blockDataExists()) {
>   if (memBlockInfo.getBlockURI().compareTo(diskFile.toURI()) != 0) {
>     if (diskMetaFileExists) {
>       if (memBlockInfo.metadataExists()) {
>         // We have two sets of block+meta files. Decide which one to
>         // keep.
>         ReplicaInfo diskBlockInfo =
>             new ReplicaBuilder(ReplicaState.FINALIZED)
>               .setBlockId(blockId)
>               .setLength(diskFile.length())
>               .setGenerationStamp(diskGS)
>               .setFsVolume(vol)
>               .setDirectoryToUse(diskFile.getParentFile())
>               .build();
>         ((FsVolumeImpl) vol).resolveDuplicateReplicas(bpid,
>             memBlockInfo, diskBlockInfo, volumeMap);
>       }
>     } else {
>     // .....
> }
>       if (!fileIoProvider.delete(vol, diskFile)) {
>         LOG.warn("Failed to delete " + diskFile);
>       }
>     }
>   }
> } {code}
> It does resolveDuplicateReplicas when memBlockInfo.metadataExists() returns true. Do we need to add some logic here when memBlockInfo.metadataExists()  returns false?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-help@hadoop.apache.org