[
https://issues.apache.org/jira/browse/HBASE-21914?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16769930#comment-16769930
]
Xu Cang commented on HBASE-21914:
---------------------------------
you are right Xiang, I was checking branch-1. Please go ahead with your
proposal. Thanks!
> Set assert to check if exception is set in procedures
> -----------------------------------------------------
>
> Key: HBASE-21914
> URL: https://issues.apache.org/jira/browse/HBASE-21914
> Project: HBase
> Issue Type: Bug
> Components: proc-v2
> Reporter: Xiang Li
> Assignee: Xiang Li
> Priority: Critical
>
> Take CreateTableProcedure as an example, in executeFromState()
> {code:java}
> case CREATE_TABLE_PRE_OPERATION:
> // Verify if we can create the table
> boolean exists = !prepareCreate(env);
> releaseSyncLatch();
>
> if (exists) {
> assert isFailed() : "the delete should have an exception here";
> return Flow.NO_MORE_STATE;
> }
> {code}
> The following assertion:
> {code}
> assert isFailed() : "the delete should have an exception here";
> {code}
> If I get the idea behind "the delete should have an exception here"
> correctly, it is to make sure that when setting the state to FAILED, the
> exception must be set. (or must call setFailure()). But the assertion only
> check isFailed() but no "!hasException()"
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)