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

HMaster.move() should throw exception if region to move is not online

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.2
    • Fix Version/s: 1.4.0, 0.98.24
    • Component/s: Admin
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      The move region function in HMaster only checks whether the region to move exists

      if (regionState == null) {
            throw new UnknownRegionException(Bytes.toStringBinary(encodedRegionName));
          }
      
      

      It will not return anything if the region is split or in transition which is not movable. So the caller has no way to know if the move region operation is failed.
      It is a problem for "region_move.rb". It only gives up moving a region if a exception is thrown.Otherwise, it will wait until a timeout and retry. Without a exception, it have no idea the region is not movable.

      begin
            admin.move(Bytes.toBytes(r.getEncodedName()), Bytes.toBytes(newServer))
          rescue java.lang.reflect.UndeclaredThrowableException,
              org.apache.hadoop.hbase.UnknownRegionException => e
            $LOG.info("Exception moving "  + r.getEncodedName() +
              "; split/moved? Continuing: " + e)
            return
          end
       # Wait till its up on new server before moving on
          maxWaitInSeconds = admin.getConfiguration.getInt("hbase.move.wait.max", 60)
          maxWait = Time.now + maxWaitInSeconds
          while Time.now < maxWait
            same = isSameServer(admin, r, original)
            break unless same
            sleep 0.1
          end
        end
      

        Attachments

        1. HBASE-16816-branch-1.patch
          0.9 kB
          Allan Yang
        2. HBASE-16816-branch-1-v2.patch
          2 kB
          Allan Yang
        3. HBASE-16816-branch-1-v3.patch
          2 kB
          Allan Yang

          Activity

            People

            • Assignee:
              allan163 Allan Yang
              Reporter:
              allan163 Allan Yang
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: