beyond1920 commented on code in PR #9850: URL: https://github.com/apache/hudi/pull/9850#discussion_r1358191937
########## hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/sink/utils/TestWriteBase.java: ########## @@ -524,9 +524,15 @@ private void checkInstantState(HoodieInstant.State state, String instantStr) { } protected String lastCompleteInstant() { - return OptionsResolver.isMorTable(conf) - ? TestUtils.getLastDeltaCompleteInstant(basePath) - : TestUtils.getLastCompleteInstant(basePath, HoodieTimeline.COMMIT_ACTION); + if (OptionsResolver.isLocklessMultiWriter(this.conf)) { + // If there are lockless multiple writer, fetch last complete instant of current writer from ckp metadata + // because the writer started first might finish later, similarly, the writer started later might finish first. + return this.ckpMetadata.lastCompleteInstant(); + } else { Review Comment: In most case `return this.ckpMetadata.lastCompleteInstant();` directly works fine. But the case `testSubtaskFails` would fail because failover happens, the ckp meta might be cleaned, fetch the instant from timeline. I add branch to handle this case. -- 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: commits-unsubscr...@hudi.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org