Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-13859

Add update replicaInfo's volume in LocalReplica#updateWithReplica

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 3.2.0
    • None
    • datanode
    • None

    Description

          When DirectoryScanner used diff ScanInfo to check and update with memBlock, i found the LocalReplica#updateWithReplica only update the diskfile path but without replicaInfo's volume. And may be the memblock ' volume is diff with the diskfile path before directory scan, so i think need to update the volume meanwhile,so the replicaInfo's meminfo is consistent with disk storage。The relation code as follows:

      public void updateWithReplica(StorageLocation replicaLocation) {
          // for local replicas, the replica location is assumed to be a file.
          File diskFile = null;
          try {
            diskFile = new File(replicaLocation.getUri());
          } catch (IllegalArgumentException e) {
            diskFile = null;
          }
      
          if (null == diskFile) {
            setDirInternal(null);
          } else {
            setDirInternal(diskFile.getParentFile());
          }
        }
      

      Thanks all!

      Attachments

        1. HDFS-13859.001.patch
          5 kB
          liaoyuxiangqin

        Activity

          People

            liaoyuxiangqin liaoyuxiangqin
            liaoyuxiangqin liaoyuxiangqin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: