Repository: accumulo Updated Branches: refs/heads/1.6 343b7359b -> b2f7e93cf
ACCUMULO-2696 clairifed error messages in master for balancing and state change. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/c7c616e4 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/c7c616e4 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/c7c616e4 Branch: refs/heads/1.6 Commit: c7c616e445dfba50cfa3eeccf25fa8cdb4435d37 Parents: 343b735 Author: Ed Coleman <d...@etcoleman.com> Authored: Mon Jan 26 16:30:14 2015 -0500 Committer: Eric C. Newton <eric.new...@gmail.com> Committed: Tue Jan 27 15:48:31 2015 -0500 ---------------------------------------------------------------------- .../main/java/org/apache/accumulo/master/Master.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/c7c616e4/server/master/src/main/java/org/apache/accumulo/master/Master.java ---------------------------------------------------------------------- diff --git a/server/master/src/main/java/org/apache/accumulo/master/Master.java b/server/master/src/main/java/org/apache/accumulo/master/Master.java index 168c270..982b647 100644 --- a/server/master/src/main/java/org/apache/accumulo/master/Master.java +++ b/server/master/src/main/java/org/apache/accumulo/master/Master.java @@ -602,7 +602,7 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt byte[] data = ZooReaderWriter.getInstance().getData(ZooUtil.getRoot(instance) + Constants.ZMASTER_GOAL_STATE, null); return MasterGoalState.valueOf(new String(data)); } catch (Exception e) { - log.error("Problem getting real goal state: " + e); + log.error("Problem getting real goal state from zookeeper: " + e); UtilWaitThread.sleep(1000); } } @@ -801,14 +801,14 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt if (count == 0) setMasterState(MasterState.UNLOAD_METADATA_TABLETS); } - break; + break; case UNLOAD_METADATA_TABLETS: { int count = assignedOrHosted(METADATA_TABLE_ID); log.debug(String.format("There are %d metadata tablets assigned or hosted", count)); if (count == 0) setMasterState(MasterState.UNLOAD_ROOT_TABLET); } - break; + break; case UNLOAD_ROOT_TABLET: { int count = assignedOrHosted(METADATA_TABLE_ID); if (count > 0) { @@ -835,15 +835,20 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt setMasterState(MasterState.STOP); } } - break; + break; default: break; } } + }catch(Throwable t) { + log.error("Error occurred reading / switching master goal state. Will continue with attempt to update status", t); + } + + try { wait = updateStatus(); eventListener.waitForEvents(wait); } catch (Throwable t) { - log.error("Error balancing tablets", t); + log.error("Error balancing tablets, will wait for " + WAIT_BETWEEN_ERRORS / ONE_SECOND + " (seconds) and then retry", t); UtilWaitThread.sleep(WAIT_BETWEEN_ERRORS); } }