You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by ra...@apache.org on 2023/03/28 06:27:29 UTC

[hbase-operator-tools] branch master updated: HBASE-27754 generateMissingTableDescriptorFile should throw write permission error and fail (#114)

This is an automated email from the ASF dual-hosted git repository.

rajeshbabu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase-operator-tools.git


The following commit(s) were added to refs/heads/master by this push:
     new 26fc7e5  HBASE-27754 generateMissingTableDescriptorFile should throw write permission error and fail (#114)
26fc7e5 is described below

commit 26fc7e5d2a0ec1dcd5b3c9bceb7f2ce1fd154055
Author: Nihal Jain <ni...@gmail.com>
AuthorDate: Tue Mar 28 11:57:23 2023 +0530

    HBASE-27754 generateMissingTableDescriptorFile should throw write permission error and fail (#114)
---
 .../src/main/java/org/apache/hbase/HBCKFsTableDescriptors.java      | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hbase-hbck2/src/main/java/org/apache/hbase/HBCKFsTableDescriptors.java b/hbase-hbck2/src/main/java/org/apache/hbase/HBCKFsTableDescriptors.java
index 1fe2cad..0c07f95 100644
--- a/hbase-hbck2/src/main/java/org/apache/hbase/HBCKFsTableDescriptors.java
+++ b/hbase-hbck2/src/main/java/org/apache/hbase/HBCKFsTableDescriptors.java
@@ -36,6 +36,7 @@ import org.apache.hadoop.hbase.client.TableDescriptor;
 import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.security.AccessControlException;
 import org.apache.yetus.audience.InterfaceAudience;
 
 import org.slf4j.Logger;
@@ -369,6 +370,11 @@ public class HBCKFsTableDescriptors  {
         }
         LOG.debug("Wrote into " + tableInfoDirPath);
       } catch (IOException ioe) {
+        // fail-fast and get out of retry loop as user does not have privilege to write to hdfs
+        // hence, no point in retrying
+        if(ioe instanceof AccessControlException){
+          throw ioe;
+        }
         // Presume clash of names or something; go around again.
         LOG.debug("Failed write and/or rename; retrying", ioe);
         if (!HBCKFsUtils.deleteDirectory(fs, tempPath)) {