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

HRegionServer stops could be 0.5s faster

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.94.0
    • Fix Version/s: None
    • Component/s: regionserver, test
    • Labels:
      None
    • Environment:

      all

    • Hadoop Flags:
      Reviewed

      Description

      The current implementation of HRegionServer#stop is

        public void stop(final String msg) {
          this.stopped = true;
          LOG.info("STOPPED: " + msg);
          synchronized (this) {
            // Wakes run() if it is sleeping
            notifyAll(); // FindBugs NN_NAKED_NOTIFY
          }
        }
      

      The notification is sent on the wrong object and does nothing. As a consequence, the region server continues to sleep instead of waking up and stopping immediately. A correct implementation is:

        public void stop(final String msg) {
          this.stopped = true;
          LOG.info("STOPPED: " + msg);
          // Wakes run() if it is sleeping
          sleeper.skipSleepCycle();
        }
      

      Then the region server stops immediately. This makes the region server stops 0,5s faster on average, which is quite useful for unit tests.

      However, with this fix, TestRegionServerCoprocessorExceptionWithAbort does not work.
      It likely because the code does no expect the region server to stop that fast. See HBASE-4832

        Attachments

        1. 4833_trunk_hregionserver.patch
          0.7 kB
          Nicolas Liochon
        2. 4833_trunk_hregionserver.v2.patch
          0.7 kB
          Nicolas Liochon

          Issue Links

            Activity

              People

              • Assignee:
                nkeywal Nicolas Liochon
                Reporter:
                nkeywal Nicolas Liochon
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: