[fix](iceberg) Backport external write hardening to branch-4.1 - #66825
[fix](iceberg) Backport external write hardening to branch-4.1#66825Gabriel39 wants to merge 4 commits into
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
/review |
Cloud UT Coverage ReportIncrement line coverage Increment coverage report
|
There was a problem hiding this comment.
Request changes: this review found 11 actionable correctness and rolling-compatibility defects.
The blocking paths group into four areas: external-file report ownership can delete committed Iceberg files or strand Hive multipart uploads; mixed-version Hive/Iceberg writes can fail after staging or silently use the wrong partition source; Scanner V2 loses or misinterprets Iceberg requiredness and initial defaults; and current nested non-identity merge routing constructs transforms from the wrong type.
Critical-checkpoint summary: reader lifecycle and collection parent-null handling were cleared; async reservation transfer, spill accounting, and dependency wakeups were cleared; overwrite OCC/branch behavior and the orphan-file action remained fail-closed; but schema mapping/default materialization, external compatibility, nested partition routing, and report ownership have the inline blockers below. No additional user-provided focus was supplied. The review converged in Round 2 after both full-scope passes and the separate risk challenge returned no new valuable findings. Per the review workflow, no builds or source modifications were performed.
|
run buildall |
|
/review |
There was a problem hiding this comment.
Request changes: this review found seven additional actionable defects.
Critical-checkpoint summary:
- Correctness and data safety: top-level non-finite Iceberg defaults fail in FE before the new BE parser is reachable; orphan deletion can race a concurrent commit; and rejected final reports can leave prepared Paimon files without an abort owner.
- Resource lifetime and admission: cold partition fan-out and the final spill merger can both allocate far beyond their successful reservations.
- External compatibility and performance: a positive equality-delete summary still causes unnecessary remote manifest traversal during rolling-upgrade checks.
- Tests: the expanded complex-evolution suite has stale and missing golden results, so its checked-in expectations cannot pass.
The final-report state machine for the other inspected Iceberg/Hive/MaxCompute paths, nested partition routing, object-store publication, branch overwrite/OCC, reader lifecycle, and collection null handling were cleared. All 115 changed paths were reviewed, all 11 existing inline threads were duplicate-fenced, and two additional concerns were dismissed as pre-existing after authoritative-preimage checks. No additional user-provided focus was supplied. Three full rounds converged unanimously with no new valuable findings in the final round. Per the review instructions, no builds or source modifications were performed.
FE UT Coverage ReportIncrement line coverage |
|
run buildall |
|
/review |
There was a problem hiding this comment.
Request changes: seven additional, distinct defects remain (five P1, two P2).
Findings:
- [P1] Failed rewrite actions can permanently retain the new Iceberg commit fence.
- [P1] Target-file rollover can invoke a full sort without reserving destination/permutation workspace.
- [P1] Nontrivial ARRAY/MAP rematerialization still allocates an entry-sized parent mask when no descendant consumes it.
- [P1] Paimon backend close failures are discarded after FE has accepted commit payloads.
- [P1] Cold-writer reserve estimation copies a potentially huge first value before memory admission.
- [P2] The V2 gate rejects selected-snapshot/ref scans based on schemas that cannot contribute reachable files.
- [P2] The V2 gate expands a nested-pruned root to unrequested descendants, so an unused sibling can reject a V1-safe scan.
Review checkpoints:
- Architecture and layer boundaries: traced Scanner/TableReader/mapper/file-reader responsibilities and FE-to-Thrift-to-BE ownership. No separate boundary inversion survived review; the schema-gate and materialization defects are called out inline.
- Reader and transaction lifecycle/contracts: checked split/EOF/error cleanup, async queue tokens, report ACK/retry/finalizers, Iceberg fence/OCC paths, and writer close/rollback. The rewrite-fence leak and post-ACK Paimon close regression remain blocking.
- Schema mapping/materialization: checked stable field IDs, recursive defaults/optionality/binary markers, nested projection, ARRAY/MAP offsets/null maps, selected schemas, and partition paths. Three projection/materialization defects remain inline.
- Filtering, deletes, and pushdown: traced predicates plus equality/position-delete paths and row/schema alignment; no additional nonduplicate issue survived beyond prior live threads and the V2 projection gates above.
- Format boundaries and external compatibility: checked Iceberg V1/V2 rolling upgrade, time travel/refs, external schema evolution, Hive/Paimon reporting, nested partitions, and Azure/S3 multipart identity. The two mixed-version false rejections are inline; other reproduced compatibility concerns are already threaded.
- Performance and observability: reviewed admission, sorter rollover/spill/final merge, hot-path collection masks, report-size handling, counters, and cleanup visibility. Three unreserved/unbounded allocation paths remain inline.
- Tests: reviewed all changed BE/FE/regression tests. Coverage does not exercise the seven reported witnesses; no builds or tests were run, as required by the review prompt.
- User focus: no additional user-provided focus was supplied.
Status: capped/incomplete after the maximum three rounds because the final normal and final risk passes both produced new distinct findings; this is not a convergence claim.
FE UT Coverage ReportIncrement line coverage |
|
run buildall |
|
/review |
FE UT Coverage ReportIncrement line coverage |
What problem does this PR solve?
This is a semantic backport of the external-write and schema-evolution fixes from #66345, #66348, #66408, #66529, and #66750 to
branch-4.1.The source PRs were implemented on the connector-plugin architecture, while
branch-4.1still uses the legacy external-table stack. This change ports the invariants and failure handling to the branch-specific owners instead of mechanically cherry-picking plugin classes.Key behavior preserved on
branch-4.1:The Paimon validation-detail fix from #66408 and canonical
Paimoncapitalization from #66750 are already present in the legacy Paimon paths onbranch-4.1; their observable contracts were verified and no plugin-only code was introduced.Architecture-specific notes
Tests
SuiteJobLookupTest: 1 test passed.The full local BE unit-test link is unavailable because the configured third-party Arrow bundle lacks a header required by an unchanged source file; targeted compilation covers every changed translation unit.
Pick from master: #66345 #66348 #66408 #66529 #66750