Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-4283

HBaseAdmin never recovers from restarted cluster

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.92.0
    • 0.92.0
    • Client
    • None
    • Reviewed

    Description

      While testing common scenarios that we might encounter I found that HBaseAdmin does not recover from a restarted cluster.

      It turns out HBaseClient.Connection.stop() is send into an endless loop here:

          // wait until all connections are closed
          while (!connections.isEmpty()) {
            try {
              Thread.sleep(100);
            } catch (InterruptedException ignored) {
            }
          }
      

      The reason is that PoolMap.remove(k,v) does not remove empty pools, and hence connections.isEmpty() is never true if there ever was any connection in there.
      My fix is to remove the pool from the poolMap when it is empty. (Alternatively one could change PoolMap.isEmpty() to also look inside of all pools and see if their size is 0).

      When I fixed that I noticed that if the master wasn't running when HBaseAdmin is created it also will not recover from that.
      Even creating a new HBaseAdmin from the same Configuration will still use the old stale HConnection.

      In that case a MasterNotRunningException is thrown, which is not handled in HBaseAdmin's constructor.

      The HConnection handling in HConnectionManager is funky. There should never be a closed connection in the HBASE_INSTANCES.
      I might look at that as well but in a separate issue.

      Attachments

        1. HBasePing.java
          0.5 kB
          Lars Hofhansl
        2. 4283.txt
          1 kB
          Lars Hofhansl

        Issue Links

          Activity

            People

              larsh Lars Hofhansl
              larsh Lars Hofhansl
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: