danny0405 commented on code in PR #13229:
URL: https://github.com/apache/hudi/pull/13229#discussion_r2084428739
##########
hudi-spark-datasource/hudi-spark/src/test/java/org/apache/hudi/table/action/rollback/TestMergeOnReadRollbackActionExecutor.java:
##########
@@ -284,48 +293,56 @@ public void testMergeOnReadRestoreCompactionCommit()
throws IOException {
assertEquals(1, secondPartitionCommit2LogFiles.size());
HoodieTable table = this.getHoodieTable(metaClient, cfg);
- //3. rollback the update to partition1 and partition2
- HoodieInstant rollBackInstant =
INSTANT_GENERATOR.createNewInstant(isUsingMarkers ?
HoodieInstant.State.INFLIGHT : HoodieInstant.State.COMPLETED,
- HoodieTimeline.DELTA_COMMIT_ACTION, "002");
- BaseRollbackPlanActionExecutor mergeOnReadRollbackPlanActionExecutor =
- new BaseRollbackPlanActionExecutor(context, cfg, table, "003",
rollBackInstant, false,
- cfg.shouldRollbackUsingMarkers(), true);
- mergeOnReadRollbackPlanActionExecutor.execute().get();
- MergeOnReadRollbackActionExecutor mergeOnReadRollbackActionExecutor = new
MergeOnReadRollbackActionExecutor(
- context,
- cfg,
- table,
- "003",
- rollBackInstant,
- true,
- false);
- //3. assert the rollback stat
- Map<String, HoodieRollbackPartitionMetadata> rollbackMetadata =
mergeOnReadRollbackActionExecutor.execute().getPartitionMetadata();
- assertEquals(2, rollbackMetadata.size());
- assertFalse(WriteMarkersFactory.get(cfg.getMarkersType(), table,
"002").doesMarkerDirExist());
-
- // rollback 001 as well. this time since its part of the restore, entire
file slice should be deleted and not just log files (for partition1 and
partition2)
- HoodieInstant rollBackInstant1 =
INSTANT_GENERATOR.createNewInstant(isUsingMarkers ?
HoodieInstant.State.INFLIGHT : HoodieInstant.State.COMPLETED,
- HoodieTimeline.DELTA_COMMIT_ACTION, "001");
- BaseRollbackPlanActionExecutor mergeOnReadRollbackPlanActionExecutor1 =
- new BaseRollbackPlanActionExecutor(context, cfg, table, "004",
rollBackInstant1, false,
- cfg.shouldRollbackUsingMarkers(), true);
- mergeOnReadRollbackPlanActionExecutor1.execute().get();
- MergeOnReadRollbackActionExecutor mergeOnReadRollbackActionExecutor1 = new
MergeOnReadRollbackActionExecutor(
- context,
- cfg,
- table,
- "004",
- rollBackInstant1,
- true,
- false);
- mergeOnReadRollbackActionExecutor1.execute().getPartitionMetadata();
-
- //assert there are no valid file groups in both partition1 and partition2
- assertEquals(0,
table.getFileSystemView().getAllFileGroups(DEFAULT_FIRST_PARTITION_PATH).count());
- assertEquals(0,
table.getFileSystemView().getAllFileGroups(DEFAULT_SECOND_PARTITION_PATH).count());
- // and only 3rd partition should have valid file groups.
-
assertTrue(table.getFileSystemView().getAllFileGroups(DEFAULT_THIRD_PARTITION_PATH).count()
> 0);
+ // Start a client so that timeline server starts
+ client = getHoodieWriteClient(cfg);
+ // Sleep for 1 second to ensure the timeline server port is listening
+ Thread.sleep(1000);
Review Comment:
Can you elaborate why the timeline server is needed here?
--
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]