Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions docs/en/introduction/concepts/incompatible-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,35 @@ You need to check this document before you upgrade to related version.
- **Impact**: A dataset created by this version has an `int64` column where an earlier version created `int32`. A dataset that already exists keeps its column types, because the sink writes to the schema it finds, so its `int32` column still wraps large values.
- **Migration Guide**: No configuration change is needed. If a consumer expects `int32` for these columns, update it to read `int64`. To store large values in a dataset created by an earlier version, recreate the dataset and write the rows again from the source.

### Flink sinks: reconcile restored commits and fail unresolved commits

Restored sink transactions now use the aggregated committer's idempotent `restoreCommit`
path. A final batch containing both restored and newly finished transactions is reconciled
as one recovery batch. Batches containing only fresh transactions continue to use `commit`.

An aggregated commit that returns unresolved transactions now fails the task instead of
acknowledging them or repeatedly retrying them at end of input. Recovery follows the Flink
restart strategy and the last completed checkpoint. For bounded jobs without a recoverable
checkpoint, the job fails rather than reporting success with missing output. Fix the sink
failure before restarting; no new configuration option is required.

Mixed multi-table JDBC XA recovery requires table-owned prepared-transaction cleanup
(#13109). Recovery cannot distinguish a transaction already resolved from one incorrectly
rolled back by a peer table. The generic Flink adapter does not repair that cleanup bug;
apply the ownership fix before rolling out this recovery path.

Iceberg recovery also requires payload-based replay protection (#12881). Flink writer
checkpoint counters are not globally unique; deduplication by a counter alone can skip
uncommitted end-of-input files. Apply the Iceberg replay fix and validate it with this
adapter before enabling recovery for those jobs. The generic adapter does not replace
connector-specific publication checks.

Flink 1.13 and 1.15–1.18 retain their existing committable format and operator identities.
Flink 1.20 reads existing version-0 committable state but writes version 1, which includes the
checkpoint id. Savepoints containing version-1 committables cannot be restored by older
SeaTunnel versions. Retain a pre-upgrade savepoint if rollback is required; do not use a
post-upgrade savepoint to roll back.

### Databend source: a DECIMAL column is read as DECIMAL instead of STRING

- **Behavior change: a Databend `DECIMAL(p, s)` column reaches the job as `DECIMAL(p, s)`**
Expand Down
23 changes: 23 additions & 0 deletions docs/zh/introduction/concepts/incompatible-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@
- **影响**:本版本创建的数据集中该列为 `int64`,而早期版本创建的是 `int32`。已经存在的数据集保留原有的列类型,因为 Sink 会按已有的 schema 写入,所以其中的 `int32` 列仍会回绕较大的值。
- **迁移指南**:无需修改配置。如果下游按 `int32` 读取这些列,请改为读取 `int64`。若要在早期版本创建的数据集中存储较大的值,请重新创建数据集,并从数据源重新写入数据。

### Flink Sink:恢复事务提交并在提交未完成时失败

恢复的 Sink 事务现在通过聚合提交器的幂等 `restoreCommit` 路径处理。如果最终批次同时包含
恢复的事务和恢复后新完成的事务,整个批次都通过恢复提交路径协调。仅含新事务的批次仍使用 `commit`。

聚合提交返回未完成的事务时,任务现在会失败,不再将这些事务视为提交成功,也不会在输入结束时
无限重试。恢复遵循 Flink 的重启策略及最近完成的检查点。没有可恢复检查点的有界任务会失败,
而不是在输出缺失时报告成功。请先排除 Sink 故障再重启任务;无需新增配置。

多表 JDBC XA 的混合事务恢复依赖按表限定的预备事务清理(#13109)。恢复路径无法区分
已正常完成的事务与被其他表错误回滚的事务。通用 Flink 适配器不会修复此清理问题;
启用该恢复路径前,请先应用事务归属修复。


Iceberg 恢复还依赖基于提交内容的重放保护(#12881)。Flink Writer 的 checkpoint 计数器
不是全局唯一标识;仅按计数器去重可能跳过尚未提交的 end-of-input 文件。请先应用
Iceberg 重放修复,并与本适配器组合验证后再使用这些作业的恢复功能。通用适配器不能
代替连接器自身的发布检查。

Flink 1.13 和 1.15–1.18 的提交信息格式及算子标识保持不变。Flink 1.20 可以读取现有的版本 0
提交状态,但写入包含检查点标识的版本 1。旧版 SeaTunnel 无法恢复包含版本 1 提交信息的
保存点。如需回滚,请保留升级前的保存点,不要使用升级后生成的保存点回滚。

### Databend Source:DECIMAL 列按 DECIMAL 读取,而不再是 STRING

- **行为变更:Databend 的 `DECIMAL(p, s)` 列在作业中的类型为 `DECIMAL(p, s)`**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
import org.apache.seatunnel.api.table.type.SeaTunnelRow;
import org.apache.seatunnel.translation.flink.schema.BroadcastSchemaSinkOperator;
import org.apache.seatunnel.translation.flink.sink.FlinkSink;
import org.apache.seatunnel.translation.flink.sink.RecoveryAwareSink;

import org.apache.flink.api.common.typeinfo.TypeInformation;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.datastream.DataStreamSink;
import org.apache.flink.streaming.api.transformations.SinkV1Adapter;

import java.net.URL;
import java.util.List;
Expand Down Expand Up @@ -65,7 +65,7 @@ protected DataStreamSink<SeaTunnelRow> createVersionSpecificDataStreamSink(
.setParallelism(parallelism);
}
return ds.sinkTo(
SinkV1Adapter.wrap(
RecoveryAwareSink.wrap(
new FlinkSink<>(sink, stream.getCatalogTables(), parallelism)))
.name(String.format("%s-Sink", sink.getPluginName()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
import java.util.Random;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.zip.GZIPOutputStream;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
Expand Down Expand Up @@ -376,7 +377,15 @@ public class LocalFileIT extends TestSuiteBase {
"/seatunnel/read/recursive/subdir/deeper/final/e2e.txt",
container);

container.execInContainer("mkdir", "-p", "/tmp/fake_empty");
Container.ExecResult create =
container.execInContainer(
"mkdir", "-p", "/tmp/fake_empty", "/seatunnel/read/binary2");
Assertions.assertEquals(0, create.getExitCode(), create.getStderr());
// Fixture setup runs as root; engine workers may run as a different user.
Container.ExecResult permissions =
container.execInContainer(
"chmod", "1777", "/tmp/fake_empty", "/seatunnel/read/binary2");
Assertions.assertEquals(0, permissions.getExitCode(), permissions.getStderr());
};

@TestTemplate
Expand Down Expand Up @@ -462,6 +471,22 @@ public void testLocalFileOrcParquetBinaryXml(TestContainer container)
helper.execute("/parquet/local_file_parquet_projection_to_assert.conf");
helper.execute("/parquet/local_file_to_console.conf");
helper.execute("/binary/local_file_binary_to_local_file_binary.conf");
AtomicBoolean binaryCopied = new AtomicBoolean();
container.executeExtraCommands(
engine -> {
Container.ExecResult comparison =
engine.execInContainer(
"sh",
"-c",
"if test -f /seatunnel/read/binary2/cat.png; then "
+ "cmp /seatunnel/read/binary/cat.png "
+ "/seatunnel/read/binary2/cat.png && printf matched; fi");
Assertions.assertEquals(0, comparison.getExitCode(), comparison.getStderr());
if ("matched".equals(comparison.getStdout().trim())) {
binaryCopied.set(true);
}
});
Assertions.assertTrue(binaryCopied.get(), "Missing committed binary copy");
if (!container.identifier().getEngineType().equals(EngineType.FLINK)) {
helper.execute("/binary/local_file_binary_to_assert.conf");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@
import org.apache.seatunnel.e2e.common.junit.TestContainerExtension;
import org.apache.seatunnel.e2e.common.util.ContainerUtil;

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.TestTemplate;
import org.testcontainers.containers.Container;

import java.io.IOException;
import java.util.HashSet;
import java.util.Set;

@DisabledOnContainer(
value = {TestContainerId.SPARK_2_4},
Expand Down Expand Up @@ -70,14 +74,44 @@ public class LocalFileWithMultipleTableIT extends TestSuiteBase {
"/seatunnel/read/binary/name=tyrantlucifer/hobby=coding/cat.png",
container);

container.execInContainer("mkdir", "-p", "/tmp/fake_empty");
Container.ExecResult create =
container.execInContainer("mkdir", "-p", "/tmp/fake_empty");
Assertions.assertEquals(0, create.getExitCode(), create.getStderr());
// Fixture setup runs as root; engine workers may run as a different user.
Container.ExecResult permissions =
container.execInContainer("chmod", "1777", "/tmp/fake_empty");
Assertions.assertEquals(0, permissions.getExitCode(), permissions.getStderr());
};

@TestTemplate
public void testFakeToLocalFileInMultipleTableMode_text(TestContainer testContainer)
throws IOException, InterruptedException {
TestHelper helper = new TestHelper(testContainer);
helper.execute("/text/fake_to_local_file_with_multiple_table.conf");
Set<String> committedTables = new HashSet<>();
testContainer.executeExtraCommands(
container -> {
for (String table : new String[] {"fake1", "fake2"}) {
String path = "/tmp/fake_empty/text/" + table;
Container.ExecResult output =
container.execInContainer(
"sh",
"-c",
"if test -d '"
+ path
+ "'; then find '"
+ path
+ "' -type f -name '*.txt' -size +0c -print -quit; fi");
Assertions.assertEquals(0, output.getExitCode(), output.getStderr());
if (!output.getStdout().trim().isEmpty()) {
committedTables.add(table);
}
}
});
Assertions.assertTrue(
committedTables.contains("fake1"), "Missing committed output for fake1");
Assertions.assertTrue(
committedTables.contains("fake2"), "Missing committed output for fake2");
}

@TestTemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,27 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-streaming-java</artifactId>
<version>${flink.1.15.3.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-runtime</artifactId>
<version>${flink.1.15.3.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>flink-test-utils-junit</artifactId>
<version>${flink.1.15.3.version}</version>
<scope>test</scope>
</dependency>

</dependencies>

</project>
Loading
Loading