lvyanquan commented on code in PR #3639:
URL: https://github.com/apache/flink-cdc/pull/3639#discussion_r1808408534


##########
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-paimon/src/test/java/org/apache/flink/cdc/connectors/paimon/sink/v2/PaimonSinkITCase.java:
##########
@@ -454,6 +454,94 @@ public void testSinkWithMultiTables(String metastore)
                 Collections.singletonList(Row.ofKind(RowKind.INSERT, "1", 
"1")), result);
     }
 
+    @ParameterizedTest
+    @ValueSource(strings = {"filesystem", "hive"})
+    public void testDuplicateCommitAfterRestore(String metastore)
+            throws IOException, InterruptedException, 
Catalog.DatabaseNotEmptyException,
+                    Catalog.DatabaseNotExistException, SchemaEvolveException {
+        initialize(metastore);
+        PaimonSink<Event> paimonSink =
+                new PaimonSink<>(
+                        catalogOptions, new 
PaimonRecordEventSerializer(ZoneId.systemDefault()));
+        PaimonWriter<Event> writer = paimonSink.createWriter(new 
MockInitContext());
+        Committer<MultiTableCommittable> committer = 
paimonSink.createCommitter();
+
+        // insert
+        for (Event event : createTestEvents()) {
+            writer.write(event, null);
+        }
+        writer.flush(false);
+        Collection<Committer.CommitRequest<MultiTableCommittable>> 
commitRequests =
+                writer.prepareCommit().stream()
+                        .map(MockCommitRequestImpl::new)
+                        .collect(Collectors.toList());
+        committer.commit(commitRequests);
+
+        // We add a loop for restore 3 times
+        for (int i = 0; i < 3; i++) {

Review Comment:
   Suggest that the repetition count be greater than 5 to trigger some 
compaction. 
   Refer to 
[num-sorted-run.compaction-trigger](https://paimon.apache.org/docs/master/maintenance/configurations/#coreoptions)
 in doc.



-- 
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...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to