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

Josh Elser commented on HBASE-19953:
------------------------------------

[~allan163], I understand the RPC timeout issue that you bring up, but I think 
the right solution is to fix how we execute postHooks.

If we applied your patch now, it would introduce a regression for the original 
issue that I created this change. Specifically, that issue is that when a 2.x 
client (which has procv2 support) submits an operation that doesn't use a 
blocking lock, there is a race condition between the execution of the postHook 
and the procedure for the operation itself.

Specifically, the original problem was that an Apache Ranger-owned 
postDeleteNamespace hook was expecting that the HBase namespace would not exist 
when it was invoked. In reality, the namespace still existed because the 
DeleteNamespaceProcedure had not yet run when we used the non-blocking latch. 
Your patch would reintroduce this problem directly.

So, there are two goals: one (that you raised) is that we want clients to not 
have to hold open an RPC for a procedure to complete. The second (that I raised 
here) is that we must not call a post\* hook before the actual operation is 
completed.

I think the way to solve both of these is to push execution of the post\* hook 
into the procedure itself. That way, we do not execute the hook too "soon" and 
the client can just poll the procedure, waiting for completion (as we want).

> Avoid calling post* hook when procedure fails
> ---------------------------------------------
>
>                 Key: HBASE-19953
>                 URL: https://issues.apache.org/jira/browse/HBASE-19953
>             Project: HBase
>          Issue Type: Bug
>          Components: master, proc-v2
>            Reporter: Ramesh Mani
>            Assignee: Josh Elser
>            Priority: Critical
>             Fix For: 2.0.0-beta-2, 2.0.0
>
>         Attachments: HBASE-19952.001.branch-2.patch, 
> HBASE-19953.002.branch-2.patch, HBASE-19953.003.branch-2.patch, 
> HBASE-19953.branch-2.0.addendum.patch
>
>
> Ramesh pointed out a case where I think we're mishandling some post\* 
> MasterObserver hooks. Specifically, I'm looking at the deleteNamespace.
> We synchronously execute the DeleteNamespace procedure. When the user 
> provides a namespace that isn't empty, the procedure does a rollback (which 
> is just a no-op), but this doesn't propagate an exception up to the 
> NonceProcedureRunnable in {{HMaster#deleteNamespace}}. It took Ramesh 
> pointing it out a bit better to me that the code executes a bit differently 
> than we actually expect.
> I think we need to double-check our post hooks and make sure we aren't 
> invoking them when the procedure actually failed. cc/ [~Apache9], [~stack].



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

Reply via email to