Fix requested eompaction rollback during restore command
This commit is contained in:
committed by
Balaji Varadarajan
parent
d2525c31b7
commit
0b032b2761
@@ -808,16 +808,12 @@ public class HoodieWriteClient<T extends HoodieRecordPayload> extends AbstractHo
|
|||||||
instantsToStats.put(instant.getTimestamp(), statsForInstant);
|
instantsToStats.put(instant.getTimestamp(), statsForInstant);
|
||||||
break;
|
break;
|
||||||
case HoodieTimeline.COMPACTION_ACTION:
|
case HoodieTimeline.COMPACTION_ACTION:
|
||||||
if (instant.isRequested()) {
|
// TODO : Get file status and create a rollback stat and file
|
||||||
// TODO : Get file status and create a rollback stat and file
|
// TODO : Delete the .aux files along with the instant file, okay for now since the archival process will
|
||||||
// TODO : Delete the .aux files along with the instant file, okay for now since the archival process will
|
// delete these files when it does not see a corresponding instant file under .hoodie
|
||||||
// delete these files when it does not see a corresponding instant file under .hoodie
|
List<HoodieRollbackStat> statsForCompaction = doRollbackAndGetStats(instant.getTimestamp());
|
||||||
deleteRequestedCompaction(instant.getTimestamp());
|
instantsToStats.put(instant.getTimestamp(), statsForCompaction);
|
||||||
logger.info("Deleted pending scheduled compaction " + instant.getTimestamp());
|
logger.info("Deleted compaction instant " + instant);
|
||||||
} else {
|
|
||||||
List<HoodieRollbackStat> statsForCompaction = doRollbackAndGetStats(instant.getTimestamp());
|
|
||||||
instantsToStats.put(instant.getTimestamp(), statsForCompaction);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException("invalid action name " + instant.getAction());
|
throw new IllegalArgumentException("invalid action name " + instant.getAction());
|
||||||
|
|||||||
@@ -680,6 +680,11 @@ public class TestMergeOnReadTable extends HoodieClientTestHarness {
|
|||||||
List<HoodieFileGroup> fileGroups = ((HoodieTableFileSystemView) rtView).getAllFileGroups().collect(Collectors
|
List<HoodieFileGroup> fileGroups = ((HoodieTableFileSystemView) rtView).getAllFileGroups().collect(Collectors
|
||||||
.toList());
|
.toList());
|
||||||
assertTrue(fileGroups.isEmpty());
|
assertTrue(fileGroups.isEmpty());
|
||||||
|
|
||||||
|
// make sure there are no log files remaining
|
||||||
|
assertTrue(((HoodieTableFileSystemView) rtView).getAllFileGroups().filter(fileGroup -> fileGroup
|
||||||
|
.getAllRawFileSlices().filter(f -> f.getLogFiles().count() == 0).count() == 0).count() == 0L);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1259,4 +1264,4 @@ public class TestMergeOnReadTable extends HoodieClientTestHarness {
|
|||||||
assertFalse("Errors found in write of " + status.getFileId(), status.hasErrors());
|
assertFalse("Errors found in write of " + status.getFileId(), status.hasErrors());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user