linliu-code commented on code in PR #11151:
URL: https://github.com/apache/hudi/pull/11151#discussion_r1590513268


##########
hudi-client/hudi-client-common/src/test/java/org/apache/hudi/client/transaction/TestSimpleConcurrentFileWritesConflictResolutionStrategy.java:
##########
@@ -193,6 +193,38 @@ public void 
testConcurrentWritesWithInterleavingScheduledCompaction() throws Exc
     }
   }
 
+  @Test
+  public void testConcurrentWritesWithInterleavingInflightCompaction() throws 
Exception {
+    createCommit(metaClient.createNewInstantTime(), metaClient);
+    HoodieActiveTimeline timeline = metaClient.getActiveTimeline();
+    // consider commits before this are all successful
+    Option<HoodieInstant> lastSuccessfulInstant = 
timeline.getCommitsTimeline().filterCompletedInstants().lastInstant();
+    // writer 1 starts
+    String currentWriterInstant = metaClient.createNewInstantTime();
+    createInflightCommit(currentWriterInstant, metaClient);
+    // compaction 1 gets scheduled and becomes inflight
+    String newInstantTime = metaClient.createNewInstantTime();
+    createPendingCompaction(newInstantTime, metaClient);
+
+    Option<HoodieInstant> currentInstant = Option.of(new 
HoodieInstant(State.INFLIGHT, HoodieTimeline.COMMIT_ACTION, 
currentWriterInstant));

Review Comment:
   Yeah, I know we should use MOR table for compaction. But this entire test 
uses COW to test concurrency with compaction. I guess it should be OK since we 
only test the conflict resolution logic.
   



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