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_r330745697
 
 

 ##########
 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:
   They fail only for one upsert and then the behavior is reverted back to 
normal at line 235 after
   IndexRegionObserver.setSkipDataTableUpdatesForTesting(false);
   IndexRegionObserver.setSkipPostIndexUpdatesForTesting(false);
   You need to look at the file not just the diff to see it all

----------------------------------------------------------------
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

Reply via email to