You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Prakash Khemani (JIRA)" <ji...@apache.org> on 2011/04/29 01:32:03 UTC

[jira] [Created] (HBASE-3828) region server stuck in waitOnAllRegionsToClose

region server stuck in waitOnAllRegionsToClose
----------------------------------------------

                 Key: HBASE-3828
                 URL: https://issues.apache.org/jira/browse/HBASE-3828
             Project: HBase
          Issue Type: Bug
            Reporter: Prakash Khemani




--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3828) region server stuck in waitOnAllRegionsToClose

Posted by "Lars Hofhansl (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13448964#comment-13448964 ] 

Lars Hofhansl commented on HBASE-3828:
--------------------------------------

I assume with all the recent work this has been fixed.
@Ram, @Stack: Would you agree with that? If so, we can just close this.
                
> region server stuck in waitOnAllRegionsToClose
> ----------------------------------------------
>
>                 Key: HBASE-3828
>                 URL: https://issues.apache.org/jira/browse/HBASE-3828
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Prakash Khemani
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3828) region server stuck in waitOnAllRegionsToClose

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13029461#comment-13029461 ] 

stack commented on HBASE-3828:
------------------------------

Just to say that we did have a prob. in the past where an open came in after the RS had started its shutdown holding up its exit.  We thought we'd fixed it though.

I notice in the master open handler that post open, we'll do a check if in actuality, the region should be closed; e.g. if the the table was disabled between receipt of the open and its completion on master.  Should we do similiar over in the regionserver open handler; before leaving the handler, check the abort/stopped flag and if set, close the region?

> region server stuck in waitOnAllRegionsToClose
> ----------------------------------------------
>
>                 Key: HBASE-3828
>                 URL: https://issues.apache.org/jira/browse/HBASE-3828
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Prakash Khemani
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3828) region server stuck in waitOnAllRegionsToClose

Posted by "Prakash Khemani (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13026776#comment-13026776 ] 

Prakash Khemani commented on HBASE-3828:
----------------------------------------

The regionserver is not able to exit because the rs thread is stuck here

"regionserver60020" prio=10 tid=0x00002ab2b039e000 nid=0x760a waiting on condition [0x000000004365e000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
at org.apache.hadoop.hbase.util.Threads.sleep(Threads.java:126)
at org.apache.hadoop.hbase.regionserver.HRegionServer.waitOnAllRegionsToClose(HRegionServer.java:736)
at org.apache.hadoop.hbase.regionserver.HRegionServer.run(HRegionServer.java:689)
at java.lang.Thread.run(Thread.java:619)


This has happened a few times in my cluster.

===
In OpenRegionHandler

  @Override
  public void process() throws IOException {
    final String name = regionInfo.getRegionNameAsString();
    LOG.debug("Processing open of " + name);
    if (this.server.isStopped() || this.rsServices.isStopping()) {
      LOG.info("Server stopping or stopped, skipping open of " + name);
      return;
    }

Is the above check sufficient to prevent a region from being opened when the rs is stopping/aborting ... no right? A lock.readLock.lock() has to be acquired ... or shouldn't these guys do a startRegionOperation() as well?


===

Also in close region handler there is this code

    int expectedVersion = FAILED;
    if (this.zk) {
      expectedVersion = setClosingState();
      if (expectedVersion == FAILED) return;
    }

This should remove from onlineRegions() before returning?


> region server stuck in waitOnAllRegionsToClose
> ----------------------------------------------
>
>                 Key: HBASE-3828
>                 URL: https://issues.apache.org/jira/browse/HBASE-3828
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Prakash Khemani
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (HBASE-3828) region server stuck in waitOnAllRegionsToClose

Posted by "stack (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-3828?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

stack resolved HBASE-3828.
--------------------------

    Resolution: Incomplete

Resolving as 'Incomplete'.  Lets wait till we run into a stuck issue that is other than because of mod'd code.
                
> region server stuck in waitOnAllRegionsToClose
> ----------------------------------------------
>
>                 Key: HBASE-3828
>                 URL: https://issues.apache.org/jira/browse/HBASE-3828
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Prakash Khemani
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3828) region server stuck in waitOnAllRegionsToClose

Posted by "stack (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13029036#comment-13029036 ] 

stack commented on HBASE-3828:
------------------------------

What you thinking Prakash?  I see that stopped is volatile in HRS but stopping is not.  You think getting a read lock makes sense on open (or startRegionOperation?  The latter seems to be looking at closing flags only... if we're not open yet, looking at closing flags won't help?  Or am I reading this wrong?).

On the failed expectedVersion, yes, I think that makes sense -- but we should probably try and run through the close code anyways w/o updating zk?

> region server stuck in waitOnAllRegionsToClose
> ----------------------------------------------
>
>                 Key: HBASE-3828
>                 URL: https://issues.apache.org/jira/browse/HBASE-3828
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Prakash Khemani
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (HBASE-3828) region server stuck in waitOnAllRegionsToClose

Posted by "Prakash Khemani (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-3828?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13029452#comment-13029452 ] 

Prakash Khemani commented on HBASE-3828:
----------------------------------------

In my cluster this turned out to be a problem in code that we had modified internally. In the region server abort code path we had put in a check that if filesystem is unavailable then do not try to close regions. But the main thread anyway went ahead and waited for the regions to close. That was causing the hang in waitOnAllRegionsToClose(). (aside - there is an internal task on this ... when append to HLog fails, hbase relies on dfsclient to close the filesystem for the regionserver abort to be triggered. That is very roundabout and there ought to be more direct and synchronous abort facility)

==

It is possible that there is no further synchronization necessary when a region is being opened. But I haven't looked at the code closely enough. What happens between the time when zk node is closed and the region is actually closed on the rs? When is the region removed fron onlineRegions - is it possible that one thread adds it and the other immediately removes it  ... I will try and spend some time on it this soon.

===



> region server stuck in waitOnAllRegionsToClose
> ----------------------------------------------
>
>                 Key: HBASE-3828
>                 URL: https://issues.apache.org/jira/browse/HBASE-3828
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Prakash Khemani
>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira