Repository: phoenix Updated Branches: refs/heads/4.x-HBase-1.2 e5c9b2fa8 -> dd3112d03
PHOENIX-4271 MutableIndexFailureIT failing for local indexes on 4.x-HBase-1.2 branch Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/dd3112d0 Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/dd3112d0 Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/dd3112d0 Branch: refs/heads/4.x-HBase-1.2 Commit: dd3112d0328d178bb7b6f6a81fb589d3dbaf3d6c Parents: e5c9b2f Author: James Taylor <[email protected]> Authored: Tue Oct 3 13:13:45 2017 -0700 Committer: James Taylor <[email protected]> Committed: Tue Oct 3 13:13:45 2017 -0700 ---------------------------------------------------------------------- .../end2end/index/MutableIndexFailureIT.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/phoenix/blob/dd3112d0/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 7daee4e..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 @@ -302,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()); @@ -335,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
