jonvex commented on code in PR #7605:
URL: https://github.com/apache/hudi/pull/7605#discussion_r1066479679
##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/client/TestClientRollback.java:
##########
@@ -175,9 +187,78 @@ public void testSavepointAndRollback() throws Exception {
dataFiles = partitionPaths.stream().flatMap(s ->
view3.getAllBaseFiles(s).filter(f ->
f.getCommitTime().equals("004"))).collect(Collectors.toList());
assertEquals(0, dataFiles.size(), "The data files for commit 004 should
be rolled back");
+
+ if (testFailedRestore) {
+ //test to make sure that restore commit is reused when the restore
fails and is re-ran
+ HoodieInstant inst =
table.getActiveTimeline().getRestoreTimeline().getInstants().get(0);
+ String restoreFile = table.getMetaClient().getBasePathV2().toString()
+ "/.hoodie/" + inst.getFileName();
+ File commitFile = new File(restoreFile);
+ commitFile.delete();
+ if (!failedRestoreInflight) {
+ File inflightFile = new File(restoreFile + ".inflight");
Review Comment:
The outer if block removes the commit which would mean that the instance
state is inflight. If `failedRestoreInflight` is false, then we want to revert
it to requested by deleting the inflight file. So basically just testing to
make sure that it works in the case where the restore fails in the requested
state and when it fails in the inflight state.
--
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]