codope opened a new pull request #3869:
URL: https://github.com/apache/hudi/pull/3869
## What is the purpose of the pull request
If clustering fails due to some reason, it leaves the unfinished replace
commit in the timeline. During ingestion, if there are updates to a filegroup
that was pending clustering and the update handling strategy is
`SparkRejectUpdateStrategy`, then ingestion fails. If we use
`SparkAllowUpdateStrategy` without rolling back the pending clustering then
some updates may be lost. This PR fixes the issue by rolling back the pending
clutering and allowing the updates to go through.
## Brief change log
- Changed the API to `handleUpdate` to return not only the records RDD but
also the set of file groups receiving updates while pending clustering.
- `SparkRejectUpdateStrategy` still throws the error.
`SparkAllowUpdateStrategy` will return a non-empty set.
- `BaseSparkCommitActionExecutor#clusteringHandleUpdate` will rollback
pending clustering in case of non-empty set.
## Verify this pull request
- Added a test in `TestHoodieClientOnCopyOnWriteStorage` to verify the
change.
- Manually verified the change by interrupting a clustering job to produce
unfinished commit and then doing an upsert.
## 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.
--
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]