You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/02/03 20:00:27 UTC

[GitHub] [hadoop-ozone] bharatviswa504 commented on a change in pull request #501: HDDS-2944. Handle replay of KeyCommitRequest and DirectoryCreateRequest

bharatviswa504 commented on a change in pull request #501: HDDS-2944. Handle replay of KeyCommitRequest and DirectoryCreateRequest
URL: https://github.com/apache/hadoop-ozone/pull/501#discussion_r374310642
 
 

 ##########
 File path: hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/request/file/OMDirectoryCreateRequest.java
 ##########
 @@ -126,16 +143,17 @@ public OMClientResponse validateAndUpdateCache(OzoneManager ozoneManager,
     boolean acquiredLock = false;
     IOException exception = null;
     OMClientResponse omClientResponse = null;
+    Result result = null;
     try {
       // check Acl
       checkKeyAcls(ozoneManager, volumeName, bucketName, keyName,
           IAccessAuthorizer.ACLType.CREATE, OzoneObj.ResourceType.KEY);
 
       // Check if this is the root of the filesystem.
       if (keyName.length() == 0) {
-        return new OMDirectoryCreateResponse(null,
-            omResponse.setCreateDirectoryResponse(
-                CreateDirectoryResponse.newBuilder()).build());
+        throw new OMException("Directory create failed. Cannot create " +
 
 Review comment:
   Looks like hdfs does the same
   
   Tried on a HDFS cluster.
   [root@ozone-test-bh-2 ~]# hdfs dfs -mkdir hdfs://ozone-test-bh-6.vpc.cloudera.com:8020
   mkdir: Call From ozone-test-bh-2.vpc.cloudera.com/10.65.51.138 to ozone-test-bh-6.vpc.cloudera.com:8020 failed on connection exception: java.net.ConnectException: Connection refused; For more details see:  http://wiki.apache.org/hadoop/ConnectionRefused
   [root@ozone-test-bh-2 ~]# hdfs dfs -mkdir hdfs://ozone-test-bh-2.vpc.cloudera.com:8020
   mkdir: `Item: hdfs://ozone-test-bh-2.vpc.cloudera.com:8020 parent's path is null. This can happen if mkdir is called on root, so there's no parent.': No such file or directory
   [root@ozone-test-bh-2 ~]# hdfs dfs -mkdir hdfs://ozone-test-bh-2.vpc.cloudera.com:8020/
   mkdir: `hdfs://ozone-test-bh-2.vpc.cloudera.com:8020/': File exists

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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