Davis-Zhang-Onehouse commented on code in PR #12813:
URL: https://github.com/apache/hudi/pull/12813#discussion_r1966302575


##########
hudi-utilities/src/main/java/org/apache/hudi/utilities/streamer/StreamSync.java:
##########
@@ -802,9 +807,18 @@ private Pair<Option<String>, JavaRDD<WriteStatus>> 
writeToSinkAndDoMetaSync(Stri
       Option<String> scheduledCompactionInstant = Option.empty();
       // write to hudi and fetch result
       WriteClientWriteResult writeClientWriteResult = writeToSink(inputBatch, 
instantTime, useRowWriter);
-      JavaRDD<WriteStatus> writeStatusRDD = 
writeClientWriteResult.getWriteStatusRDD();
       Map<String, List<String>> partitionToReplacedFileIds = 
writeClientWriteResult.getPartitionToReplacedFileIds();
-
+      // writeToSink can upgrade table layout version and commitsTimelineOpt 
computed before will use the old layout version.
+      Option<String> commitedInstantTime = 
getLatestInstantWithValidCheckpointInfo(Option.of(initializeMetaClient().getActiveTimeline().getCommitsTimeline().filterCompletedInstants()));

Review Comment:
   getActiveTimeline must reload the timeline, right? Otherwise the previous 
one is still V1 not V2.
   
   So initializeMetaClient().getActiveTimeline() causes an extra loading of the 
timeline.



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