hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbau...@apache.org
Subject svn commit: r1310611 - /hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
Date Fri, 06 Apr 2012 22:12:43 GMT
Author: mbautin
Date: Fri Apr  6 22:12:43 2012
New Revision: 1310611

URL: http://svn.apache.org/viewvc?rev=1310611&view=rev
Log:
[JIRA] [HBASE-5618] SplitLogManager - prevent unnecessary attempts to resubmits

Summary: update heartbeat time as soon as possible - w/o first waiting to read zk node (1)
when zk watch fires (2) when resubmit fails with bad-version

Test Plan: TestSplitLogMangaer passes.

Reviewers: kannan, kranganathan, liyintang, mbautin

Reviewed By: kannan

CC: hbase-eng@

Differential Revision: https://phabricator.fb.com/D441769

Modified:
    hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java

Modified: hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java?rev=1310611&r1=1310610&r2=1310611&view=diff
==============================================================================
--- hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
(original)
+++ hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
Fri Apr  6 22:12:43 2012
@@ -534,6 +534,7 @@ public class SplitLogManager implements 
           version) == false) {
         LOG.debug("failed to resubmit task " + path +
             " version changed");
+        task.heartbeatNoDetails(EnvironmentEdgeManager.currentTimeMillis());
         return false;
       }
     } catch (NoNodeException e) {
@@ -541,6 +542,11 @@ public class SplitLogManager implements 
           " task done (or forced done by removing the znode)");
       getDataSetWatchSuccess(path, null, Integer.MIN_VALUE);
       return false;
+    } catch (KeeperException.BadVersionException e) {
+      LOG.debug("failed to resubmit task " + path +
+          " version changed");
+      task.heartbeatNoDetails(EnvironmentEdgeManager.currentTimeMillis());
+      return false;
     } catch (KeeperException e) {
       tot_mgr_resubmit_failed.incrementAndGet();
       LOG.warn("failed to resubmit " + path, e);
@@ -726,7 +732,12 @@ public class SplitLogManager implements 
   }
 
   private void nodeDataChanged(String path) {
-    if (tasks.get(path) != null || ZKSplitLog.isRescanNode(watcher, path)) {
+    Task task;
+    task = tasks.get(path);
+    if (task != null || ZKSplitLog.isRescanNode(watcher, path)) {
+      if (task != null) {
+        task.heartbeatNoDetails(EnvironmentEdgeManager.currentTimeMillis());
+      }
       getDataSetWatch(path, zkretries);
     }
   }
@@ -821,7 +832,11 @@ public class SplitLogManager implements 
     }
 
     public boolean isUnassigned() {
-      return (last_update == -1);
+      return (cur_worker_name == null);
+    }
+
+    public void heartbeatNoDetails(long time) {
+      last_update = time;
     }
 
     public void heartbeat(long time, int version, String worker) {



Mime
View raw message