You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/03/21 12:06:15 UTC
[GitHub] [hudi] vinothchandar commented on a change in pull request #4016: [HUDI-2675] Fix the exception 'Not an Avro data file' when archive and clean
vinothchandar commented on a change in pull request #4016:
URL: https://github.com/apache/hudi/pull/4016#discussion_r831031349
##########
File path: hudi-common/src/main/java/org/apache/hudi/common/table/timeline/HoodieActiveTimeline.java
##########
@@ -190,12 +190,36 @@ public static void deleteInstantFile(FileSystem fs, String metaPath, HoodieInsta
}
}
+ public void deleteEmptyInstantIfExists(HoodieInstant instant) {
+ ValidationUtils.checkArgument(isEmpty(instant));
+ deleteInstantFileIfExists(instant);
+ }
+
public void deleteCompactionRequested(HoodieInstant instant) {
ValidationUtils.checkArgument(instant.isRequested());
ValidationUtils.checkArgument(Objects.equals(instant.getAction(), HoodieTimeline.COMPACTION_ACTION));
deleteInstantFile(instant);
}
+ private void deleteInstantFileIfExists(HoodieInstant instant) {
+ LOG.info("Deleting instant " + instant);
+ Path inFlightCommitFilePath = new Path(metaClient.getMetaPath(), instant.getFileName());
+ try {
+ if (metaClient.getFs().exists(inFlightCommitFilePath)) {
Review comment:
this is an extra RPC call.
##########
File path: hudi-client/hudi-client-common/src/main/java/org/apache/hudi/table/HoodieTimelineArchiveLog.java
##########
@@ -321,10 +321,19 @@ public void archive(HoodieEngineContext context, List<HoodieInstant> instants) t
List<IndexedRecord> records = new ArrayList<>();
for (HoodieInstant hoodieInstant : instants) {
try {
- deleteAnyLeftOverMarkers(context, hoodieInstant);
- records.add(convertToAvroRecord(hoodieInstant));
- if (records.size() >= this.config.getCommitArchivalBatchSize()) {
- writeToFile(wrapperSchema, records);
+ if (table.getActiveTimeline().isEmpty(hoodieInstant)
+ && (
+ hoodieInstant.getAction().equals(HoodieTimeline.CLEAN_ACTION)
+ || (hoodieInstant.getAction().equals(HoodieTimeline.ROLLBACK_ACTION) && hoodieInstant.isCompleted())
+ )
Review comment:
None of them should really be empty. is this happening on HDFS or cloud storage?
--
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-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org