Repository navigation
Conversation
### What problem does this PR solve? Issue Number: None Related PR: apache#69392 Problem Summary: Iceberg delete and Puffin files were committed using the normalized storage URI instead of the table's original data location. Other engines could resolve those paths with the wrong file system. Carry the write and metadata locations together for data, position-delete, and Puffin files, join trailing separators consistently, and retain the write path for cleanup. Backport the BE path fix and relevant tests to branch-4.2. Adapt writer tests to the release branch interfaces and add planner coverage for raw versus normalized paths. Omit FE commit-location rejection and the external-file report ACK prerequisite from apache#66348, as those mechanisms are not on this branch. ### Release note Preserve the table's original URI in newly written Iceberg file metadata, including position deletes and deletion vectors, and handle trailing slashes in custom data locations consistently. ### Check List (For Author) - Test: Unit Test - 16 FE planner sink tests passed; clang-format 16, Java Checkstyle, patch comparison, and whitespace checks passed. BE UT build was attempted but blocked by macOS/Clang baseline incompatibilities. clang-tidy reported macro/baseline lint diagnostics. Iceberg regression was not run because the external fixture was unavailable. - Behavior changed: Yes - newly committed file paths retain the table's URI; sinks missing required locations fail before creating files. - Does this need documentation: No Adapted partial backport of commit b78c656.
### What problem does this PR solve? Issue Number: None Related PR: apache#69392 Problem Summary: Release branches accept Iceberg file reports without validating their raw sink locations. A writer reporting a normalized s3:// path for an oss://, s3a:// or abfss:// location can publish an unreadable file address. Register the locations from the bound sinks and validate the entire collected file list before staging INSERT, overwrite, DELETE, MERGE or rewrite updates. Propagate failure through the existing transaction completion path. Preserve empty static overwrites and register rewrite groups on their shared transaction. This adapts the FE guard without the external-report ACK and cleanup changes. ### Release note Reject Iceberg writes whose reported files are outside their sink's raw locations. Upgrade BE before FE when applying the location fix. Failed-file cleanup retains the release branch's existing behavior. ### Check List (For Author) - Test: 83 focused FE unit tests passed via run-fe-ut.sh; Maven Checkstyle passed. - Unit Test: transaction staging, path rejection, executor registration, empty static overwrite, SQL error propagation and existing sink tests. - Behavior changed: Yes; invalid file paths fail before Iceberg updates are staged. - Does this need documentation: No
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
### What problem does this PR solve? Issue Number: None Related PR: apache#69392 Problem Summary: The 4.2 coverage fixture bypasses planning and constructs Iceberg transactions directly. It never registers a raw sink location, so the backported validation rejects its s3://bucket/events files before the existing transaction assertions run. Ten of eleven transaction coverage tests failed. Register the matching table, delete, or merge sink in beginWrite, adapting upstream 52c04ac to the release branch. Also add risk R19, case W20, and the file-location suite to the existing P0 coverage matrix. ### Release note None ### Check List (For Author) - Test: Unit Test; run-fe-ut.sh executed 117 tests across 15 classes, with 111 passing, 6 pre-existing disabled tests skipped, and no failures or errors. The transaction coverage class passed all 11 tests; all 4 known-bug cases remain disabled. Maven Checkstyle and git diff --check passed. - Behavior changed: No - Does this need documentation: Yes; update the requested existing coverage matrix in this commit.
|
run buildall |
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
### What problem does this PR solve? Issue Number: None Related PR: apache#69392, apache#70173, apache#69841, apache#70185 Problem Summary: Merge the latest branch-4.2 into the Iceberg file-location backport. Preserve the session partition-overwrite mode together with bound-sink location registration. Adapt the newly added Parquet writer test to IcebergOutputLocation, and update overwrite fixtures for explicit modes, retained snapshots, and registered commit locations. Check path acceptance and rejection for both static and dynamic overwrite modes. ### Release note None ### Check List (For Author) - Test: Unit Test via run-fe-ut.sh --run (16 related FE classes; 122 passed, 6 pre-existing disabled cases skipped, zero failures or errors); Java Checkstyle; clang-format 16; Parquet test translation-unit syntax check via clang-tidy and the existing ASAN compilation database. BE unit tests and external regressions are delegated to CI. - Behavior changed: No; preserve both the release branch's overwrite behavior and this PR's file-location validation. - Does this need documentation: No
|
run buildall |
|
/review |
There was a problem hiding this comment.
Static review of all 37 changed paths at 06c11a2. One new P2 finding: rewrite-group registration can lose the enclosing transaction during a catalog reset. No existing inline findings to retain or duplicate.
The raw/normalized location pairing fixes the intended data-file, position-delete and Puffin metadata paths. The inline finding identifies a separate rewrite lifecycle regression.
| Required checkpoint | Conclusion |
|---|---|
| Goal and proof | Producer-to-commit paths and test assertions inspected; raw metadata location behavior is covered. No runtime proof was executed. |
| Scope and clarity | Changes are focused on paired paths, bound-sink registration and validation before staging. |
| Concurrency and locks | Report append precedes completion latch release; rewrite waits all groups. Location registration/validation share the transaction monitor and perform no I/O under it. Catalog reset exposes the inline P2. |
| Lifecycle and initialization | Per-writer location ownership and physical cleanup remain paired; the new group lookup violates the enclosing transaction's retained manager lifetime. No new static-initialization dependency or reference cycle found. |
| Configuration | No new configuration or dynamic-change behavior. |
| Compatibility | No storage-format change. Base FE already sends both location forms. New FE intentionally rejects old BE normalized delete reports for aliased locations; the documented BE-before-FE upgrade order is required. |
| Thrift/protobuf | Thrift edits are comments only. Touched definitions were compared with live master, 4.2, 4.1, 4.0 and 3.1: no introduced ID/type/enum/required-field incompatibility. No protobuf change. |
| Parallel paths | INSERT, CTAS, branch insert, static/dynamic overwrite, empty overwrite, DELETE, UPDATE/MERGE, rewrite groups, partition routing, sorted rollover, position deletes and deletion vectors traced. |
| Special conditions | Missing-location errors fail before file creation; empty overwrites correctly need no BE sink. Prefix validation includes a directory separator. |
| Tests | Inspected positive/negative transaction and registration tests, mixed valid/invalid batches, raw/normalized/sibling paths, custom roots, trailing separators, Azure authority and physical Parquet/Puffin assertions. The reset window in the finding lacks coverage. |
| Expected results | Active DML expected output remains; only the obsolete .out.org backup is removed. New regression assertions need no golden file. |
| Observability | Existing path-bearing validation errors and writer/transaction logs cover the new gate; no additional metric requirement identified. |
| Transactions and persistence | All four finish paths validate before native Iceberg staging. This adds transient external-transaction state, with no new EditLog/replay protocol. Native commit remains the atomic publication boundary. |
| Writes, crashes and failure | Error propagation reaches statement failure/rollback; physical cleanup still uses write paths. Existing crash/failed-write orphan-file limitations remain as documented. No new partial publication found. |
| FE-BE variables | No new wire field or sending path; existing raw/normalized sink fields are reused. |
| Performance and memory | Validation scales with files times distinct roots, normally one root; rewrite roots deduplicate. No new per-row allocation, untracked large buffer, heavy lock operation or demonstrated performance regression found. |
| Other issues / focus | Further checks covered previous-DV read normalization, constructor consumers and alternate executor paths. No second finding; no additional user focus was supplied. |
Static inspection only: no builds, tests, benchmarks, source modifications or submodule initialization. Runtime and external-storage behavior remain unexecuted validation limits. Review converged after 2 rounds; all candidates and risk items have evidence-backed dispositions, with no unresolved static coverage gaps.
Review converged after 2 round(s).
|
|
||
| /** Bind the enclosing rewrite transaction after this group's sink has been finalized. */ | ||
| public void bindTransaction(long transactionId) throws UserException { | ||
| IcebergTransaction transaction = (IcebergTransaction) transactionManager.getTransaction(transactionId); |
There was a problem hiding this comment.
[P2] Register rewrite locations on the enclosing transaction
The shared rewrite transaction is created by RewriteDataFileExecutor on its original manager, but each group captures the catalog's current manager in BaseExternalTableInsertExecutor. If a catalog reset occurs after RewriteTableCommand's planner.plan() returns and before its executor is constructed, that captured manager is null (or a replacement that has no shared transaction). This new lookup then aborts rewrite_data_files with a null dereference or "Can't find transaction", even though the enclosing transaction and its retained lease are still valid. Previously this step only assigned the existing transaction ID to the coordinator. Pass the enclosing transaction/original manager into the group binding, or resolve that ID through the existing global transaction registry.
What problem does this PR solve?
Issue Number: None
Related PR: #69392
Problem Summary:
Backport #69392 to branch-4.2. Iceberg DELETE/UPDATE/MERGE could record position-delete and Puffin files under BE's normalized
s3://address even when the table usesoss://,s3a://, orabfss://. These metadata paths can prevent Doris and other engines from reading the files.BE now derives physical I/O paths and raw metadata paths from one output location for data files, position deletes, and deletion vectors. FE registers the raw locations from the actual bound sinks and validates the entire collected file list before staging INSERT/overwrite, DELETE, MERGE, or rewrite updates.
Release-branch adaptation:
Release note
Fix Iceberg files being committed with normalized storage addresses instead of their raw table data locations. Reject out-of-location file paths before staging Iceberg updates. Upgrade BE before FE: an older BE that reports normalized delete-file paths will be rejected by the upgraded FE. Failed writes can still leave uncommitted files under the release branch's existing cleanup behavior.
Check List (For Author)
run-fe-ut.sh --run(117 discovered; 6 pre-existing disabled tests skipped), covering transactions, all four completion paths, raw/normalized and directory-prefix rejection, sink registration, empty static overwrite, rewrite groups, and SQL failure propagation.IcebergWriteTransactionCoverageTest: all 11 cases passed after adapting the 4.2 fixture. The 4IcebergWriteKnownBugsTestcases remain disabled as before.build.sh; the generated BE binary passed--version. FE UI was skipped. Local Clang 22 compatibility options and LLVM archiving tools were used for baseline macOS toolchain issues and are not part of this PR.ann_index_edge_case_test.cppbecauseset(long)is ambiguous on macOS. The changed Iceberg production translation units compiled successfully; validate the complete test suite in CI.Check List (For Reviewer who merge this PR)