Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • None
    • Reviewed

    Description

      If maximum number of tables or regions count exceeds in a namespace we are throwing DoNotRetryIOException instead we should throw QuotaExceededException.

      Attachments

        1. HBASE-13357.patch
          5 kB
          Ashish Singhi

        Issue Links

        Activity

          My bad. Overlooked the clean up portion. But please bear in mind that tearDown() is mainly in place for rolling back on things we've created during setUp(). The general rule of thumb is if you are creating something during test, you should also delete it towards the end of it. I guess we can let this one pass. It's your call though!

          srikanth235 Srikanth Srungarapu added a comment - My bad. Overlooked the clean up portion. But please bear in mind that tearDown() is mainly in place for rolling back on things we've created during setUp(). The general rule of thumb is if you are creating something during test, you should also delete it towards the end of it. I guess we can let this one pass. It's your call though!
          ashish singhi Ashish Singhi added a comment -

          Thanks Ted for the quick review.

          ashish singhi Ashish Singhi added a comment - Thanks Ted for the quick review.
          ashish singhi Ashish Singhi added a comment -

          Thanks Srikanth for taking a look.

          It is a good practice to clean up the resources we've created towards the end of the test. Though this is not critical, it is more related to code hygiene. What say ?

          If you look at cleanup api we are already doing it.

          for (HTableDescriptor table : ADMIN.listTables()) {
              ADMIN.disableTable(table.getTableName());
              deleteTable(table.getTableName());
            }
            for (NamespaceDescriptor ns : ADMIN.listNamespaceDescriptors()) {
              if (ns.getName().startsWith(prefix)) {
                ADMIN.deleteNamespace(ns.getName());
              }
            }
          
          ashish singhi Ashish Singhi added a comment - Thanks Srikanth for taking a look. It is a good practice to clean up the resources we've created towards the end of the test. Though this is not critical, it is more related to code hygiene. What say ? If you look at cleanup api we are already doing it. for (HTableDescriptor table : ADMIN.listTables()) { ADMIN.disableTable(table.getTableName()); deleteTable(table.getTableName()); } for (NamespaceDescriptor ns : ADMIN.listNamespaceDescriptors()) { if (ns.getName().startsWith(prefix)) { ADMIN.deleteNamespace(ns.getName()); } }

          Patch looks ok to me. It is a good practice to clean up the resources we've created towards the end of the test. Though this is not critical, it is more related to code hygiene. What say ?

          +  @Test(expected = QuotaExceededException.class, timeout = 30000)
          +  public void testExceedTableQuotaInNamespace() throws Exception {
          +    String nsp = prefix + "_testExceedTableQuotaInNamespace";
          +    NamespaceDescriptor nspDesc =
          +        NamespaceDescriptor.create(nsp).addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "1")
          +            .build();
          +    ADMIN.createNamespace(nspDesc);
          +    assertNotNull("Namespace descriptor found null.", ADMIN.getNamespaceDescriptor(nsp));
          +    assertEquals(ADMIN.listNamespaceDescriptors().length, 3);
          +    HTableDescriptor tableDescOne =
          +        new HTableDescriptor(TableName.valueOf(nsp + TableName.NAMESPACE_DELIM + "table1"));
          +    HTableDescriptor tableDescTwo =
          +        new HTableDescriptor(TableName.valueOf(nsp + TableName.NAMESPACE_DELIM + "table2"));
          +    ADMIN.createTable(tableDescOne);
          +    ADMIN.createTable(tableDescTwo, Bytes.toBytes("AAA"), Bytes.toBytes("ZZZ"), 4);
          +  }
          
          srikanth235 Srikanth Srungarapu added a comment - Patch looks ok to me. It is a good practice to clean up the resources we've created towards the end of the test. Though this is not critical, it is more related to code hygiene. What say ? + @Test(expected = QuotaExceededException.class, timeout = 30000) + public void testExceedTableQuotaInNamespace() throws Exception { + String nsp = prefix + "_testExceedTableQuotaInNamespace" ; + NamespaceDescriptor nspDesc = + NamespaceDescriptor.create(nsp).addConfiguration(TableNamespaceManager.KEY_MAX_TABLES, "1" ) + .build(); + ADMIN.createNamespace(nspDesc); + assertNotNull( "Namespace descriptor found null ." , ADMIN.getNamespaceDescriptor(nsp)); + assertEquals(ADMIN.listNamespaceDescriptors().length, 3); + HTableDescriptor tableDescOne = + new HTableDescriptor(TableName.valueOf(nsp + TableName.NAMESPACE_DELIM + "table1" )); + HTableDescriptor tableDescTwo = + new HTableDescriptor(TableName.valueOf(nsp + TableName.NAMESPACE_DELIM + "table2" )); + ADMIN.createTable(tableDescOne); + ADMIN.createTable(tableDescTwo, Bytes.toBytes( "AAA" ), Bytes.toBytes( "ZZZ" ), 4); + }
          hudson Hudson added a comment -

          SUCCESS: Integrated in HBase-TRUNK #6318 (See https://builds.apache.org/job/HBase-TRUNK/6318/)
          HBASE-13357 If maxTables/maxRegions exceeds quota in a namespace, throw QuotaExceededException (Ashish Singhi) (tedyu: rev a6ff17b958985f806233c345f0c1a2e6f85ec323)

          • hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java
          • hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceStateManager.java
          hudson Hudson added a comment - SUCCESS: Integrated in HBase-TRUNK #6318 (See https://builds.apache.org/job/HBase-TRUNK/6318/ ) HBASE-13357 If maxTables/maxRegions exceeds quota in a namespace, throw QuotaExceededException (Ashish Singhi) (tedyu: rev a6ff17b958985f806233c345f0c1a2e6f85ec323) hbase-server/src/test/java/org/apache/hadoop/hbase/namespace/TestNamespaceAuditor.java hbase-server/src/main/java/org/apache/hadoop/hbase/namespace/NamespaceStateManager.java
          yuzhihong@gmail.com Ted Yu added a comment -

          Thanks for the patch, Ashish.

          yuzhihong@gmail.com Ted Yu added a comment - Thanks for the patch, Ashish.
          hadoopqa Hadoop QA added a comment -

          +1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12708001/HBASE-13357.patch
          against master branch at commit 0967c6af29ba0546a167583535659a0c13de45b3.
          ATTACHMENT ID: 12708001

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 4 new or modified tests.

          +1 hadoop versions. The patch compiles with all supported hadoop versions (2.4.1 2.5.2 2.6.0)

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 protoc. The applied patch does not increase the total number of protoc compiler warnings.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 checkstyle. The applied patch does not increase the total number of checkstyle errors

          +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 lineLengths. The patch does not introduce lines longer than 100

          +1 site. The mvn site goal succeeds with this patch.

          +1 core tests. The patch passed unit tests in .

          Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/13476//testReport/
          Release Findbugs (version 2.0.3) warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/13476//artifact/patchprocess/newFindbugsWarnings.html
          Checkstyle Errors: https://builds.apache.org/job/PreCommit-HBASE-Build/13476//artifact/patchprocess/checkstyle-aggregate.html

          Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/13476//console

          This message is automatically generated.

          hadoopqa Hadoop QA added a comment - +1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12708001/HBASE-13357.patch against master branch at commit 0967c6af29ba0546a167583535659a0c13de45b3. ATTACHMENT ID: 12708001 +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 4 new or modified tests. +1 hadoop versions . The patch compiles with all supported hadoop versions (2.4.1 2.5.2 2.6.0) +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 protoc . The applied patch does not increase the total number of protoc compiler warnings. +1 javadoc . The javadoc tool did not generate any warning messages. +1 checkstyle . The applied patch does not increase the total number of checkstyle errors +1 findbugs . The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 lineLengths . The patch does not introduce lines longer than 100 +1 site . The mvn site goal succeeds with this patch. +1 core tests . The patch passed unit tests in . Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/13476//testReport/ Release Findbugs (version 2.0.3) warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/13476//artifact/patchprocess/newFindbugsWarnings.html Checkstyle Errors: https://builds.apache.org/job/PreCommit-HBASE-Build/13476//artifact/patchprocess/checkstyle-aggregate.html Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/13476//console This message is automatically generated.
          yuzhihong@gmail.com Ted Yu added a comment -

          +1

          yuzhihong@gmail.com Ted Yu added a comment - +1
          ashish singhi Ashish Singhi added a comment -

          Simple patch.
          Please review

          ashish singhi Ashish Singhi added a comment - Simple patch. Please review

          People

            ashish singhi Ashish Singhi
            ashish singhi Ashish Singhi
            Votes:
            0 Vote for this issue
            Watchers:
            Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack