zhoulii commented on code in PR #11252:
URL: https://github.com/apache/paimon/pull/11252#discussion_r4622596979


##########
paimon-core/src/test/java/org/apache/paimon/table/DataEvolutionDeletionVectorTest.java:
##########
@@ -1039,6 +1044,80 @@ public void testMaterializeDeletionVectors() throws 
Exception {
                 .doesNotContainAnyElementsOf(oldAnchorFiles);
     }
 
+    @ParameterizedTest
+    @ValueSource(strings = {"before", "after", "retry", "fully-deleted"})
+    public void testMaterializeInvalidatesGlobalIndexesAtCommit(String 
indexTiming)
+            throws Exception {
+        FileStoreTable table = 
createPartitionedReassignTable("materialize_global_indexes", false);
+        writePartitionRows(table, "a", 0, 1, 2);
+        writePartitionRows(table, "b", 3, 4, 5);
+        BinaryRow partitionA = partition(table, "a");
+        boolean fullyDeleted = "fully-deleted".equals(indexTiming);
+        commitDeletionVectors(
+                table,
+                partitionA,
+                Collections.singletonList(
+                        new DvSpec(
+                                new Range(0, 2),
+                                fullyDeleted ? new long[] {0, 1, 2} : new 
long[] {1})));
+        commitGlobalIndex(
+                table, partition(table, "b"), 
globalIndexFile("untouched-index", new Range(3, 5)));
+        if ("before".equals(indexTiming) || fullyDeleted) {
+            commitGlobalIndex(table, partitionA, globalIndexFile("old-index", 
new Range(0, 2)));
+        }

Review Comment:
   Updated the retry case to start with old-index and replace it with 
concurrent-index during the first commit attempt. It now verifies that the 
retry regenerates the deletions against the latest snapshot.
   



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

Reply via email to