Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B97709C39 for ; Tue, 14 Feb 2012 19:36:25 +0000 (UTC) Received: (qmail 44106 invoked by uid 500); 14 Feb 2012 19:36:25 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 44058 invoked by uid 500); 14 Feb 2012 19:36:25 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 44050 invoked by uid 99); 14 Feb 2012 19:36:25 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Feb 2012 19:36:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Feb 2012 19:36:22 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id C47AF1B7B84 for ; Tue, 14 Feb 2012 19:36:00 +0000 (UTC) Date: Tue, 14 Feb 2012 19:36:00 +0000 (UTC) From: "jiraposter@reviews.apache.org (Commented) (JIRA)" To: issues@hbase.apache.org Message-ID: <1224594128.37569.1329248160806.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <127858397.45350.1326736780610.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (HBASE-5209) HConnection/HMasterInterface should allow for way to get hostname of currently active master in multi-master HBase setup MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HBASE-5209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13207940#comment-13207940 ] jiraposter@reviews.apache.org commented on HBASE-5209: ------------------------------------------------------ bq. On 2012-02-14 19:01:02, Michael Stack wrote: bq. > src/main/java/org/apache/hadoop/hbase/ClusterStatus.java, line 278 bq. > bq. > bq. > Isn't this Writable versioned? Should you up the version since you've added fields and check the version when deserializing (if you get a previous version, don't try and derserialize master and backupmasters) bq. bq. David Wang wrote: bq. I took the lead from your commit at SHA b8b142a9e10aa729e0c0d4560035b1bdc4a0bd5c, where you bumped VERSION, and I didn't notice any special handling about checking for previous versions. I can easily add that if necessary, though since I am adding to the end of the Writable, do I need to? Yeah, that commit should have upped the version too... (I think this is the commit that added it): commit 65e23155db94d4b3f36c35e90089f5827dea549b Author: Andrew Kyle Purtell Date: Mon Oct 24 23:18:04 2011 +0000 HBASE-4070 Improve region server metrics to report loaded coprocessors to master git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1188442 13f79535-47bb-0310-9956-ffa450edef68 bq. On 2012-02-14 19:01:02, Michael Stack wrote: bq. > src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java, line 182 bq. > bq. > bq. > You don't think this setStatus needed anymore? bq. bq. David Wang wrote: bq. Actually, this is still being called. I just pulled out the setStatus() and Log.info() calls since they apply to all three of the cases in this block. Now the three cases in this block are just setting msg. Ok. Good. bq. On 2012-02-14 19:01:02, Michael Stack wrote: bq. > src/main/java/org/apache/hadoop/hbase/master/HMaster.java, line 1393 bq. > bq. > bq. > List is a Collection. Why convert to a Set? Is it needed? bq. > bq. > If you have to do the convertion, use http://docs.oracle.com/javase/1.5.0/docs/api/java/util/Collections.html#addAll(java.util.Collection, T...) instead? bq. bq. David Wang wrote: bq. I used Set instead of List because I figured backupMasters is very similar in concept to deadServers, which is an instance of DeadServer that uses Set. bq. bq. Also, List is ordered while Set is not. And I don't think backupMasters or deadServers are meant to be ordered. Not that important I'd say. Just do List I'd say. - Michael ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/3892/#review5088 ----------------------------------------------------------- On 2012-02-14 18:50:54, David Wang wrote: bq. bq. ----------------------------------------------------------- bq. This is an automatically generated e-mail. To reply, visit: bq. https://reviews.apache.org/r/3892/ bq. ----------------------------------------------------------- bq. bq. (Updated 2012-02-14 18:50:54) bq. bq. bq. Review request for hbase. bq. bq. bq. Summary bq. ------- bq. bq. Problem: bq. There is no method in the HBase client-facing APIs to determine which of the masters is currently active. This can be especially useful in setups with multiple backup masters. bq. bq. Solution: bq. Augment ClusterStatus to return the currently active master and the list of backup masters. bq. bq. Notes: bq. * I uncovered a race condition in ActiveMasterManager, between when it determines that it did not win the original race to be the active master, and when it reads the ServerName of the active master. If the active master goes down in that time, the read to determine the active master's ServerName will fail ungracefully and the candidate master will abort. The solution incorporated in this patch is to check to see if the read of the ServerName succeeded before trying to use it. bq. * I fixed some minor formatting issues while going through the code. I can take these changes out if it is considered improper to commit such non-related changes with the main changes. bq. bq. bq. This addresses bug HBASE-5209. bq. https://issues.apache.org/jira/browse/HBASE-5209 bq. bq. bq. Diffs bq. ----- bq. bq. src/main/java/org/apache/hadoop/hbase/ClusterStatus.java b849429 bq. src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java 2f60b23 bq. src/main/java/org/apache/hadoop/hbase/master/HMaster.java 9d21903 bq. src/main/java/org/apache/hadoop/hbase/util/HBaseFsck.java f6f3f71 bq. src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java 111f76e bq. src/main/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWatcher.java 3e3d131 bq. src/test/java/org/apache/hadoop/hbase/master/TestActiveMasterManager.java 16e4744 bq. src/test/java/org/apache/hadoop/hbase/master/TestMasterFailover.java bc98fb0 bq. bq. Diff: https://reviews.apache.org/r/3892/diff bq. bq. bq. Testing bq. ------- bq. bq. * Ran mvn -P localTests test multiple times - no new tests fail bq. * Ran mvn -P localTests -Dtest=TestActiveMasterManager test multiple runs - no failures bq. * Ran mvn -P localTests -Dtest=TestMasterFailover test multiple runs - no failures bq. * Started active and multiple backup masters, then killed active master, then brought it back up (will now be a backup master) bq. * Did the following before and after killing bq. * hbase fsck - checked output to see that active and backup masters are reported properly bq. * zk_dump - checked that active and backup masters are reported properly bq. * Started cluster with no backup masters to make sure change operates correctly that way bq. * Ran dev-support/test-patch.sh - no new issues fail: bq. bq. -1 overall. bq. bq. +1 @author. The patch does not contain any @author tags. bq. bq. +1 tests included. The patch appears to include 7 new or modified tests. bq. bq. -1 javadoc. The javadoc tool appears to have generated -136 warning messages. bq. bq. +1 javac. The applied patch does not increase the total number of javac compiler warnings. bq. bq. +1 findbugs. The patch does not introduce any new Findbugs (version ) warnings. bq. bq. +1 release audit. The applied patch does not increase the total number of release audit warnings. bq. bq. bq. Thanks, bq. bq. David bq. bq. > HConnection/HMasterInterface should allow for way to get hostname of currently active master in multi-master HBase setup > ------------------------------------------------------------------------------------------------------------------------ > > Key: HBASE-5209 > URL: https://issues.apache.org/jira/browse/HBASE-5209 > Project: HBase > Issue Type: Improvement > Components: master > Affects Versions: 0.94.0, 0.90.5, 0.92.0 > Reporter: Aditya Acharya > Assignee: David S. Wang > Fix For: 0.94.0, 0.90.7, 0.92.1 > > Attachments: HBASE-5209-v0.diff, HBASE-5209-v1.diff > > > I have a multi-master HBase set up, and I'm trying to programmatically determine which of the masters is currently active. But the API does not allow me to do this. There is a getMaster() method in the HConnection class, but it returns an HMasterInterface, whose methods do not allow me to find out which master won the last race. The API should have a getActiveMasterHostname() or something to that effect. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira