Skip to content

Conversation

@yihua
Copy link
Contributor

@yihua yihua commented Mar 23, 2022

What is the purpose of the pull request

Before this change, the sequence of changes in the rollback action are:
(1) Get the instant (C1) to roll back. If there is already a pending rollback (RB_C1) for the same instant (C1) in the active timeline, the same rollback instant (RB_C1) and the rollback plan are reused. Otherwise, schedule a new rollback instant.
(2) Transition C1 to inflight if completed.
(3) Delete data files written by C1.
(4) Delete instant files (C1) in the data table timeline.
(5) Commit changes from the rollback (RB_C1) to metadata table
(6) Transition the rollback instant (RB_C1) from inflight to complete on data table timeline.

By design, we should only change data table timeline after committing the changes to the metadata table. This PR changes the order of timeline changes as below, switching the order of (4) and (5) above:
(1) Get the instant (C1) to roll back. If there is already a pending rollback (RB_C1) for the same instant (C1) in the active timeline, the same rollback instant (RB_C1) and the rollback plan is reused. Otherwise, schedule a new rollback instant.
(2) Transition C1 to inflight if completed.
(3) Delete data files written by C1.
(4) Commit changes from the rollback (RB_C1) to metadata table
(5) Delete instant files (C1) in the data table timeline.
(6) Transition the rollback instant (RB_C1) from inflight to complete on data table timeline.

Brief change log

  • Changes the order of timeline change in BaseRollbackActionExecutor, by first applying the rollback metadata to the metadata table, then deleting the instant files of the instant to rollback in the data table timeline, and finally transiting the inflight rollback to complete in the data table timeline.

Verify this pull request

This pull request is already covered by existing tests around rollbacks.

Committer checklist

  • Has a corresponding JIRA in PR title & commit

  • Commit message is descriptive of the change

  • CI is green

  • Necessary doc changes done or have another open PR

  • For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.

@yihua yihua added the priority:blocker Production down; release blocker label Mar 23, 2022
@yihua yihua force-pushed the HUDI-3604-metadata-table-with-rollbacks branch from 88594a9 to fe2c05d Compare March 24, 2022 21:38

// If publish the rollback to the timeline, we first write the rollback metadata
// to metadata table
if (!skipTimelinePublish) {
Copy link
Contributor

Choose a reason for hiding this comment

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

we should see if we can make this more readable or nicer. I will approve it for now. but see if we can improve this sometime.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense. I'll refactor this later on.

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.

LGTM

@yihua yihua force-pushed the HUDI-3604-metadata-table-with-rollbacks branch from fe2c05d to 77a160c Compare March 25, 2022 00:27
@yihua yihua force-pushed the HUDI-3604-metadata-table-with-rollbacks branch from 77a160c to 5bc41f7 Compare March 27, 2022 03:54
@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

@yihua yihua merged commit 484b340 into apache:master Mar 27, 2022
vingov pushed a commit to vingov/hudi that referenced this pull request Apr 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:blocker Production down; release blocker

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants