-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-9332] Pluggable Table Format Support with native Integration #13216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0babe57
4f3fabf
da763c8
daa22ca
fb0e50b
c23dcbd
6dc7f2c
cf93d8d
59cf106
fc83977
222d7b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,10 +20,12 @@ | |
|
|
||
| import org.apache.hudi.avro.model.HoodieRollbackPlan; | ||
| import org.apache.hudi.common.HoodieRollbackStat; | ||
| import org.apache.hudi.common.NativeTableFormat; | ||
| import org.apache.hudi.common.engine.HoodieEngineContext; | ||
| import org.apache.hudi.common.table.timeline.HoodieActiveTimeline; | ||
| import org.apache.hudi.common.table.timeline.HoodieInstant; | ||
| import org.apache.hudi.common.util.HoodieTimer; | ||
| import org.apache.hudi.common.util.Option; | ||
| import org.apache.hudi.config.HoodieWriteConfig; | ||
| import org.apache.hudi.table.HoodieTable; | ||
|
|
||
|
|
@@ -67,11 +69,23 @@ protected List<HoodieRollbackStat> executeRollback(HoodieRollbackPlan hoodieRoll | |
|
|
||
| if (instantToRollback.isCompleted()) { | ||
| LOG.info("Unpublishing instant " + instantToRollback); | ||
| table.getMetaClient().getTableFormat().rollback(instantToRollback, table.getContext(), table.getMetaClient(), table.getViewManager()); | ||
| // Revert the completed instant to inflight in native format. | ||
| resolvedInstant = activeTimeline.revertToInflight(instantToRollback); | ||
| // reload meta-client to reflect latest timeline status | ||
| table.getMetaClient().reloadActiveTimeline(); | ||
| } | ||
|
|
||
| // If instant is inflight but marked as completed in native format, delete the completed instant from storage. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nts: to review closely
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this a bug fix? how could this happen?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When committing -> we commit to native timeline first (A), then plugged-in tableformat (B) instantToRollback.isInflight() can be true, if A happened, but we failed before B. This is fixing that.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I ll make this limited to cases where something else is plugged in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah, let's avoid listing the timeline multiple times for reqular workflow when the external table format is not there. |
||
| if (instantToRollback.isInflight() && !table.getMetaClient().getTableFormat().getName().equals(NativeTableFormat.TABLE_FORMAT)) { | ||
| HoodieActiveTimeline activeTimelineForNativeFormat = table.getMetaClient().getActiveTimelineForNativeFormat(); | ||
| Option<HoodieInstant> instantToRollbackInNativeFormat = activeTimelineForNativeFormat.filter(instant -> instant.requestedTime().equals(instantToRollback.requestedTime())).lastInstant(); | ||
| if (instantToRollbackInNativeFormat.isPresent() && instantToRollbackInNativeFormat.get().isCompleted()) { | ||
| resolvedInstant = activeTimelineForNativeFormat.revertToInflight(instantToRollbackInNativeFormat.get()); | ||
| table.getMetaClient().reloadActiveTimeline(); | ||
| } | ||
| } | ||
|
|
||
| // For Requested State (like failure during index lookup), there is nothing to do rollback other than | ||
| // deleting the timeline file | ||
| if (!resolvedInstant.isRequested()) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.