You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by mb...@apache.org on 2012/05/01 12:37:55 UTC
svn commit: r1332611 -
/hbase/branches/0.89-fb/src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
Author: mbautin
Date: Tue May 1 10:37:55 2012
New Revision: 1332611
URL: http://svn.apache.org/viewvc?rev=1332611&view=rev
Log:
[HBASE-5860][JIRA]splitlogmgr - do not resubmit when zk is unavailable
Summary: as in title
Test Plan:
will test on titanmigrate002 soon.
Correctness of the change should be simple to argue about
Reviewers: kannan, aaiyer
Reviewed By: kannan
CC: hbase-eng@
Differential Revision: https://phabricator.fb.com/D455436
Task ID: 1034868
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=1332611&r1=1332610&r2=1332611&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 Tue May 1 10:37:55 2012
@@ -924,7 +924,11 @@ public class SplitLogManager implements
LOG.info("resubmitted " + resubmitted + " out of " + tot + " tasks");
}
// If there are pending tasks and all of them have been unassigned for
- // some time then put up a RESCAN node to ping the workers.
+ // some time then put up a RESCAN node to ping the workers. (Skip this
+ // processing if znode create is pending. Creation of any znode has
+ // the same effect as creation of a RESCAN node. They both ping the
+ // workers to look for new tasks)
+ //
// ZKSplitlog.DEFAULT_UNASSIGNED_TIMEOUT is of the order of minutes
// because a. it is very unlikely that every worker had a
// transient error when trying to grab the task b. if there are no
@@ -934,7 +938,7 @@ public class SplitLogManager implements
// that there is always one worker in the system
if (tot > 0 && !found_assigned_task &&
((EnvironmentEdgeManager.currentTimeMillis() - lastNodeCreateTime) >
- unassignedTimeout)) {
+ unassignedTimeout) && !isAnyCreateZNodePending()) {
for (Map.Entry<String, Task> e : tasks.entrySet()) {
String path = e.getKey();
Task task = e.getValue();
@@ -992,6 +996,9 @@ public class SplitLogManager implements
}
}
+ static boolean isAnyCreateZNodePending() {
+ return tot_mgr_node_create_queued.get() > tot_mgr_node_create_result.get();
+ }
/**
* Asynchronous handler for zk get-data-set-watch on node results.
* Retries on failures.