Skip to content

fix(external): propagate NULL append failures - #29342

Merged
XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/issue-29262-external-null-append
Sep 24, 2026
Merged

XuPeng-SH merged 2 commits into
matrixorigin:mainfrom
XuPeng-SH:codex/issue-29262-external-null-append

Conversation

@XuPeng-SH

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • BUG

Which issue(s) this PR fixes:

Fixes #29262

What this PR does / why we need it:

Return allocation errors from both external materialization paths that append NULL values: explicit NULL/empty fields and missing trailing fields. Previously these paths could return success after leaving an off-heap batch with unequal column lengths. Existing reader and tolerant-mode error handling can now abort or roll back the row.

Regression: deterministic capped-MPool test reproduces both silent-success cases on main and passes with this fix. Full external and insert package tests, go build, go vet, and scoped golangci-lint passed.

Object-writer batch-length preflight is a separate persistence-boundary hardening concern and is not bundled into this external fix.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed current head 82fc302. No blocking findings. The NULL append errors now propagate from both the explicit NULL conversion path and the missing trailing field path. I traced the error through CsvReader/KafkaReader ReadBatch to External.Call, which closes the reader and clears the partial batch on failure; the error-tolerant path rolls vector lengths back before emitting its reject row. The focused regression test covers explicit NULL and missing-field inputs under allocation pressure, and the current-head CI checks are green. This is a self-authored PR COMMENT, not an approval.

@XuPeng-SH XuPeng-SH left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deep review of head 82fc302cd2b6 completed. I found no blocking correctness or unhappy-path issues. Both NULL append failures now propagate; the ordinary path prevents the partial batch from being published, while tolerant mode restores the saved vector lengths before building the reject row, and propagates any failure while building that row. Reader and Kafka cleanup paths also close the partial-read state without publishing a Kafka progress handoff.

Validation: the two regression cases fail on the clean merge-base with the expected “error expected, got nil” result and pass on this head. The external and insert package suites, build, and vet pass. Additional local fault-injection checks passed for explicit/mapped/missing NULL values, first/second column failures, tolerant rollback, CSV/JSONLINE publication, and Kafka cleanup.

Suggestion: consider retaining regression coverage for tolerant rollback and the External.Call no-partial-batch boundary alongside the two current white-box cases. These are coverage improvements; I found no demonstrated functional defect.

This branch was previously deployed

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

Labels

kind/bug Something isn't working size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: external scan ignores a NULL append failure and can publish a short column

2 participants