kadirozde commented on a change in pull request #592: PHOENIX-5505 Index read
repair does not repair unverified rows with h…
URL: https://github.com/apache/phoenix/pull/592#discussion_r330942467
##########
File path:
phoenix-core/src/it/java/org/apache/phoenix/end2end/index/GlobalIndexCheckerIT.java
##########
@@ -230,14 +233,27 @@ public void
testSkipDataTableAndPostIndexPartialRowUpdate() throws Exception {
conn.commit();
IndexRegionObserver.setSkipDataTableUpdatesForTesting(false);
IndexRegionObserver.setSkipPostIndexUpdatesForTesting(false);
- conn.createStatement().execute("upsert into " + dataTableName + " (id,
val3) values ('a', 'abcdd')");
- conn.commit();
String selectSql = "SELECT val2, val3 from " + dataTableName + "
WHERE val1 = 'ab'";
// Verify that we will read from the first index table
assertExplainPlan(conn, selectSql, dataTableName, indexName + "1");
ResultSet rs = conn.createStatement().executeQuery(selectSql);
assertTrue(rs.next());
assertEquals("abc", rs.getString(1));
+ assertEquals("abcd", rs.getString(2));
+ assertFalse(rs.next());
+ selectSql = "SELECT val2, val3 from " + dataTableName + " WHERE val2
= 'abcc'";
+ // Verify that we will read from the second index table
+ assertExplainPlan(conn, selectSql, dataTableName, indexName + "2");
+ rs = conn.createStatement().executeQuery(selectSql);
+ assertFalse(rs.next());
+ conn.createStatement().execute("upsert into " + dataTableName + " (id,
val3) values ('a', 'abcdd')");
+ conn.commit();
+ selectSql = "SELECT val2, val3 from " + dataTableName + " WHERE val1
= 'ab'";
+ // Verify that we will read from the first index table
+ assertExplainPlan(conn, selectSql, dataTableName, indexName + "1");
+ rs = conn.createStatement().executeQuery(selectSql);
+ assertTrue(rs.next());
+ assertEquals("abc", rs.getString(1));
assertEquals("abcdd", rs.getString(2));
Review comment:
@gjacoby126, I added more testing to cover the case where back to back data
table row failures happen. Other failures cases were covered in
GlobalIndexCheckerIT before. PHOENIX-5055 is to handle data write failures
during overwrites.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services