kadirozde commented on code in PR #2134: URL: https://github.com/apache/phoenix/pull/2134#discussion_r2066993644
########## phoenix-core/src/it/java/org/apache/phoenix/end2end/MaxLookbackExtendedIT.java: ########## @@ -610,6 +610,44 @@ public void testRetainingLastRowVersion() throws Exception { } } + @Test(timeout=60000) + public void testRetainingLastRowVersionForFlushes() throws Exception { + try(Connection conn = DriverManager.getConnection(getUrl())) { + String tableName = generateUniqueName(); + createTable(tableName); + long timeIntervalBetweenTwoUpserts = (ttl / 2) + 1; + injectEdge.setValue(System.currentTimeMillis()); + EnvironmentEdgeManager.injectEdge(injectEdge); + TableName dataTableName = TableName.valueOf(tableName); + injectEdge.incrementValue(1); + Statement stmt = conn.createStatement(); + stmt.execute("upsert into " + tableName + " values ('a', 'ab', 'abc', 'abcd')"); + conn.commit(); + injectEdge.incrementValue(timeIntervalBetweenTwoUpserts * 1000); + stmt.execute("upsert into " + tableName + " values ('a', 'ab1')"); + conn.commit(); + injectEdge.incrementValue(timeIntervalBetweenTwoUpserts * 1000); + stmt.execute("upsert into " + tableName + " values ('a', 'ab2')"); + conn.commit(); + injectEdge.incrementValue(timeIntervalBetweenTwoUpserts * 1000); + stmt.execute("upsert into " + tableName + " values ('a', 'ab3')"); + conn.commit(); + injectEdge.incrementValue(MAX_LOOKBACK_AGE * 1000); + TestUtil.dumpTable(conn, dataTableName); + TestUtil.flush(utility, dataTableName); + injectEdge.incrementValue(1); + TestUtil.dumpTable(conn, dataTableName); + majorCompact(dataTableName); + injectEdge.incrementValue(1); + TestUtil.dumpTable(conn, dataTableName); + ResultSet rs = stmt.executeQuery("select * from " + dataTableName + " where id = 'a'"); + while(rs.next()) { + assertNotNull(rs.getString(3)); Review Comment: Let's verify the column values are equal to the expected values here. -- 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. To unsubscribe, e-mail: issues-unsubscr...@phoenix.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org