hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Busbey (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-18792) hbase-2 needs to defend against hbck operations
Date Fri, 13 Apr 2018 13:21:00 GMT

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

Sean Busbey commented on HBASE-18792:
-------------------------------------

{code}
+    while (index < v1Comps.length && index < v2Comps.length) {
+      int va = v1Comps[index] instanceof Integer ? (Integer)v1Comps[index] : VERY_LARGE_NUMBER;
+      int vb = v2Comps[index] instanceof Integer ? (Integer)v2Comps[index] : VERY_LARGE_NUMBER;
+
       if (va != vb) {
         return va - vb;
       }
       if (va == VERY_LARGE_NUMBER) {
         // compare as String
-        int c = s1[index].compareTo(s2[index]);
+        int c = ((String)v1Comps[index]).compareTo((String)v2Comps[index]);
         if (c != 0) {
           return c;
         }
       }
       index++;
     }
{code}

ooof. man that's rough. How about a comment before the {{if(va == VERY_LARGE_NUMBER)}} that
says something like "va and vb must both be the same and indicate that the version part is
a String"?

Also make {{va}}, {{vb}}, and {{VERY_LARGE_NUMBER}} all type {{Integer}} instead of int and
use {{Integer#compareTo(Integer)}} so that we're not going through a bunch of autoboxing.

> hbase-2 needs to defend against hbck operations
> -----------------------------------------------
>
>                 Key: HBASE-18792
>                 URL: https://issues.apache.org/jira/browse/HBASE-18792
>             Project: HBase
>          Issue Type: Task
>          Components: hbck
>            Reporter: stack
>            Assignee: Umesh Agashe
>            Priority: Blocker
>             Fix For: 2.0.0
>
>         Attachments: hbase-18792.master.001.patch
>
>
> hbck needs updating to run against hbase2. Meantime, if an hbck from hbase1 is run against
hbck2, it may do damage. hbase2 should defend itself against hbck1 ops.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message