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

Remove extra RegionCoprocessor preClose() in RSRpcServices#closeRegion

    XMLWordPrintableJSON

Details

    Description

      The preClose() region coprocessor call gets called 3 times via rpc.

      The first one is when we receive the RPC
      https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java#L1329

      The second time is when ask the RS to close the region
      https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java#L2852

      The third time is when the doClose() on the region is executed.
      https://github.com/apache/hbase/blob/master/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java#L1419

      I'm pretty sure the first one can be removed since, there is no code between that and the second call. and they are a copy-paste.

      The second one explicitly says that is to enforce ACLs before starting the operation, which leads me to the fact that the 3rd one in the region gets executed too late in the process. but the region.close() may be called by someone other than the RS, so we should probably leave the preClose() in there (e.g. OpenRegionHandler on failure cleanup).

      any idea?

      Attachments

        1. HBASE-15746.v1-master.patch
          2 kB
          Stephen Yuan Jiang

        Issue Links

          Activity

            People

              syuanjiang Stephen Yuan Jiang
              mbertozzi Matteo Bertozzi
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: