You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Allan Yang (JIRA)" <ji...@apache.org> on 2018/07/12 04:06:00 UTC

[jira] [Commented] (HBASE-20679) Add the ability to compile JSP dynamically in Jetty

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

Allan Yang commented on HBASE-20679:
------------------------------------

[~stack], are we still need this? Today, I use this trick fix the RIT regions again in our test env. The Procedure wal is Corrupted with no reason.  
{quote}
2018-07-12 10:11:01,082 ERROR [master/test-sy-vpc-219-002:16000] procedure2.ProcedureExecutor(327): Corrupt pid=362, ppid=333, state=RUNNABLE:REGION_TRANSITION_DISPATCH; UnassignProcedure table=h, regi
on=b3f59c4fb17d0b5a4836479e931d5640, server=test-sy-vpc-219-004.hbase.9b78df04-b.rds.aliyuncs.com,16020,1529657866452
{quote}

> Add the ability to compile JSP dynamically in Jetty
> ---------------------------------------------------
>
>                 Key: HBASE-20679
>                 URL: https://issues.apache.org/jira/browse/HBASE-20679
>             Project: HBase
>          Issue Type: New Feature
>    Affects Versions: 2.0.0
>            Reporter: Allan Yang
>            Assignee: Allan Yang
>            Priority: Major
>             Fix For: 3.0.0
>
>         Attachments: HBASE-20679.002.patch, HBASE-20679.003.patch, HBASE-20679.004.patch, HBASE-20679.005.patch, HBASE-20679.patch
>
>
> As discussed in HBASE-20617, adding the ability to dynamically compile jsp enable us to do some hot fix. 
>  For example, several days ago, in our testing HBase-2.0 cluster, procedureWals were corrupted due to some unknown reasons. After restarting the cluster, since some procedures(AssignProcedure for example) were corrupted and couldn't be replayed. Some regions were stuck in RIT forever. We couldn't use HBCK since it haven't support AssignmentV2 yet. As a matter of fact, the namespace region was not online, so the master was not inited, we even couldn't use shell command like assign/move. But, we wrote a jsp and fix this issue easily. The jsp file is like this:
> {code:java}
> <%
>   String action = request.getParameter("action");
>   HMaster master = (HMaster)getServletContext().getAttribute(HMaster.MASTER);
>   List<RegionInfo> offlineRegionsToAssign = new ArrayList<>();
>   List<RegionStates.RegionStateNode> regionRITs = master.getAssignmentManager()
>           .getRegionStates().getRegionsInTransition();
>   for (RegionStates.RegionStateNode regionStateNode :  regionRITs) {
>     // if regionStateNode don't have a procedure attached, but meta state shows
>     // this region is in RIT, that means the previous procedure may be corrupted
>     // we need to create a new assignProcedure to assign them
>     if (!regionStateNode.isInTransition()) {
>       offlineRegionsToAssign.add(regionStateNode.getRegionInfo());
>       out.println("RIT region:" + regionStateNode);
>     }
>   }
>   // Assign offline regions. Uses round-robin.
>   if ("fix".equals(action) && offlineRegionsToAssign.size() > 0) {
>     master.getMasterProcedureExecutor().submitProcedures(master.getAssignmentManager().
>             createRoundRobinAssignProcedures(offlineRegionsToAssign));
>   } else {
>     out.println("use ?action=fix to fix RIT regions");
>   }
> %>
> {code}
> Above it is only one example we can do if we have the ability to compile jsp dynamically. We think it is very useful.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)