You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by la...@apache.org on 2014/08/25 20:43:42 UTC

[2/2] git commit: HBASE-11536 Puts of region location to Meta may be out of order which causes inconsistent of region location. (Liu Shaohui)

HBASE-11536 Puts of region location to Meta may be out of order which causes inconsistent of region location. (Liu Shaohui)


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/cfd79ac1
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/cfd79ac1
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/cfd79ac1

Branch: refs/heads/branch-1
Commit: cfd79ac1c29a4abd9b343572d2a3a825c9ccfe4f
Parents: 971e775
Author: Lars Hofhansl <la...@apache.org>
Authored: Mon Aug 25 11:35:22 2014 -0700
Committer: Lars Hofhansl <la...@apache.org>
Committed: Mon Aug 25 11:40:31 2014 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hbase/MetaTableAccessor.java  | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/cfd79ac1/hbase-client/src/main/java/org/apache/hadoop/hbase/MetaTableAccessor.java
----------------------------------------------------------------------
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 c01e722..e9ca88b 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
@@ -19,6 +19,7 @@ package org.apache.hadoop.hbase;
 
 import com.google.common.annotations.VisibleForTesting;
 import com.google.protobuf.ServiceException;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.classification.InterfaceAudience;
@@ -38,6 +39,7 @@ import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos;
 import org.apache.hadoop.hbase.protobuf.generated.MultiRowMutationProtos;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.EnvironmentEdgeManager;
 import org.apache.hadoop.hbase.util.Pair;
 import org.apache.hadoop.hbase.util.PairOfSameType;
 import org.apache.hadoop.hbase.util.Threads;
@@ -1407,11 +1409,14 @@ public class MetaTableAccessor {
   }
 
   public static Put addLocation(final Put p, final ServerName sn, long openSeqNum, int replicaId){
-    p.addImmutable(HConstants.CATALOG_FAMILY, getServerColumn(replicaId),
+    // using regionserver's local time as the timestamp of Put.
+    // See: HBASE-11536
+    long now = EnvironmentEdgeManager.currentTimeMillis();
+    p.addImmutable(HConstants.CATALOG_FAMILY, getServerColumn(replicaId), now,
       Bytes.toBytes(sn.getHostAndPort()));
-    p.addImmutable(HConstants.CATALOG_FAMILY, getStartCodeColumn(replicaId),
+    p.addImmutable(HConstants.CATALOG_FAMILY, getStartCodeColumn(replicaId), now,
       Bytes.toBytes(sn.getStartcode()));
-    p.addImmutable(HConstants.CATALOG_FAMILY, getSeqNumColumn(replicaId),
+    p.addImmutable(HConstants.CATALOG_FAMILY, getSeqNumColumn(replicaId), now,
       Bytes.toBytes(openSeqNum));
     return p;
   }