kadirozde commented on code in PR #2134:
URL: https://github.com/apache/phoenix/pull/2134#discussion_r2066991195
##########
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);
Review Comment:
Let's use TestUtil.getRawCellCount and verify that extra row versions are
removed.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]