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

Jonathan Hsieh commented on HBASE-5631:
---------------------------------------

Have you tried shutting down the cluster and then restarting it?  I have a 
suspicion that this may not work if the HTD isn't cached.  Could you modify the 
test (add a few lines) from HBASE-6516 to verify that this patch fixes the 
table?  

{code}
+      HTableDescriptor[] htds = getHTableDescriptors(tmpList); // this goes to 
master which goes to the filesystem.... 
{code}

----

Nits: 
instead of this:
{code}
+      Path hbaseRoot = new Path(conf.get(HConstants.HBASE_DIR));
{code}
use this:
{code}
FSUtils.getRootDir(conf);
{code}

Are we purposely updating the passed in array?  could we just use tmpList?
{code}
+      List<String> tmpList = new ArrayList<String>();
+      tmpList.addAll(orphanTableDirs);
+      HTableDescriptor[] htds = getHTableDescriptors(tmpList);
+      Iterator iter = orphanTableDirs.iterator();
+      int j = 0;
+      while (iter.hasNext()) {
+        String tableName = (String) iter.next();
+ 
{code}

I wasn't consistent with error.print vs log.  I think I prefer log.  Any reason 
you picked this vs the other?
{code}
+        errors.print("Try to fix orphan table: " + tableName);
..
+            errors.print("fixing table: " + tableName);
..
+          errors.report("Failed to fix orphan table: " + tableName);
{code}

typo/reword:  hfsck -> hbck, "It is strongly recommended that you re-run hbck 
manually since orphan table dirs have been fixed"
{code}
+        LOG.warn("Strongly recommend to re-run manually hfsck after all 
orphanTableDirs being fixed");
{code}

                
> hbck should handle case where .tableinfo file is missing.
> ---------------------------------------------------------
>
>                 Key: HBASE-5631
>                 URL: https://issues.apache.org/jira/browse/HBASE-5631
>             Project: HBase
>          Issue Type: Improvement
>          Components: hbck
>    Affects Versions: 0.92.2, 0.94.0, 0.96.0
>            Reporter: Jonathan Hsieh
>            Assignee: Jie Huang
>         Attachments: hbase-5631.patch
>
>
> 0.92+ branches have a .tableinfo file which could be missing from hdfs.  hbck 
> should be able to detect and repair this properly.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to