-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-5504]Fix concurrency conflict when asyncCompaction is enabled #7609
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 1 commit
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 |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
|
|
||
| package org.apache.hudi.sink.compact; | ||
|
|
||
| import org.apache.flink.streaming.runtime.streamrecord.LatencyMarker; | ||
| import org.apache.hudi.client.HoodieFlinkWriteClient; | ||
| import org.apache.hudi.client.WriteStatus; | ||
| import org.apache.hudi.common.model.CompactionOperation; | ||
|
|
@@ -98,10 +99,16 @@ public void open() throws Exception { | |
| } | ||
|
|
||
| @Override | ||
| public void processWatermark(Watermark mark) { | ||
| public void processWatermark(Watermark mark) throws Exception { | ||
| // no need to propagate the watermark | ||
|
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. Unnecessary change. |
||
| } | ||
|
|
||
| @Override | ||
| public void processLatencyMarker(LatencyMarker latencyMarker) | ||
| throws Exception { | ||
| // no need to propagate the latencyMarker | ||
|
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. No need to throw exception.
Contributor
Author
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. fixed
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.
Contributor
Author
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. ClusteringOperator fixed in HUDI-5515 |
||
| } | ||
|
|
||
| @Override | ||
| public void processElement(StreamRecord<CompactionPlanEvent> record) throws Exception { | ||
| final CompactionPlanEvent event = record.getValue(); | ||
|
|
@@ -111,7 +118,9 @@ public void processElement(StreamRecord<CompactionPlanEvent> record) throws Exce | |
| // executes the compaction task asynchronously to not block the checkpoint barrier propagate. | ||
| executor.execute( | ||
| () -> doCompaction(instantTime, compactionOperation, collector, reloadWriteConfig()), | ||
| (errMsg, t) -> collector.collect(new CompactionCommitEvent(instantTime, compactionOperation.getFileId(), taskID)), | ||
| (errMsg, t) -> { | ||
| collector.collect(new CompactionCommitEvent(instantTime, | ||
|
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. Unnecessary change. |
||
| compactionOperation.getFileId(), taskID));}, | ||
| "Execute compaction for instant %s from task %d", instantTime, taskID); | ||
| } else { | ||
| // executes the compaction task synchronously for batch mode. | ||
|
|
@@ -137,7 +146,8 @@ private void doCompaction(String instantTime, | |
| compactionOperation, | ||
| instantTime, maxInstantTime, | ||
| writeClient.getHoodieTable().getTaskContextSupplier()); | ||
| collector.collect(new CompactionCommitEvent(instantTime, compactionOperation.getFileId(), writeStatuses, taskID)); | ||
| collector.collect(new CompactionCommitEvent(instantTime, compactionOperation.getFileId(), | ||
|
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. Unnecessary change. |
||
| writeStatuses, taskID)); | ||
| } | ||
|
|
||
| private HoodieWriteConfig reloadWriteConfig() throws Exception { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the import sequence.