[ 
https://issues.apache.org/jira/browse/HBASE-21914?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Xiang Li updated HBASE-21914:
-----------------------------
    Description: 
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 it correctly, the idea is to make sure that when setting the state to 
FAILDED, exception must be set. (or must call setFailure()). But the assertion 
only check isFailed() but no "!hasException()"

> 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 it correctly, the idea is to make sure that when setting the state 
> to FAILDED, 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)

Reply via email to