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

Improve insight into replication WAL readers hung on checkQuota

    XMLWordPrintableJSON

Details

    • Task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.0.0-alpha-1, 2.4.0
    • Replication
    • None
    • Reviewed
    • Hide
      New metrics are exposed, on the global source, for replication which indicate the "WAL entry buffer" that was introduced in HBASE-15995. When this usage reaches the limit, that RegionServer will cease to read more data for the sake of trying to replicate it. This usage (and limit) is local to each RegionServer is shared across all peers being handled by that RegionServer.
      Show
      New metrics are exposed, on the global source, for replication which indicate the "WAL entry buffer" that was introduced in HBASE-15995 . When this usage reaches the limit, that RegionServer will cease to read more data for the sake of trying to replicate it. This usage (and limit) is local to each RegionServer is shared across all peers being handled by that RegionServer.

    Description

      Helped a customer this past weekend who, with a large number of RegionServers, has some RegionServers which replicated data to a peer without issues while other RegionServers did not.

      The number of queue logs varied over the past 24hrs in the same manner. Some spikes in queued logs into 100's of logs, but other times, only 1's-10's of logs were queued.

      We were able to validate that there were "good" and "bad" RegionServers by creating a test table, assigning it to a regionserver, enabling replication on that table, and validating if the local puts were replicated to a peer. On a good RS, data was replicated immediately. On a bad RS, data was never replicated (at least, on the order of 10's of minutes which we waited).

      On the "bad RS", we were able to observe that the wal-reader thread(s) on that RS were spending time in a Thread.sleep() in a different location than the other. Specifically it was sitting in the ReplicationSourceWALReader#checkQuota()'s sleep call, not the handleEmptyWALBatch() method on the same class.

      My only assumption is that, somehow, these RegionServers got into a situation where they "allocated" memory from the quota but never freed it. Then, because the WAL reader thinks it has no free memory, it blocks indefinitely and there are no pending edits to ship and (thus) free that memory. A cursory glance at the code gives me a lot of anxiety around places where we don't properly clean it up (e.g. batches that fail to ship, dropping a peer). As a first stab, let me add some more debugging so we can actually track this state properly for the operators and their sanity.

      Attachments

        Issue Links

          Activity

            People

              elserj Josh Elser
              elserj Josh Elser
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: