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

Optionally abort requests in progress after deciding a region should close

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-alpha-1, 1.7.0, 2.4.0
    • regionserver
    • None
    • Reviewed
    • Hide
      If hbase.regionserver.close.wait.abort is set to true, interrupt RPC handler threads holding the region close lock.

      Until requests in progress can be aborted, wait on the region close lock for a configurable interval (specified by hbase.regionserver.close.wait.time.ms, default 60000 (1 minute)). If we have failed to acquire the close lock after this interval elapses, if allowed (also specified by hbase.regionserver.close.wait.abort), abort the regionserver.

      We will attempt to interrupt any running handlers every hbase.regionserver.close.wait.interval.ms (default 10000 (10 seconds)) until either the close lock is acquired or we reach the maximum wait time.
      Show
      If hbase.regionserver.close.wait.abort is set to true, interrupt RPC handler threads holding the region close lock. Until requests in progress can be aborted, wait on the region close lock for a configurable interval (specified by hbase.regionserver.close.wait.time.ms, default 60000 (1 minute)). If we have failed to acquire the close lock after this interval elapses, if allowed (also specified by hbase.regionserver.close.wait.abort), abort the regionserver. We will attempt to interrupt any running handlers every hbase.regionserver.close.wait.interval.ms (default 10000 (10 seconds)) until either the close lock is acquired or we reach the maximum wait time.

    Description

      After deciding a region should be closed, the regionserver will set the internal region state to closing and wait for all pending requests to complete, via a rendezvous on the region lock. In closing state the region will not accept any new requests but requests in progress will be allowed to complete before the close action takes place. In our production we see outlier wait times on this lock in excess of several minutes.

      During close when there are requests in flight the regionserver is subject to any conceivable reason for delay, like full scans over large regions, expensive filtering hierarchies, bugs, or store level performance problems like slow HDFS. The regionserver should interrupt requests in progress to facilitate smaller/shorter close times on an opt-in basis.

      Optionally, via configuration parameter – which would be a system wide default set in hbase-site.xml in common practice but could be overridden in table schema for per table settings – interrupt requests in progress holding the region lock rather than wait for completion of all operations in flight. Send back NotServingRegionException("region is closing") to the clients of the interrupted operations, like we do after the write lock is acquired. The client will transparently relocate the region data and resubmit the aborted requests per normal retry policy. This can be less disruptive than waiting for very long times for a region to close in extreme outlier cases (e.g. 50 minutes). In such extreme cases it is better to abort the regionserver if the close lock cannot be acquired in a reasonable amount of time, because the region cannot be made available again until it has closed.

      After waiting for all requests to complete then we flush the region's memstore and finish the close. The flush portion of the close process is out of scope of this proposal. Under normal conditions the flush portion of the close completes quickly. It is specifically waits on the close lock that has been an occasional issue in our production that causes difficulty achieving 99.99% availability.

      Attachments

        Issue Links

          Activity

            People

              apurtell Andrew Kyle Purtell
              apurtell Andrew Kyle Purtell
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: