Repository navigation
Description
Bug description
iceberg_rewrite_data_files successfully rewrites and commits Iceberg data files through a Nessie catalog, but its returned commit metadata is false or empty. The procedure reports snapshot_after=0, removed_file_count=0, an empty commit_id, and verified=0, while Spark observes a new non-zero rewrite_data_files snapshot and the file count has actually changed from 8 to 1.
Environment
- Branch:
main - Commit:
1f9e501594509fb5d2e0284833faf8c3426e2285 - Test date:
2026-08-17 - Deployment: local
1 CN + 1 TN + 1 LogService, DISK-V2 - External services: native MinIO
RELEASE.2025-09-06T17-38-46Z+ Nessie0.108.4 - Oracle: Spark
3.5.1, Iceberg1.6.1, JDK21.0.12 - Iceberg table: format v2, Parquet, unpartitioned
Steps to reproduce
- Through Spark, create a fresh Iceberg table in the same Nessie catalog and MinIO warehouse. Append 8 independent batches of 10 rows so the table contains 8 data files and 80 rows (
SUM(id)=3160). - Create the normal MatrixOne Iceberg catalog/access mapping for this table.
- Verify through MatrixOne that the table contains 80 rows and
SUM(id)=3160. - Run:
CALL iceberg_rewrite_data_files(
'native_t3',
'tiera',
'public_negative',
'maintenance_run_1',
'{"target-file-size-bytes":1048576}'
);- Read the returned maintenance result, then inspect the same table and its snapshots through Spark.
- Repeat with two fresh tables (
maintenance_run_2andmaintenance_run_3).
Actual behavior
All three fresh runs return the following shape from MatrixOne:
status=committed
snapshot_after=0
rewritten_file_count=8
removed_file_count=0
commit_id=''
verified=0
However, Spark confirms that every rewrite was committed:
| Table | Files before | Files after | Rows / checksum after | Spark rewrite snapshot |
|---|---|---|---|---|
maintenance_run_1 |
8 | 1 | 80 / 3160 |
2957571463810659778 |
maintenance_run_2 |
8 | 1 | 80 / 3160 |
1786896348434282000 |
maintenance_run_3 |
8 | 1 | 80 / 3160 |
4584431734387923674 |
MatrixOne can also read all three rewritten tables afterward and still returns 80 / 3160. Thus the rewrite itself succeeds; the procedure result does not describe the committed operation.
Expected behavior
For a successful committed rewrite:
snapshot_aftershould be the non-zero committed Iceberg snapshot ID.commit_idshould identify the committed Nessie/Iceberg change.verifiedshould reflect successful post-commit verification.- removed/rewritten file metadata should agree with the actual table transition.
- row count and checksum must remain unchanged.
Frequency
3/3 on three independently created tables.
Impact
Automation cannot safely determine whether maintenance was durably committed or verified. It may retry a successful rewrite or report false failure/success state even though the table has changed.
Initial analysis
The MatrixOne maintenance result type and procedure/workflow tests expect SnapshotAfter, CommitID, and verification state to be populated. The Nessie-backed commit path appears to complete the rewrite but drop or fail to propagate the returned commit/verification metadata.
This is separate from #27196: the minimal 8-file rewritten tables remain readable from MatrixOne. No large-data test is required because the metadata defect reproduces deterministically with 80 rows and 8 files.
Suggested regression
Add an external MinIO + Nessie maintenance scenario that:
- creates at least 8 small files;
- records the Spark snapshot and file count;
- calls
iceberg_rewrite_data_files; - asserts a non-zero/new
snapshot_after, a non-empty commit ID and successful verification; - cross-checks the returned snapshot against Spark/Nessie;
- asserts files are compacted and rows/checksum are unchanged;
- repeats on three fresh tables.
Related feature: #23359.
Activity
Ariznawlll commentedon Aug 17, 2026
测试版本
maine32c7dc95946c347710e706e70dfee2927bc84e0mo-service使用上述完整 SHA 构建原问题验证
在同一 Nessie/MinIO catalog 下创建 3 张 format v2、Parquet、无分区表,每张表通过 MatrixOne 连续写入 8 个独立 batch(共 80 行,
SUM(id)=3160,写入前 catalog manifest 中为 8 个 data file)。对maintenance_run_1/2/3分别执行:3/3 结果均为:
status=committed,snapshot_after为非零且与 Nessie 当前 snapshot 一致,rewritten_file_count=8,removed_file_count=8,commit_id非空,verified=1。实际返回:Happy Path 覆盖
added=1/deleted=8。COUNT(*)=80, SUM(id)=3160,数据未丢失或重复。maintenance_run_1返回同一 snapshot、rewritten_file_count=0、removed_file_count=0,无二次提交;审计表中前一次提交和本次 no-op 均为committed。mo_catalog.mo_iceberg_maintenance_jobs中三次提交的snapshot_after、重写/移除文件数与过程返回值一致。Unhappy Path 覆盖
ICEBERG_TABLE_NOT_FOUND,审计记录为failed,snapshot_after为空且文件计数为 0。target_file_size=0返回ICEBERG_CONFIG_INVALID,审计记录为failed,未产生 snapshot 或文件变更。白盒验证
最新 main 上
go test ./pkg/iceberg/maintenance ./pkg/sql/iceberg -count=1通过;针对空 commit metadata 恢复、native rewrite-data-files 结果映射和 verifier 的go test -race ./pkg/iceberg/maintenance -run 'TestCatalogFactoryCommitVerifierRecoversEmptyRewriteDataFilesCommitMetadata|TestMaintenanceProcedureExecutorRunsNativeRewriteDataFilesWithDefaultCompactor|TestCatalogCommitVerifier' -count=1通过。回归测试
现有
pkg/iceberg/maintenance/verifier_test.go与pkg/sql/iceberg/maintenance_executor_test.go已覆盖 Nessie 标准响应不带 snapshot/commit 字段时的元数据重载与结果补全;本次未修改测试代码,未新增 BVT/motr 文件。测试证据
/private/tmp/mo-27201-e2e-20260817/maintenance_run_{1,2,3}-call.out*-after.json、*-manifest-list.avro与审计查询输出/private/tmp/mo-27201-e2e-20260817/e2e-report/summary.md,4/4 passed测试结论
测试通过。