This is an automated email from the ASF dual-hosted git repository. virajjasani pushed a commit to branch 5.3 in repository https://gitbox.apache.org/repos/asf/phoenix.git
commit 517c20d6c3c9060b060bf6ddfe26c330c6a39125 Author: Andrew Purtell <[email protected]> AuthorDate: Fri Jul 17 10:13:47 2026 -0700 PHOENIX-7834 CDCBaseIT do not force-delete a never-upserted row (#2451) --- .../src/it/java/org/apache/phoenix/end2end/CDCBaseIT.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CDCBaseIT.java b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CDCBaseIT.java index 9fbb38471d..c9fc7e70bf 100644 --- a/phoenix-core/src/it/java/org/apache/phoenix/end2end/CDCBaseIT.java +++ b/phoenix-core/src/it/java/org/apache/phoenix/end2end/CDCBaseIT.java @@ -332,8 +332,12 @@ public class CDCBaseIT extends ParallelStatsDisabledIT { for (int j = 0; j < nRows; ++j) { if (rand.nextInt(nRows) % 2 == 0) { boolean isDelete; - if (i > nBatches / 2 && !gotDelete) { - // Force a delete if there was none so far. + // Only force a delete on rows that have already been upserted in this run; deleting a + // never-inserted row produces a no-op tombstone on the data table while CDC still + // surfaces a later upsert for the same key, deterministically tripping the + // delete-vs-upsert assertion in verifyChangesViaSCN. If no candidate exists yet, defer + // the forced delete to a later batch (the loop will reconsider on the next iteration). + if (i > nBatches / 2 && !gotDelete && mutatedRows.contains(rows.get(j))) { isDelete = true; } else { isDelete = mutatedRows.contains(rows.get(j)) && rand.nextInt(5) == 0;
