You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Josh Elser (JIRA)" <ji...@apache.org> on 2018/02/07 19:53:00 UTC
[jira] [Commented] (HBASE-19953) Avoid calling post* hook when
procedure fails
[ https://issues.apache.org/jira/browse/HBASE-19953?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16355964#comment-16355964 ]
Josh Elser commented on HBASE-19953:
------------------------------------
My hunch is that we need to do something like the following, but that's just a guess. Need to play with it.
{code:java}
diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
index 999272a5bd..b770e664e6 100644
--- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
+++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/HMaster.java
@@ -2971,7 +2971,10 @@ public class HMaster extends HRegionServer implements MasterServices {
// Execute the operation synchronously - wait for the operation to complete before
// continuing.
setProcId(getClusterSchema().deleteNamespace(name, getNonceKey()));
- getMaster().getMasterCoprocessorHost().postDeleteNamespace(name);
+ if (!getProcedureExecutor().getResult(getProcId()).isFailed()) {
+ getMaster().getMasterCoprocessorHost().postDeleteNamespace(name);
+ }
}{code}
> 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
>
>
> 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)