Repository: hbase Updated Branches: refs/heads/branch-1.2 571814425 -> 04ff0afb5
HBASE-16889 Proc-V2: verifyTables in the IntegrationTestDDLMasterFailover test after each table DDL is incorrect (Stephen Yuan Jiang) Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/04ff0afb Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/04ff0afb Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/04ff0afb Branch: refs/heads/branch-1.2 Commit: 04ff0afb5b949c7eb3517e35d2ca792ff0c45fd6 Parents: 5718144 Author: Stephen Yuan Jiang <[email protected]> Authored: Thu Oct 20 16:39:08 2016 -0700 Committer: Stephen Yuan Jiang <[email protected]> Committed: Thu Oct 20 18:31:27 2016 -0700 ---------------------------------------------------------------------- .../hbase/IntegrationTestDDLMasterFailover.java | 46 ++++++++++++-------- 1 file changed, 29 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/04ff0afb/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java ---------------------------------------------------------------------- diff --git a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java index 24209ae..ffca325 100644 --- a/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java +++ b/hbase-it/src/test/java/org/apache/hadoop/hbase/IntegrationTestDDLMasterFailover.java @@ -241,9 +241,11 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { admin.createTable(htd, startKey, endKey, numRegions); Assert.assertTrue("Table: " + htd + " was not created", admin.tableExists(tableName)); HTableDescriptor freshTableDesc = admin.getTableDescriptor(tableName); + Assert.assertTrue( + "After create, Table: " + tableName + " in not enabled", admin.isTableEnabled(tableName)); enabledTables.put(tableName, freshTableDesc); LOG.info("Created table:" + freshTableDesc); - } catch (Exception e){ + } catch (Exception e) { LOG.warn("Caught exception in action: " + this.getClass()); // TODO workaround // when master failover happens during CREATE_TABLE, client will do RPC retry and get TableExistsException @@ -256,7 +258,6 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { } finally { admin.close(); } - verifyTables(); } private HTableDescriptor createTableDesc() { @@ -288,6 +289,9 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { Assert.assertTrue("Table: " + selected + " was not disabled", admin.isTableDisabled(tableName)); HTableDescriptor freshTableDesc = admin.getTableDescriptor(tableName); + Assert.assertTrue( + "After disable, Table: " + tableName + " is not disabled", + admin.isTableDisabled(tableName)); disabledTables.put(tableName, freshTableDesc); LOG.info("Disabled table :" + freshTableDesc); } catch (Exception e){ @@ -313,7 +317,6 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { } finally { admin.close(); } - verifyTables(); } } @@ -335,6 +338,8 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { Assert.assertTrue("Table: " + selected + " was not enabled", admin.isTableEnabled(tableName)); HTableDescriptor freshTableDesc = admin.getTableDescriptor(tableName); + Assert.assertTrue( + "After enable, Table: " + tableName + " in not enabled", admin.isTableEnabled(tableName)); enabledTables.put(tableName, freshTableDesc); LOG.info("Enabled table :" + freshTableDesc); } catch (Exception e){ @@ -360,7 +365,6 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { } finally { admin.close(); } - verifyTables(); } } @@ -397,7 +401,6 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { } finally { admin.close(); } - verifyTables(); } } @@ -442,9 +445,12 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { HTableDescriptor freshTableDesc = admin.getTableDescriptor(tableName); Assert.assertTrue("Column family: " + cfd + " was not added", freshTableDesc.hasFamily(cfd.getName())); - LOG.info("Added column family: " + cfd + " to table: " + tableName); + Assert.assertTrue( + "After add column family, Table: " + tableName + " is not disabled", + admin.isTableDisabled(tableName)); disabledTables.put(tableName, freshTableDesc); - } catch (Exception e){ + LOG.info("Added column family: " + cfd + " to table: " + tableName); + } catch (Exception e) { LOG.warn("Caught exception in action: " + this.getClass()); // TODO HBASE-13415 // loose restriction for InvalidFamilyOperationException thrown in async operations before @@ -460,7 +466,6 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { } finally { admin.close(); } - verifyTables(); } private HColumnDescriptor createFamilyDesc() { @@ -499,16 +504,18 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { freshColumnDesc.getMaxVersions(), versions); Assert.assertEquals("Column family: " + freshColumnDesc + " was not altered", freshColumnDesc.getMinVersions(), versions); - LOG.info("Altered versions of column family: " + columnDesc + " to: " + versions + - " in table: " + tableName); + Assert.assertTrue( + "After alter versions of column family, Table: " + tableName + " is not disabled", + admin.isTableDisabled(tableName)); disabledTables.put(tableName, freshTableDesc); + LOG.info("Altered versions of column family: " + columnDesc + " to: " + versions + + " in table: " + tableName); } catch (Exception e) { LOG.warn("Caught exception in action: " + this.getClass()); throw e; } finally { admin.close(); } - verifyTables(); } } @@ -540,16 +547,18 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { HColumnDescriptor freshColumnDesc = freshTableDesc.getFamily(columnDesc.getName()); Assert.assertEquals("Encoding of column family: " + columnDesc + " was not altered", freshColumnDesc.getDataBlockEncoding().getId(), id); - LOG.info("Altered encoding of column family: " + freshColumnDesc + " to: " + id + - " in table: " + tableName); + Assert.assertTrue( + "After alter encoding of column family, Table: " + tableName + " is not disabled", + admin.isTableDisabled(tableName)); disabledTables.put(tableName, freshTableDesc); + LOG.info("Altered encoding of column family: " + freshColumnDesc + " to: " + id + + " in table: " + tableName); } catch (Exception e) { LOG.warn("Caught exception in action: " + this.getClass()); throw e; } finally { admin.close(); } - verifyTables(); } } @@ -576,8 +585,11 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { HTableDescriptor freshTableDesc = admin.getTableDescriptor(tableName); Assert.assertFalse("Column family: " + cfd + " was not added", freshTableDesc.hasFamily(cfd.getName())); - LOG.info("Deleted column family: " + cfd + " from table: " + tableName); + Assert.assertTrue( + "After delete column family, Table: " + tableName + " is not disabled", + admin.isTableDisabled(tableName)); disabledTables.put(tableName, freshTableDesc); + LOG.info("Deleted column family: " + cfd + " from table: " + tableName); } catch (Exception e) { LOG.warn("Caught exception in action: " + this.getClass()); // TODO HBASE-13415 @@ -594,7 +606,6 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { } finally { admin.close(); } - verifyTables(); } } @@ -633,6 +644,8 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { table.put(put); } HTableDescriptor freshTableDesc = admin.getTableDescriptor(tableName); + Assert.assertTrue( + "After insert, Table: " + tableName + " in not enabled", admin.isTableEnabled(tableName)); enabledTables.put(tableName, freshTableDesc); LOG.info("Added " + numRows + " rows to table: " + selected); } catch (Exception e) { @@ -641,7 +654,6 @@ public class IntegrationTestDDLMasterFailover extends IntegrationTestBase { } finally { admin.close(); } - verifyTables(); } }
