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 07:00:50 UTC

[hbase] branch branch-2.1 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.1
in repository https://gitbox.apache.org/repos/asf/hbase.git


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

commit 5288f903ade69a61d6ef96e1872582a59ffa7668
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 9c13c12..8fa9780 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
@@ -1910,7 +1910,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;
   }