Skip to content

[HUDI-9140] Fix log block io type and other rollback strategy fixes for table version 6#12992

Closed
lokeshj1703 wants to merge 4 commits intoapache:masterfrom
lokeshj1703:HUDI-9140
Closed

[HUDI-9140] Fix log block io type and other rollback strategy fixes for table version 6#12992
lokeshj1703 wants to merge 4 commits intoapache:masterfrom
lokeshj1703:HUDI-9140

Conversation

@lokeshj1703
Copy link
Collaborator

Change Logs

The PR fixes the iotype as APPEND for log blocks in table version 6. It also reverts some changes made to MarkerBasedRollbackStrategy for table version 6 in HUDI-9030.

Impact

NA

Risk level (write none, low medium or high below)

low

Documentation Update

NA

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@github-actions github-actions bot added the size:S PR with lines of changes in (10, 100] label Mar 18, 2025
Copy link
Contributor

@nsivabalan nsivabalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am also in a dilemma whether to abstract this out propertly. i.e adding version based classes for ListingBasedRollbackStrategy.
Will jam w/ @yihua .

// (B.3) Rollback triggered for first commit - Same as (B.1)
// (B.4) Rollback triggered for recurring commits - Same as (B.2) plus we need to delete the log files
// as well if the base file gets deleted.
HoodieCommitMetadata commitMetadata = TimelineUtils.getCommitMetadata(instantToRollback, table.getMetaClient().getCommitsTimeline());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this commit metadata. already in L 112, we do ahve commitMetadataOptional right and in fact we are using the commitMetadataOptional in L 209

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

if (metaClient.getTableConfig().getTableVersion().lesserThan(HoodieTableVersion.EIGHT)) {
hoodieRollbackRequests.addAll(getHoodieRollbackRequests(partitionPath, filesToDelete.get()));
} else {
hoodieRollbackRequests.addAll(getHoodieRollbackRequests(partitionPath,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add java docs whats differerence b/w version 6 and 8

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

@lokeshj1703 lokeshj1703 marked this pull request as ready for review March 19, 2025 11:14
@hudi-bot
Copy link
Collaborator

CI report:

Bot commands @hudi-bot supports the following commands:
  • @hudi-bot run azure re-run the last Azure build

if (tableVersion < HoodieTableVersion.EIGHT.versionCode()) {
// Ensure rollback metadata contains rollback log files for table version 6
assertTrue(rollbackMetadata.getPartitionMetadata().values().stream()
.noneMatch(rollbackPartitionMetadata -> rollbackPartitionMetadata.getRollbackLogFiles().isEmpty()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rollbackLogFiles should only refer to the log files added due to rollback command block.
original log files added with the commit being rolledback should be part of logBlocksToBeDeleted

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or incase of completed rollback, it should be part of logFilesFromFailedCommit

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logBlocksToBeDeleted will be the case for rollback plan

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

synced up f2f. we are good here.

assertTrue(rollbackMetadata.getPartitionMetadata().values().stream()
.noneMatch(rollbackPartitionMetadata -> rollbackPartitionMetadata.getRollbackLogFiles().isEmpty()));
// Total 3 partitions would contain 6 log files - one rollback log file and one log file with data block
assertEquals(6, logFiles.size());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we also validate logFilesFromFailedCommit from completed rollback commit metadata. this should refer to actual data file added by the commit being rolledback

@lokeshj1703
Copy link
Collaborator Author

Being covered as part of #13007

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-1.0.2 size:S PR with lines of changes in (10, 100]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

Comments