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

The region flush request disappeared from flushQueue

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.98.23, 1.2.4, 2.0.0
    • 1.4.0, 2.0.0
    • None
    • None
    • Reviewed

    Description

      Region has too many store files delaying flush up to blockingWaitTime ms, and the region flush request is requeued into the flushQueue.

      When the region flush request is requeued into the flushQueue frequently, the request is inexplicably disappeared sometimes.

      But regionsInQueue still contains the information of the region request, which leads to new flush request can not be inserted into the flushQueue.
      Then, the region will not do flush anymore.

      In order to locate the problem, I added a lot of log in the code.

      MemStoreFlusher.java
      private boolean flushRegion(final HRegion region, final boolean emergencyFlush) {
      long startTime = 0;
      synchronized (this.regionsInQueue) {
        FlushRegionEntry fqe = this.regionsInQueue.remove(region);
        // Use the start time of the FlushRegionEntry if available
        if (fqe != null) {
      	startTime = fqe.createTime;
        }
        if (fqe != null && emergencyFlush) {
      	// Need to remove from region from delay queue.  When NOT an
      	// emergencyFlush, then item was removed via a flushQueue.poll.
      	flushQueue.remove(fqe);
       }
      }
      

      When encountered emergencyFlush, the region flusher will be removed from the flushQueue.

      By comparing the flushQueue content before and after remove, RegionA should have been removed, it is possible to remove RegionB.

      MemStoreFlusher.java
      public boolean equals(Object obj) {
        if (this == obj) {
      	return true;
        }
        if (obj == null || getClass() != obj.getClass()) {
      	return false;
        }
        Delayed other = (Delayed) obj;
        return compareTo(other) == 0;
      }
      

      FlushRegionEntry in achieving the equals function, only comparison of the delay time, if different regions of the same delay time, it is possible that A wrong B.

      Attachments

        1. HBASE-17302-branch-1.2-v1.patch
          0.9 kB
          Guangxu Cheng
        2. HBASE-17302-branch-1-addendum.patch
          0.9 kB
          Guangxu Cheng
        3. HBASE-17302-branch-1-addendum-v1.patch
          0.9 kB
          Guangxu Cheng
        4. HBASE-17302-branch-master-v1.patch
          0.9 kB
          Guangxu Cheng
        5. HBASE-17302-master-addendum.patch
          0.9 kB
          Guangxu Cheng
        6. HBASE-17302-master-addendum-v1.patch
          0.9 kB
          Guangxu Cheng

        Activity

          People

            gxcheng Guangxu Cheng
            gxcheng Guangxu Cheng
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: