Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-20633

Dropping a table containing a disable violation policy fails to remove the quota upon table delete

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-alpha-1, 2.1.0, 2.0.1
    • None
    • Reviewed

    Description

       

        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);
        }
      
      • When we drop a table, upon completion the quota triggers removal of disable policy, thus causing the system to enable the table
        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
      • But, since the table has already been dropped, enable procedure would rollback
        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
      • Since, quota manager fails to enable table (i.e disable violation policy), it would not remove the policy, causing problems if table re-created
        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)

      Attachments

        1. HBASE-20633.master.002.patch
          6 kB
          Nihal Jain
        2. HBASE-20633.master.002.patch
          6 kB
          Nihal Jain
        3. HBASE-20633.master.001.patch
          6 kB
          Nihal Jain

        Activity

          People

            nihaljain.cs Nihal Jain
            nihaljain.cs Nihal Jain
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: