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

Vinayakumar B commented on HDFS-8444:
-------------------------------------

Changes looks good.
But how about changing like below.?
{code}   void checkMoveValidity(INodesInPath srcIIP, INodesInPath dstIIP, 
String src)
       throws IOException {
     assert dir.hasReadLock();
-    final ECSchema srcSchema = getECSchema(srcIIP);
-    final ECSchema dstSchema = getECSchema(dstIIP);
+    final ErasureCodingZone srcZone = getECZone(srcIIP);
+    final ErasureCodingZone dstZone = getECZone(dstIIP);
+    if (srcZone != null && srcZone.getDir().equals(src) && dstZone == null) {
+      return;
+    }
+    final ECSchema srcSchema = (srcZone != null) ? srcZone.getSchema() : null;
+    final ECSchema dstSchema = (dstZone != null) ? dstZone.getSchema() : null;
     if ((srcSchema != null && !srcSchema.equals(dstSchema)) ||
         (dstSchema != null && !dstSchema.equals(srcSchema))) {
       throw new IOException({code}
It would save one more iterate through xattrs to find the zone.

> Erasure Coding: fix cannot rename a zone dir
> --------------------------------------------
>
>                 Key: HDFS-8444
>                 URL: https://issues.apache.org/jira/browse/HDFS-8444
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>            Reporter: Walter Su
>            Assignee: Walter Su
>         Attachments: HDFS-8444-HDFS-7285.001.patch
>
>
> We create a EC zone {{/my_ec_zone}}.
> We want to rename it to {{/myZone}}.
> But it failed.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to