hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Purtell (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-7992) provide pre/post region offline hooks for HMaster.offlineRegion().
Date Tue, 12 Mar 2013 21:41:13 GMT

    [ https://issues.apache.org/jira/browse/HBASE-7992?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13600513#comment-13600513
] 

Andrew Purtell commented on HBASE-7992:
---------------------------------------

The patch looks ok. The one concern I have is regarding here:

{noformat}
Index: hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
===================================================================
--- hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java	(revision 1454661)
+++ hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java	(working copy)
@@ -2263,17 +2263,25 @@
       LOG.warn("moveRegion specifier type: expected: " + RegionSpecifierType.REGION_NAME
         + " actual: " + type);
     }
-
+    OfflineRegionResponse orr = OfflineRegionResponse.newBuilder().build();
     try {
       Pair<HRegionInfo, ServerName> pair =
         MetaReader.getRegion(this.catalogTracker, regionName);
       if (pair == null) throw new UnknownRegionException(Bytes.toStringBinary(regionName));
       HRegionInfo hri = pair.getFirst();
+      if (cpHost != null) {
+        if (cpHost.preRegionOffline(hri)) {
+          return orr;
+        }
+      }
       this.assignmentManager.regionOffline(hri);
+      if (cpHost != null) {
+        cpHost.postRegionOffline(hri);
+      }
     } catch (IOException ioe) {
       throw new ServiceException(ioe);
     }
-    return OfflineRegionResponse.newBuilder().build();
+    return orr;
   }
 
   @Override
{noformat}

So if a coprocessor calls bypass() then the OfflineRegionResponse response is returned even
though the action is not taken. Should the CP be able to modify the response? Should there
be a flag in the response that says the action was not taken? (Understood that in the access
denied case an ADE will be thrown.)
                
> provide pre/post region offline hooks for HMaster.offlineRegion(). 
> -------------------------------------------------------------------
>
>                 Key: HBASE-7992
>                 URL: https://issues.apache.org/jira/browse/HBASE-7992
>             Project: HBase
>          Issue Type: Bug
>          Components: Coprocessors
>    Affects Versions: 0.95.0
>            Reporter: rajeshbabu
>            Assignee: rajeshbabu
>             Fix For: 0.98.0
>
>         Attachments: HBASE-7992_trunk.patch
>
>
> presently no hooks to provide access control to offline region in master.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message