From 0993d2a7b3a9e9027681d607a1b56981e61898ef Mon Sep 17 00:00:00 2001 From: Andrew Purtell Date: Tue, 24 Nov 2026 11:23:37 -0800 Subject: [PATCH] PHOENIX-8091 IndexToolForNonTxGlobalIndexIT incremental rebuild test writes in one millisecond The table has no index when the test writes its rows, so the server does not keep batch timestamps apart. When a delete and the earlier put get the same timestamp, the delete masks the put, and the rebuild counts too few rows. Wait one millisecond after each of the first two commits. Co-Authored-By: Claude Opus 5.5 --- .../phoenix/end2end/IndexToolForNonTxGlobalIndexIT.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolForNonTxGlobalIndexIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolForNonTxGlobalIndexIT.java index 5bf5c905ce4..abadfa7f25e 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolForNonTxGlobalIndexIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/IndexToolForNonTxGlobalIndexIT.java @@ -1367,9 +1367,13 @@ public void testIncrementalRebuildWithPageSize() throws Exception { conn.createStatement().execute("UPSERT INTO " + fullDataTableName + " VALUES('a','aa')"); conn.createStatement().execute("UPSERT INTO " + fullDataTableName + " VALUES('b','bb')"); conn.commit(); + // The table has no index yet, so the server does not keep batch timestamps apart. + // Each commit must use a new millisecond. Otherwise a delete masks the earlier put. + Thread.sleep(1); conn.createStatement().execute("DELETE FROM " + fullDataTableName + " WHERE k = 'a'"); conn.createStatement().execute("DELETE FROM " + fullDataTableName + " WHERE k = 'b'"); conn.commit(); + Thread.sleep(1); conn.createStatement().execute("UPSERT INTO " + fullDataTableName + " VALUES('a','aaa')"); conn.createStatement().execute("UPSERT INTO " + fullDataTableName + " VALUES('b','bbb')"); conn.createStatement().execute("DELETE FROM " + fullDataTableName + " WHERE k = 'c'");