Repository navigation
[Fix][Zeta] Ignore unknown table schema changes - #11328
davidzollo merged 2 commits into
Conversation
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks for working on this. I re-reviewed the latest head from the real engine schema-change path because SeaTunnelSourceCollector sits directly on the source -> engine handoff.
What this PR fixes
- User pain: in multi-table CDC jobs, an out-of-scope schema change event can currently hit
SeaTunnelSourceCollectorwith a table id that is not present in the currentMultipleRowTypemap. - Fix approach: guard the
rowTypeMaplookup, log the skipped table id, and return early instead of passingnullinto the schema-change handler. - One-line summary: this is a focused engine-side NPE prevention on the unknown-table path, and it stays off the normal known-table schema-change flow.
Runtime chain I checked
multi-table source schema change
-> SeaTunnelSourceCollector.collect(SchemaChangeEvent)
-> if rowType is MultipleRowType
-> tableId = event.tablePath().toString()
-> lookup rowTypeMap.get(tableId)
-> known table: apply DataTypeChangeEventHandler and forward event
-> unknown table: warn and return without touching downstream outputs
Findings
- Before this patch, the unknown-table path called
dataTypeChangeEventHandler.reset(rowTypeMap.get(tableId)).apply(event)directly, so an absent entry could fall through withnullon the real engine path. - On the latest head, the guard at
SeaTunnelSourceCollector.java:262-282only changes the absent-table branch. Known tables still updaterowTypeMapand still forward the schema change event downstream. - The added test in
SeaTunnelSourceCollectorSchemaChangeTest.java:50-81covers the important behavior change directly: an unknown-table alter event no longer reachesoutput.received(...).
I did not find a reopened blocker in the current implementation.
Merge conclusion
Conclusion: mergeable from Daniel's source-review side
- Blocking items
- None from the engine path I rechecked.
- Suggested follow-up
- None from this round.
This looks like a precise guard on the bad-path NPE without widening the behavior of the normal multi-table schema-change flow.
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks for the update. I rechecked the latest head against the current gate state again.
Runtime path revisited: multi-table CDC schema-change event -> source-side table filter -> engine collector guard in SeaTunnelSourceCollector. I still do not see a reopened source-side blocker on ea7d023b0ef46174e33c9904079c54cd4e0b93eb.
The remaining signal is still operational rather than source-level: the latest Build ended as cancelled, and this branch is also behind the latest dev (behind_by=4, compare status diverged). So the lowest-cost next step is to sync with the latest dev and rerun CI on the refreshed head first.
Merge conclusion: can merge after CI / branch sync is clean
- Blocking items
- No new source-level blocker from Daniel's side on the current head.
- Please sync the latest
devand rerun CI, because the current cancelled gate is not yet a meaningful merge signal.
- Suggested follow-up
- If the refreshed head still fails, please share that exact failing lane and I can narrow it down on top of the updated revision.
…nown-schema-change
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks for the update. I re-reviewed the latest head from the multi-table schema-change path.
What this PR fixes
- User pain: a schema-change event for a table that is not currently tracked in the multi-table row-type map can crash the source collector path.
- Fix approach: look up the current table schema first, and if the table is unknown, log and ignore that event instead of dereferencing
null. - One-line summary: this patch turns an unexpected schema-change event for an unknown table from a task-failing path into a safe ignore path.
Runtime path I checked
schema change event arrives
-> SeaTunnelSourceCollector.collect(SchemaChangeEvent)
-> rowType is MultipleRowType
-> rowTypeMap.get(tableId)
-> if missing: warn and return
-> if present: apply DataTypeChangeEventHandler
Findings
- The null-guard is on the normal collector path, so the fix will actually be hit when these stray events arrive.
- The new test covers the unknown-table branch directly.
- I do not see a reopened source-level blocker in the current diff.
Merge conclusion
Conclusion: can merge after fixes
- Blocking items
- No new code-side blocker from Daniel's side.
- The current
Buildis still in progress, so I would wait for the latest CI to finish green before merging.
- Suggested non-blocking follow-up
- None from this round.
DanielLeens
left a comment
There was a problem hiding this comment.
Thanks for the update. I rechecked the current head 77a5afb28f again.
The source-level conclusion from my previous Daniel round is unchanged for me:
- I still do not see a reopened code-side blocker on the multi-table schema-change guard path.
The important change in this round is that the previous Daniel review had already narrowed the remaining gate down to CI only, and the latest Build is now green on the same head. So this is the exact case where I would move from “waiting on CI” to approval.
Merge conclusion
Conclusion: can merge
- Blocking items
- None from Daniel's source-review side on the current head.
- Suggested follow-up
- None.
Rechecked on the current head: the earlier source blocker is still cleared for me, and the only remaining gate from the previous round was CI. Now that CI is green as well, I’m happy to approve.
Purpose of this pull request
Fixes #10371.
When a multi-table CDC source receives a schema change event for a table that is not present in the current
MultipleRowType,SeaTunnelSourceCollectorcurrently passesnullinto the schema-change handler and can fail with aNullPointerException.This can happen when the upstream CDC engine emits a DDL event for a table that is not part of the SeaTunnel table map, for example after table filtering or when the reported table is outside the produced table set.
This PR makes the source collector ignore schema change events for unknown tables and logs the skipped table id instead of failing the task.
Does this PR introduce any user-facing change?
No. It only prevents an internal NPE for schema change events from unknown tables.
How was this patch tested?
./mvnw -pl seatunnel-engine/seatunnel-engine-server -DskipIT -Dskip.spotless=true -Dtest=SeaTunnelSourceCollectorSchemaChangeTest test./mvnw spotless:apply./mvnw -q -DskipTests verify