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


##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/HoodieTimelineArchiver.java:
##########
@@ -164,230 +100,27 @@ public boolean archiveIfRequired(HoodieEngineContext 
context, boolean acquireLoc
         // there is no owner or instant time per se for archival.
         txnManager.beginTransaction(Option.empty(), Option.empty());
       }
-      List<HoodieInstant> instantsToArchive = 
getInstantsToArchive().collect(Collectors.toList());
-      verifyLastMergeArchiveFilesIfNecessary(context);
+      // Sort again because the cleaning and rollback instants could break the 
sequence.
+      List<ActiveInstant> instantsToArchive = 
getInstantsToArchive().sorted().collect(Collectors.toList());
       boolean success = true;
       if (!instantsToArchive.isEmpty()) {
-        this.writer = openWriter();
         LOG.info("Archiving instants " + instantsToArchive);
-        archive(context, instantsToArchive);
+        this.timelineWriter.write(context, instantsToArchive);
         LOG.info("Deleting archived instants " + instantsToArchive);
         success = deleteArchivedInstants(instantsToArchive, context);
+        // triggers compaction and cleaning only after archiving action
+        this.timelineWriter.compactAndClean(context);
       } else {
         LOG.info("No Instants to archive");
       }
-
-      if (shouldMergeSmallArchiveFiles()) {

Review Comment:
   Kind of, it is replaced with the new compaction, but we still keep one 
config option, that is the number of bacth files for each compaction input 
source.



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