hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r1560201 - in /hbase/trunk: hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/
Date Tue, 21 Jan 2014 21:30:49 GMT
Author: jdcryans
Date: Tue Jan 21 21:30:49 2014
New Revision: 1560201

URL: http://svn.apache.org/r1560201
Log:
HBASE-10249 TestReplicationSyncUpTool fails because failover takes too long

Modified:
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
    hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesZKImpl.java
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java?rev=1560201&r1=1560200&r2=1560201&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
(original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueues.java
Tue Jan 21 21:30:49 2014
@@ -106,4 +106,11 @@ public interface ReplicationQueues {
    * @return a list of server names
    */
   List<String> getListOfReplicators();
+
+  /**
+   * Checks if the provided znode is the same as this region server's
+   * @param znode to check
+   * @return if this is this rs's znode
+   */
+  boolean isThisOurZnode(String znode);
 }

Modified: hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesZKImpl.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesZKImpl.java?rev=1560201&r1=1560200&r2=1560201&view=diff
==============================================================================
--- hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesZKImpl.java
(original)
+++ hbase/trunk/hbase-client/src/main/java/org/apache/hadoop/hbase/replication/ReplicationQueuesZKImpl.java
Tue Jan 21 21:30:49 2014
@@ -154,12 +154,13 @@ public class ReplicationQueuesZKImpl ext
   }
 
   @Override
+  public boolean isThisOurZnode(String znode) {
+    return ZKUtil.joinZNode(this.queuesZNode, znode).equals(this.myQueuesZnode);
+  }
+
+  @Override
   public SortedMap<String, SortedSet<String>> claimQueues(String regionserverZnode)
{
     SortedMap<String, SortedSet<String>> newQueues = new TreeMap<String, SortedSet<String>>();
-    if (ZKUtil.joinZNode(this.queuesZNode, regionserverZnode).equals(this.myQueuesZnode))
{
-      LOG.warn("An attempt was made to claim our own queues on region server " + regionserverZnode);
-      return newQueues;
-    }
     // check whether there is multi support. If yes, use it.
     if (conf.getBoolean(HConstants.ZOOKEEPER_USEMULTI, true)) {
       LOG.info("Atomically moving " + regionserverZnode + "'s hlogs to my queue");

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java?rev=1560201&r1=1560200&r2=1560201&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
Tue Jan 21 21:30:49 2014
@@ -475,6 +475,9 @@ public class ReplicationSourceManager im
 
     @Override
     public void run() {
+      if (this.rq.isThisOurZnode(rsZnode)) {
+        return;
+      }
       // Wait a bit before transferring the queues, we may be shutting down.
       // This sleep may not be enough in some cases.
       try {



Mime
View raw message