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

AssignmentManager#waitForAssignment could have unexpected negative deadline

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0, 1.2.2, 1.1.6, 2.0.0
    • None
    • None
    • Reviewed

    Description

      AssignmentManager#waitForAssignment(HRegionInfo regionInfo) passes Long.MAX_VALUE deadline and intends to wait forever. However, the deadline would be overflowed from AssignmentManager#waitForAssignment(final Collection<HRegionInfo> regionSet, final boolean waitTillAllAssigned, final int reassigningRegions, final long minEndTime), which would cause no wait!

        /**
         * Waits until the specified region has completed assignment.
         * <p>
         * If the region is already assigned, returns immediately.  Otherwise, method
         * blocks until the region is assigned.
         * @param regionInfo region to wait on assignment for
         * @return true if the region is assigned false otherwise.
         * @throws InterruptedException
         */
        public boolean waitForAssignment(HRegionInfo regionInfo)
            throws InterruptedException {
          ArrayList<HRegionInfo> regionSet = new ArrayList<HRegionInfo>(1);
          regionSet.add(regionInfo);
          return waitForAssignment(regionSet, true, Long.MAX_VALUE);
        }
      
        /**
         * Waits until the specified region has completed assignment, or the deadline is reached.
         */
        protected boolean waitForAssignment(final Collection<HRegionInfo> regionSet,
            final boolean waitTillAllAssigned, final int reassigningRegions,
            final long minEndTime) throws InterruptedException {
          long deadline = minEndTime + bulkPerRegionOpenTimeGuesstimate * (reassigningRegions + 1);  // ----> OVERFLOW
          return waitForAssignment(regionSet, waitTillAllAssigned, deadline);
        }
      

      Attachments

        1. HBase-16016.v1-master.patch
          0.8 kB
          Stephen Yuan Jiang

        Activity

          People

            syuanjiang Stephen Yuan Jiang
            syuanjiang Stephen Yuan Jiang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: