weimingdiit commented on code in PR #8245:
URL: https://github.com/apache/hudi/pull/8245#discussion_r1145729361


##########
hudi-sync/hudi-adb-sync/src/main/java/org/apache/hudi/sync/adb/AdbSyncTool.java:
##########
@@ -189,6 +190,13 @@ private void syncHoodieTable(String tableName, boolean 
useRealtimeInputFormat, b
     }
     LOG.info("Last commit time synced was found:{}", 
lastCommitTimeSynced.orElse("null"));
 
+    String currentInstantTs = config.getString(META_SYNC_CURRENT_INSTANT_TS);
+    if (lastCommitTimeSynced.isPresent() && !currentInstantTs.isEmpty()) {
+      // If occ is enabled, the commit time may be earlier than 
lastCommitTimeSynced.
+      // In this case, the metadata of the current instant cannot be 
synchronized, resulting in the loss of partition metadata.
+      lastCommitTimeSynced = 
currentInstantTs.compareTo(lastCommitTimeSynced.get()) < 0 ? 
Option.of(currentInstantTs) : lastCommitTimeSynced;
+      LOG.info("Reset lastCommitTimeSynced " + lastCommitTimeSynced.get());

Review Comment:
   @danny0405  danny, There are two problems:
   1. I am a little confused about why the use of timestamp comparison causes 
bugs
   2. Any suggestions if you want to rememer instant timestamp



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