Skip to content

[Bug]: Iceberg append_only mapping permits DELETE then cannot read its own table #27211

Closed

Description

@Ariznawlll

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

main

Commit ID

b7125ed

Other Environment Information

- Branch: main
- Commit: b7125edccd610e96039bd84b0213a2beb6583877
- Topology: local 1 CN + 1 TN + 1 LogService, DISK-V2
- External catalog: Nessie 0.108.4 + MinIO; Oracle: Spark 3.5.1 + Iceberg 1.6.1; Iceberg format v2 / Parquet

Actual Behavior

An external table declared with read_mode=append_only, write_mode=append_only accepts DELETE instead of rejecting it. The DELETE commits a delete manifest, so a subsequent SELECT through the same append-only mapping fails with ICEBERG_UNSUPPORTED_FEATURE ... delete-manifest.

The DELETE unexpectedly succeeded in 3/3 independent tables. Remapping each resulting table as merge_on_read shows that id=2 was actually removed, so this is a committed state mutation rather than a client-only success response.

Expected Behavior

write_mode=append_only must reject UPDATE/DELETE/MERGE before any external commit, preserving the table readably append-only. Row DML is supported under the explicit merge-on-read mode, not by silently converting an append-only table into a state its own reader rejects.

Steps to Reproduce

1. Create a Spark Iceberg v2 Parquet table with merge-on-read delete/update properties and rows `(1,100,'a'), (2,200,'b'), (3,300,'c')`.
2. In MatrixOne map it with:

CREATE EXTERNAL TABLE mor_append (id BIGINT,balance BIGINT,region TEXT) ENGINE=ICEBERG WITH (
  'catalog'='coverage_cat', 'namespace'='mor_dml', 'table'='r1',
  'ref'='main', 'read_mode'='append_only', 'write_mode'='append_only'
);

3. Execute `DELETE FROM mor_append WHERE id=2;`. It returns success.
4. Execute `SELECT COUNT(*) FROM mor_append;`. It now fails because the committed delete manifest is unsupported by append-only read mode.
5. Drop the mapping and recreate it with both modes `merge_on_read`; it reads the committed state without id=2.
6. Repeat with three independently created remote tables.

Additional information

Controls:

  • read_mode=merge_on_read, write_mode=merge_on_read correctly completed INSERT, UPDATE, DELETE and MERGE in all 3 rounds; MatrixOne and Spark both observed final rows (1,110,a),(3,333,c),(4,400,d),(5,500,e).
  • write_mode=read_only correctly rejects INSERT and leaves the remote table unchanged in all 3 rounds.
  • This is a mode-enforcement error: append-only must fail closed before it makes an incompatible commit.

Regression suggestion: create a v2 MoR-capable table, assert append-only INSERT succeeds, then assert DELETE/UPDATE/MERGE are rejected and the remote snapshot/row set remain unchanged. Add a merge-on-read positive control. No big-data data set is needed.

Activity

  1. added
    kind/bug
    on Aug 17, 2026
  2. changed the title [-][Bug]:[/-] [+][Bug]: Iceberg append_only mapping permits DELETE then cannot read its own table[/+] on Aug 17, 2026
  3. added theissue type on Aug 17, 2026
  4. added this to the MO-202608 milestone on Aug 17, 2026
  5. added
    ai-easy
    on Aug 18, 2026
  6. Ariznawlll commented on Aug 19, 2026

    @Ariznawlll
    CollaboratorAuthor

    测试版本

    • 分支:main
    • commit:b5c948130897783c544e12ab83bfd94702282f89
    • 测试日期:2026-08-19
    • 环境:macOS arm64;Iceberg DML runtime factory 回归

    原问题验证

    原问题是 read_mode=append_only, write_mode=append_only 的 Iceberg mapping 错误允许 DELETE,随后产生 delete manifest,导致同一 mapping 无法读取。

    Happy Path 覆盖

    1. append-only mapping 的 append 写入路径保持可用。
    2. merge-on-read mapping 的正常 DML 路径保持可用。

    Unhappy Path 覆盖

    TestDMLRuntimeFactoryRejectsAppendOnlyRowDMLBeforeCatalogAccess 验证 append-only mapping 的 row DELETE 在访问 catalog 前即被拒绝;不会提交 delete manifest,也不会污染后续读取状态,3/3 通过。

    白盒验证

    执行 go test ./pkg/sql/iceberg -run '^TestDMLRuntimeFactoryRejectsAppendOnlyRowDMLBeforeCatalogAccess$' -count=3,全部通过。对应修复为 PR #27255,commit 35e0bd5eb。

    回归测试

    该场景依赖 Iceberg/Nessie/对象存储 DML,不适合普通 MOTR SQL suite;保留 Iceberg DML integration suite。

    大数据评估

    不需要新增 big-data。缺陷是 DML mode 规则校验和提交原子性问题,单表单行即可覆盖。

    测试结论

    测试通过。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai-easykind/bug

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions