失败时flink如何处理开启的事务

How does flink deal with the opened transaction when failure happens

我使用的是Flink 1.12.0,遇到了关于Flink 2PC端到端一致性保证机制的问题

checkpoint开始时开启一个事务,checkpoint成功完成后提交事务。

那如果失败了怎么办?我认为打开的交易应该回滚?还回滚事务时?谢谢。

因为 Operator 和 Task Manager 分布在一个集群中,Flink 必须确保所有组件都一致才能声明提交成功。如您所说,Flink 使用两阶段提交协议,并带有预提交。 pre-commit 是在检查点期间处理失败的关键,正如它在 documentation

上所说

The pre-commit phase finishes when the checkpoint barrier passes through all of the operators and the triggered snapshot callbacks complete.