Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.1 8688fa603 -> f8454650a
PHOENIX-4271 MutableIndexFailureIT failing for local indexes on 4.x-HBase branches Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/f8454650 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/f8454650 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/f8454650 Branch: refs/heads/4.x-HBase-1.1 Commit: f8454650a7ca91ced7ae6793f11d48fec70eeef5 Parents: 8688fa6 Author: James Taylor <[email protected]> Authored: Tue Oct 3 13:20:30 2017 -0700 Committer: James Taylor <[email protected]> Committed: Tue Oct 3 13:20:30 2017 -0700 ---------------------------------------------------------------------- .../end2end/index/MutableIndexFailureIT.java | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/f8454650/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java ---------------------------------------------------------------------- diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java index 2948831..0318925 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/index/MutableIndexFailureIT.java @@ -70,7 +70,6 @@ import org.apache.phoenix.util.SchemaUtil; import org.apache.phoenix.util.StringUtil; import org.apache.phoenix.util.TestUtil; import org.junit.BeforeClass; -import org.junit.Ignore; import org.junit.Test; import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; @@ -87,7 +86,6 @@ import com.google.common.collect.Maps; * */ -@Ignore("Not working for HBase 1.1") @Category(NeedsOwnMiniClusterTest.class) @RunWith(Parameterized.class) public class MutableIndexFailureIT extends BaseTest { @@ -304,10 +302,13 @@ public class MutableIndexFailureIT extends BaseTest { assertTrue(PIndexState.ACTIVE.toString().equals(indexState) || PIndexState.PENDING_ACTIVE.toString().equals(indexState)); } else { assertTrue(PIndexState.DISABLE.toString().equals(indexState) || PIndexState.INACTIVE.toString().equals(indexState)); - // non-failing index should remain active - ResultSet thirdRs = conn.createStatement().executeQuery(getSysCatQuery(thirdIndexName)); - assertTrue(thirdRs.next()); - assertEquals(PIndexState.ACTIVE.getSerializedValue(), thirdRs.getString(1)); + // non-failing index should remain active unless the failure came from a local index + // in which case all local indexes are marked as disabled. + if (!localIndex) { + ResultSet thirdRs = conn.createStatement().executeQuery(getSysCatQuery(thirdIndexName)); + assertTrue(thirdRs.next()); + assertEquals(PIndexState.ACTIVE.getSerializedValue(), thirdRs.getString(1)); + } } assertFalse(rs.next()); @@ -337,7 +338,11 @@ public class MutableIndexFailureIT extends BaseTest { assertEquals("d", rs.getString(2)); assertFalse(rs.next()); } - IndexScrutiny.scrutinizeIndex(conn, fullTableName, thirdFullIndexName); + // See comment above. All local indexes are disabled when a write failure occurs + // to any of them. + if (!localIndex) { + IndexScrutiny.scrutinizeIndex(conn, fullTableName, thirdFullIndexName); + } if (!failRebuildTask) { // re-enable index table
