1
0

[HUDI-4177] Fix hudi-cli rollback with rollbackUsingMarkers method call (#5734)

* Fix hudi-cli rollback with rollbackUsingMarkers method call
* Add test for hudi-cli rollbackUsingMarkers

Co-authored-by: Shawn Chang <yxchang@amazon.com>
This commit is contained in:
Shawn Chang
2022-06-20 19:54:12 -07:00
committed by GitHub
parent ba4d5bd847
commit 5c204f1416
2 changed files with 18 additions and 1 deletions

View File

@@ -125,5 +125,22 @@ public class ITTestCommitsCommand extends HoodieCLIIntegrationTestBase {
HoodieActiveTimeline timeline2 = metaClient.reloadActiveTimeline();
assertEquals(1, timeline2.getCommitsTimeline().countInstants(), "There should have 1 instants.");
// rollback with rollbackUsingMarkers==false
CommandResult cr3 = getShell().executeCommand(
String.format("commit rollback --commit %s --rollbackUsingMarkers false --sparkMaster %s --sparkMemory %s",
"100", "local", "4G"));
assertAll("Command run failed",
() -> assertTrue(cr3.isSuccess()),
() -> assertEquals("Commit 100 rolled back", cr3.getResult().toString()));
metaClient = HoodieTableMetaClient.reload(HoodieCLI.getTableMetaClient());
HoodieActiveTimeline rollbackTimeline3 = new RollbacksCommand.RollbackTimeline(metaClient);
assertEquals(3, rollbackTimeline3.getRollbackTimeline().countInstants(), "There should have 3 rollback instant.");
HoodieActiveTimeline timeline3 = metaClient.reloadActiveTimeline();
assertEquals(0, timeline3.getCommitsTimeline().countInstants(), "There should have 0 instants.");
}
}