BruceKellan commented on code in PR #9209:
URL: https://github.com/apache/hudi/pull/9209#discussion_r1392239045
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/client/timeline/HoodieTimelineArchiver.java:
##########
@@ -164,230 +101,32 @@ 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<ActiveAction> instantsToArchive =
getInstantsToArchive().sorted().collect(Collectors.toList());
boolean success = true;
if (!instantsToArchive.isEmpty()) {
- this.writer = openWriter();
LOG.info("Archiving instants " + instantsToArchive);
- archive(context, instantsToArchive);
+ Consumer<Exception> exceptionHandler = e -> {
+ if (this.config.isFailOnTimelineArchivingEnabled()) {
+ throw new HoodieException(e);
+ }
+ };
+ this.timelineWriter.write(instantsToArchive, Option.of(action ->
deleteAnyLeftOverMarkers(context, action)), Option.of(exceptionHandler));
LOG.info("Deleting archived instants " + instantsToArchive);
success = deleteArchivedInstants(instantsToArchive, context);
Review Comment:
if we need to consider how to handle deletion failure exception?
--
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]