You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by st...@apache.org on 2019/11/22 06:58:56 UTC

[hbase] branch branch-2.2 updated: HBASE-23328 info:regioninfo goes wrong when region replicas enabled (#863)

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

stack pushed a commit to branch branch-2.2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.2 by this push:
     new cd70a47  HBASE-23328 info:regioninfo goes wrong when region replicas enabled (#863)
cd70a47 is described below

commit cd70a47d2d1b905e5134fc679ff73efa45917752
Author: Michael Stack <sa...@users.noreply.github.com>
AuthorDate: Thu Nov 21 22:57:22 2019 -0800

    HBASE-23328 info:regioninfo goes wrong when region replicas enabled (#863)
    
    Signed-off-by: Ramkrishna <ra...@intel.com>
    Signed-off-by: Guangxu Cheng <gu...@gmail.com>
---
 .../src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java     | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
index 09a0f95..d9dc779 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
@@ -1898,7 +1898,10 @@ public class MetaTableAccessor {
         .setQualifier(HConstants.REGIONINFO_QUALIFIER)
         .setTimestamp(p.getTimestamp())
         .setType(Type.Put)
-        .setValue(RegionInfo.toByteArray(hri))
+        // Serialize the Default Replica HRI otherwise scan of hbase:meta
+        // shows an info:regioninfo value with encoded name and region
+        // name that differs from that of the hbase;meta row.
+        .setValue(RegionInfo.toByteArray(RegionReplicaUtil.getRegionInfoForDefaultReplica(hri)))
         .build());
     return p;
   }