You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "suhyeon729 (via GitHub)" <gi...@apache.org> on 2026/04/05 05:27:42 UTC
[I] [Bug][Connector-V2] IcebergAggregatedCommitter commits per worker instead of single atomic commit per checkpoint [seatunnel]
suhyeon729 opened a new issue, #10710:
URL: https://github.com/apache/seatunnel/issues/10710
### Search before asking
- [x] I had searched in the [issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
### What happened
IcebergAggregatedCommitter.commitFiles() iterates over each worker's IcebergCommitInfo
and calls filesCommitter.doCommit() separately, resulting in N Iceberg snapshots
per checkpoint (where N = parallelism), instead of a single atomic snapshot.
**Root cause** (IcebergAggregatedCommitter.java:62):
```java
private void commitFiles(List<IcebergCommitInfo> commitInfos) {
for (IcebergCommitInfo icebergCommitInfo : commitInfos) {
filesCommitter.doCommit(icebergCommitInfo.getResults()); // called per worker
}
}
```
Each doCommit() calls table.newAppend().commit() independently.
**Problems caused by this:**
1. No atomicity per checkpoint: If commit fails midway (e.g., after worker[0,1] succeed but worker[2] fails), the Iceberg table contains partial data visible to readers.
2. Duplicates on restore: preCommit() on pipeline restore re-commits files already committed in the previous checkpoint, causing duplicate rows in Iceberg.
3. Unnecessary snapshot proliferation: N snapshots per checkpoint instead of 1, increasing Iceberg metadata size proportionally to parallelism.
**Expected behavior:**
All workers' DataFiles/DeleteFiles should be merged into a single
AppendFiles (or RowDelta) operation per checkpoint, producing 1 snapshot:
```java
List<DataFile> allDataFiles = commitInfos.stream()
.flatMap(ci -> ci.getResults().stream())
.flatMap(wr -> wr.getDataFiles().stream())
.collect(toList());
List<DeleteFile> allDeleteFiles = commitInfos.stream()
.flatMap(ci -> ci.getResults().stream())
.flatMap(wr -> wr.getDeleteFiles().stream())
.collect(toList());
if (allDeleteFiles.isEmpty()) {
AppendFiles append = table.newAppend();
allDataFiles.forEach(append::appendFile);
append.commit();
} else {
RowDelta delta = table.newRowDelta();
allDataFiles.forEach(delta::addRows);
allDeleteFiles.forEach(delta::addDeletes);
delta.commit();
}
```
This matches how Flink's IcebergFilesCommitter works.
### SeaTunnel Version
2.3.12
### SeaTunnel Config
```conf
-
```
### Running Command
```shell
This is a code-level bug, not reproducible via a specific command.
The issue can be verified by inspecting Iceberg table snapshots after
a job run with parallelism > 1:
SELECT * FROM <catalog>.<db>.<table>.snapshots;
-- Expected: 1 snapshot per checkpoint
-- Actual: N snapshots per checkpoint (N = parallelism)
```
### Error Exception
```log
No exception thrown. This is a silent data correctness bug.
Partial commits and duplicate data occur without any error log.
```
### Zeta or Flink or Spark Version
Zeta
### Java or Scala Version
_No response_
### Screenshots
_No response_
### Are you willing to submit PR?
- [x] Yes I am willing to submit a PR!
### Code of Conduct
- [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
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: commits-unsubscribe@seatunnel.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][Connector-V2] IcebergAggregatedCommitter commits per worker instead of single atomic commit per checkpoint [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #10710:
URL: https://github.com/apache/seatunnel/issues/10710#issuecomment-4203450890
I checked the current commit path as well, and I agree this is a real bug. In the current `IcebergAggregatedCommitter`, the aggregated commit stage still ends up calling `filesCommitter.doCommit(...)` once per worker result set. That means a single checkpoint can still translate into multiple Iceberg commits, which is not the atomic per-checkpoint behavior we want from the aggregated committer layer.
I also checked the issue timeline and there is already a linked dev PR here: #10714. The main thing I would focus on in review is this: the fix should not just rearrange loops, it should really merge the checkpoint's write results into one atomic commit boundary.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][Connector-V2] IcebergAggregatedCommitter commits per worker instead of single atomic commit per checkpoint [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo commented on issue #10710:
URL: https://github.com/apache/seatunnel/issues/10710#issuecomment-4199240774
Thanks for reporting this. I checked the current commit path and I agree this looks like a real bug.
In the current implementation, `IcebergAggregatedCommitter` still iterates each worker commit info and calls `doCommit()` one by one, so it is not really performing a single checkpoint-level aggregated commit. The same pattern also shows up again in the restore/pre-commit path, which means this is not just a cosmetic naming issue.
I think the correct fix direction is:
1. collect all `WriteResult` objects for the same checkpoint
2. merge them first
3. execute one Iceberg table commit for that checkpoint
So I’d keep this issue open as a real bug / semantic gap in the current implementation.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][Connector-V2] IcebergAggregatedCommitter commits per worker instead of single atomic commit per checkpoint [seatunnel]
Posted by "nzw921rx (via GitHub)" <gi...@apache.org>.
nzw921rx commented on issue #10710:
URL: https://github.com/apache/seatunnel/issues/10710#issuecomment-4188743023
good joob
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug][Connector-V2] IcebergAggregatedCommitter commits per worker instead of single atomic commit per checkpoint [seatunnel]
Posted by "dybyte (via GitHub)" <gi...@apache.org>.
dybyte closed issue #10710: [Bug][Connector-V2] IcebergAggregatedCommitter commits per worker instead of single atomic commit per checkpoint
URL: https://github.com/apache/seatunnel/issues/10710
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org