Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 8E01D1722C for ; Mon, 27 Apr 2015 21:58:59 +0000 (UTC) Received: (qmail 89936 invoked by uid 500); 27 Apr 2015 21:58:59 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 89839 invoked by uid 500); 27 Apr 2015 21:58:59 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 89703 invoked by uid 99); 27 Apr 2015 21:58:59 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2015 21:58:59 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 0905DE17E4; Mon, 27 Apr 2015 21:58:59 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: elserj@apache.org To: commits@accumulo.apache.org Date: Mon, 27 Apr 2015 21:58:59 -0000 Message-Id: In-Reply-To: <1ff51bfd78d548889347b113a87c651b@git.apache.org> References: <1ff51bfd78d548889347b113a87c651b@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [2/6] accumulo git commit: ACCUMULO-3750 Exit the Master if NoAuthException ACCUMULO-3750 Exit the Master if NoAuthException If the Master gets a NoAuthException trying to get its lock, there's a configuration issue. Bail out immediately. Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/bc87145a Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/bc87145a Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/bc87145a Branch: refs/heads/1.7 Commit: bc87145ad54ac9912ce8bb878e231ef8dd7bad6a Parents: 0bcbab7 Author: Josh Elser Authored: Mon Apr 27 17:52:06 2015 -0400 Committer: Josh Elser Committed: Mon Apr 27 17:53:24 2015 -0400 ---------------------------------------------------------------------- .../src/main/java/org/apache/accumulo/master/Master.java | 7 +++++++ 1 file changed, 7 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/bc87145a/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 5a96abc..b3d2ac5 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 @@ -129,6 +129,7 @@ import org.apache.thrift.TException; import org.apache.thrift.server.TServer; import org.apache.thrift.transport.TTransportException; import org.apache.zookeeper.KeeperException; +import org.apache.zookeeper.KeeperException.NoAuthException; import org.apache.zookeeper.WatchedEvent; import org.apache.zookeeper.Watcher; import org.apache.zookeeper.data.Stat; @@ -1104,6 +1105,12 @@ public class Master implements LiveTServerSet.Listener, TableObserver, CurrentSt public synchronized void failedToAcquireLock(Exception e) { log.warn("Failed to get master lock " + e); + if (e instanceof NoAuthException) { + String msg = "Failed to acquire master lock due to incorrect ZooKeeper authentication."; + log.error(msg + " Ensure instance.secret is consistent across Accumulo configuration", e); + Halt.halt(msg, -1); + } + if (acquiredLock) { Halt.halt("Zoolock in unexpected state FAL " + acquiredLock + " " + failedToAcquireLock, -1); }