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

Nihal Jain commented on HBASE-20633:
------------------------------------

bq. Where is the admin released ?
I think I need to close it.

BTW, I have an alternate solution which seems more efficient to me, instead of 
checking whether table exists or not, we can directly catch 
TableNotFoundException (along with the existing TableNotDisabledException). 
What do you say?

> Dropping a table containing a disable violation policy fails to remove the 
> quota upon table delete
> --------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-20633
>                 URL: https://issues.apache.org/jira/browse/HBASE-20633
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Nihal Jain
>            Assignee: Nihal Jain
>            Priority: Major
>         Attachments: HBASE-20633.master.001.patch
>
>
>  
> {code:java}
>   private void setQuotaAndThenDropTable(SpaceViolationPolicy policy) throws 
> Exception {
>     Put put = new Put(Bytes.toBytes("to_reject"));
>     put.addColumn(Bytes.toBytes(SpaceQuotaHelperForTests.F1), 
> Bytes.toBytes("to"),
>       Bytes.toBytes("reject"));
>     SpaceViolationPolicy policy = SpaceViolationPolicy.DISABLE;
>     // Do puts until we violate space policy
>     final TableName tn = writeUntilViolationAndVerifyViolation(policy, put);
>     // Now, drop the table
>     TEST_UTIL.deleteTable(tn);
>     LOG.debug("Successfully deleted table ", tn);
>     // Now re-create the table
>     TEST_UTIL.createTable(tn, Bytes.toBytes(SpaceQuotaHelperForTests.F1));
>     LOG.debug("Successfully re-created table ", tn);
>     // Put some rows now: should not violate as table/quota was dropped
>     verifyNoViolation(policy, tn, put);
>   }
> {code}
>  * When we drop a table, upon completion the quota triggers removal of 
> disable policy, thus causing the system to enable the table
> {noformat}
> 2018-05-18 18:08:58,189 DEBUG [PEWorker-13] 
> procedure.DeleteTableProcedure(130): delete 
> 'testSetQuotaAndThenDropTableWithDisable19' completed
> 2018-05-18 18:08:58,191 INFO  [PEWorker-13] 
> procedure2.ProcedureExecutor(1265): Finished pid=328, state=SUCCESS; 
> DeleteTableProcedure table=testSetQuotaAndThenDropTableWithDisable19 in 
> 271msec
> 2018-05-18 18:08:58,321 INFO  [regionserver/ba4cba1aa13d:0.Chore.1] 
> client.HBaseAdmin$14(844): Started enable of 
> testSetQuotaAndThenDropTableWithDisable19{noformat}
>  * But, since the table has already been dropped, enable procedure would 
> rollback
> {noformat}
> 2018-05-18 18:08:58,427 DEBUG 
> [RpcServer.default.FPBQ.Fifo.handler=2,queue=0,port=46443] 
> procedure2.ProcedureExecutor(884): Stored pid=329, 
> state=RUNNABLE:ENABLE_TABLE_PREPARE; EnableTableProcedure 
> table=testSetQuotaAndThenDropTableWithDisable19
> 2018-05-18 18:08:58,430 DEBUG 
> [RpcServer.default.FPBQ.Fifo.handler=2,queue=0,port=46443] 
> master.MasterRpcServices(1141): Checking to see if procedure is done pid=329
> 2018-05-18 18:08:58,451 INFO  [PEWorker-10] 
> procedure2.ProcedureExecutor(1359): Rolled back pid=329, state=ROLLEDBACK, 
> exception=org.apache.hadoop.hbase.TableNotFoundException via 
> master-enable-table:org.apache.hadoop.hbase.TableNotFoundException: 
> testSetQuotaAndThenDropTableWithDisable19; EnableTableProcedure 
> table=testSetQuotaAndThenDropTableWithDisable19 exec-time=124msec
> 2018-05-18 18:08:58,533 DEBUG 
> [RpcServer.default.FPBQ.Fifo.handler=2,queue=0,port=46443] 
> master.MasterRpcServices(1141): Checking to see if procedure is done pid=329
> 2018-05-18 18:08:58,535 INFO  [regionserver/ba4cba1aa13d:0.Chore.1] 
> client.HBaseAdmin$TableFuture(3652): Operation: ENABLE, Table Name: 
> default:testSetQuotaAndThenDropTableWithDisable19 failed with 
> testSetQuotaAndThenDropTableWithDisable19{noformat}
>  * Since, quota manager fails to enable table (i.e disable violation policy), 
> it would not remove the policy, causing problems if table re-created
> {noformat}
> 2018-05-18 18:08:58,536 ERROR [regionserver/ba4cba1aa13d:0.Chore.1] 
> quotas.RegionServerSpaceQuotaManager(210): Failed to disable space violation 
> policy for testSetQuotaAndThenDropTableWithDisable19. This table will remain 
> in violation.
>  org.apache.hadoop.hbase.TableNotFoundException: 
> testSetQuotaAndThenDropTableWithDisable19
>  at 
> org.apache.hadoop.hbase.master.procedure.EnableTableProcedure.prepareEnable(EnableTableProcedure.java:323)
>  at 
> org.apache.hadoop.hbase.master.procedure.EnableTableProcedure.executeFromState(EnableTableProcedure.java:98)
>  at 
> org.apache.hadoop.hbase.master.procedure.EnableTableProcedure.executeFromState(EnableTableProcedure.java:49)
>  at 
> org.apache.hadoop.hbase.procedure2.StateMachineProcedure.execute(StateMachineProcedure.java:184)
>  at org.apache.hadoop.hbase.procedure2.Procedure.doExecute(Procedure.java:850)
>  at 
> org.apache.hadoop.hbase.procedure2.ProcedureExecutor.execProcedure(ProcedureExecutor.java:1472)
>  at 
> org.apache.hadoop.hbase.procedure2.ProcedureExecutor.executeProcedure(ProcedureExecutor.java:1240)
>  at 
> org.apache.hadoop.hbase.procedure2.ProcedureExecutor.access$800(ProcedureExecutor.java:75)
>  at 
> org.apache.hadoop.hbase.procedure2.ProcedureExecutor$WorkerThread.run(ProcedureExecutor.java:1760){noformat}



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

Reply via email to