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

Stephen Yuan Jiang commented on HBASE-16532:
--------------------------------------------

I have no problem for this patch to go in.  By the way, is it possible that 1.x 
ServerCrashProcedure upgrade to later version and hit this check?

However, I think we probably should improve in this part of code.  Today, (1). 
we have to repeat the setOwner code 
{{this.setOwner(env.getRequestUser().getShortName());}} in ALL procedure 
constructor; and (2) we have to store {{required UserInformation user_info = 
1;}} in all procedures that run coprocessor inside procedure (those repeated 
{{this.user = env.getRequestUser();}}, 
{{.setUserInfo(MasterProcedureUtil.toProtoUserInfo(this.user))}}, {{user = 
MasterProcedureUtil.toUserInfo(state.getUserInfo());}} code)
- code duplication is one major problem for software development, the 2 JIRAs 
mentioned in this JIRA shows that :-( 

My suggestion is to simplify this: instead of all those duplicate code, in 
{{ProcedureExecutor<TEnvironment>}} class, we should set procedure owner 
information in {{submitProcedure()}}.  Therefore, we put code in one place and 
there is no need to duplicate or maybe forget to duplicate these logic in the 
future.  (note: upgrade might be a problem if we removes user_info in protobuf)


> Procedure-V2: Enforce procedure ownership at construction
> ---------------------------------------------------------
>
>                 Key: HBASE-16532
>                 URL: https://issues.apache.org/jira/browse/HBASE-16532
>             Project: HBase
>          Issue Type: Bug
>          Components: proc-v2
>            Reporter: Ted Yu
>            Assignee: Ted Yu
>         Attachments: 16532.v1.txt, 16532.v2.txt, 16532.v3.txt
>
>
> HBASE-16520 (for TableBackupProcedure) and HBASE-16528 (for 
> ServerCrashProcedure) were two recent JIRAs where procedure ownership is set 
> at time of construction.
> This JIRA continues the discussion toward the end of HBASE-16520.
> Proposal is to enforce procedure ownership for all the procedures.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to