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 67129C9B9 for ; Fri, 1 Jun 2012 17:46:24 +0000 (UTC) Received: (qmail 96377 invoked by uid 500); 1 Jun 2012 17:46:24 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 96297 invoked by uid 500); 1 Jun 2012 17:46:24 -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 96198 invoked by uid 99); 1 Jun 2012 17:46:24 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Jun 2012 17:46:24 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id C3A4B142862 for ; Fri, 1 Jun 2012 17:46:23 +0000 (UTC) Date: Fri, 1 Jun 2012 17:46:23 +0000 (UTC) From: "Zhihong Yu (JIRA)" To: issues@hbase.apache.org Message-ID: <1039938879.27500.1338572783803.JavaMail.jiratomcat@issues-vm> In-Reply-To: <1809290185.4265.1337626541081.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (HBASE-6060) Regions's in OPENING state from failed regionservers takes a long time to recover MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-6060?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13287561#comment-13287561 ] Zhihong Yu commented on HBASE-6060: ----------------------------------- I ran the tests in TestAssignmentManager and they passed. {code} synchronized (this.regionPlans) { + regionsOnDeadServer = new RegionsOnDeadServer(); + regionsFromRegionPlansForServer = new ConcurrentSkipListSet(); + this.deadServerRegionsFromRegionPlan.put(sn, regionsOnDeadServer); {code} Can the first two assignments be placed outside synchronized block ? Before making the deadServerRegionsFromRegionPlan.put() call, I think we should check that sn isn't currently in deadServerRegionsFromRegionPlan. For isRegionOnline(HRegionInfo hri): {code} + return true; + } else { + // Remove the assignment mapping for sn. + Set hriSet = this.servers.get(sn); + if (hriSet != null) { + hriSet.remove(hri); + } {code} The else keyword isn't needed. What if hriSet contains other regions apart from hri, should they be removed as well ? > Regions's in OPENING state from failed regionservers takes a long time to recover > --------------------------------------------------------------------------------- > > Key: HBASE-6060 > URL: https://issues.apache.org/jira/browse/HBASE-6060 > Project: HBase > Issue Type: Bug > Components: master, regionserver > Reporter: Enis Soztutar > Assignee: Enis Soztutar > Attachments: HBASE-6060-94.patch > > > we have seen a pattern in tests, that the regions are stuck in OPENING state for a very long time when the region server who is opening the region fails. My understanding of the process: > > - master calls rs to open the region. If rs is offline, a new plan is generated (a new rs is chosen). RegionState is set to PENDING_OPEN (only in master memory, zk still shows OFFLINE). See HRegionServer.openRegion(), HMaster.assign() > - RegionServer, starts opening a region, changes the state in znode. But that znode is not ephemeral. (see ZkAssign) > - Rs transitions zk node from OFFLINE to OPENING. See OpenRegionHandler.process() > - rs then opens the region, and changes znode from OPENING to OPENED > - when rs is killed between OPENING and OPENED states, then zk shows OPENING state, and the master just waits for rs to change the region state, but since rs is down, that wont happen. > - There is a AssignmentManager.TimeoutMonitor, which does exactly guard against these kind of conditions. It periodically checks (every 10 sec by default) the regions in transition to see whether they timedout (hbase.master.assignment.timeoutmonitor.timeout). Default timeout is 30 min, which explains what you and I are seeing. > - ServerShutdownHandler in Master does not reassign regions in OPENING state, although it handles other states. > Lowering that threshold from the configuration is one option, but still I think we can do better. > Will investigate more. -- 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