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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]