danny0405 commented on code in PR #8745:
URL: https://github.com/apache/hudi/pull/8745#discussion_r1213871041


##########
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HiveSyncTool.java:
##########
@@ -298,6 +298,22 @@ protected void syncHoodieTable(String tableName, boolean 
useRealtimeInputFormat,
     LOG.info("Sync complete for " + tableName);
   }
 
+  private boolean needToSyncAllPartitions(Option<String> lastCommitTimeSynced) 
{
+    if (!lastCommitTimeSynced.isPresent()) {
+      return true;
+    }
+    if (config.getBoolean(META_SYNC_USE_STATE_TRANSIENT_TIME)) {
+      // If we use state transient time to sync partitions and the last commit 
time synced is before latest archive time
+      // We need to fall back to list all partitions instead of load the whole 
archive timeline
+      Option<String> latestArchiveTime = syncClient.getLastArchiveTime();

Review Comment:
   I believe we can get rid of the config option 
`META_SYNC_USE_STATE_TRANSIENT_TIME` if we keep both the start time(instant 
time) and max completion time(transition time) in the HMS.
   
   We can use the instant time to check the max version id, and the completion 
time for real sync progress. Then we can fix the 'hollow' instants that are 
missed, just like what I fix in commit: https://github.com/apache/hudi/pull/8611



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

Reply via email to