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

Avoid waiting to clear buffer usage of ReplicationSourceShipper when aborting the RS

    XMLWordPrintableJSON

Details

    • Reviewed

    Description

      HBASE-24813 introduced the clear of buffer used in replication source shipper, but there is sleep in the method, if the variable sleepForRetries has a large value, and there are many wal groups, the aborting of RS may last a long time, but we should only do some necessary things in the aborting progress.

      void clearWALEntryBatch() {
        long timeout = System.currentTimeMillis() + this.shipEditsTimeout;
        while(this.isAlive() || this.entryReader.isAlive()){
          try {
            if (System.currentTimeMillis() >= timeout) {
              LOG.warn("Shipper clearWALEntryBatch method timed out whilst waiting reader/shipper "
                + "thread to stop. Not cleaning buffer usage. Shipper alive: {}; Reader alive: {}",
                this.source.getPeerId(), this.isAlive(), this.entryReader.isAlive());
              return;
            } else {
              // Wait both shipper and reader threads to stop
              Thread.sleep(this.sleepForRetries);
            }
          } catch (InterruptedException e) {
            LOG.warn("{} Interrupted while waiting {} to stop on clearWALEntryBatch. "
                + "Not cleaning buffer usage: {}", this.source.getPeerId(), this.getName(), e);
            return;
          }
        }
      ...... 

      Attachments

        Issue Links

          Activity

            People

              Xiaolin Ha Xiaolin Ha
              Xiaolin Ha Xiaolin Ha
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: