leonardBang commented on code in PR #4519:
URL: https://github.com/apache/flink-cdc/pull/4519#discussion_r3900202255
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base/src/main/java/org/apache/flink/cdc/connectors/base/source/reader/external/IncrementalSourceStreamFetcher.java:
##########
@@ -221,9 +221,10 @@ protected boolean shouldEmit(SourceRecord sourceRecord) {
}
// not in the monitored splits scope, do not emit
return false;
+ } else if (taskContext.isSchemaChangeEvent(sourceRecord)) {
Review Comment:
Would it make sense to first verify that an excluded relation-schema record
can reach this branch through the production path?
`RelationAwarePostgresSchema.applySchemaChangesForTable()` already checks
`!isFilteredOut(table.id())` before dispatching, and Debezium's parent
implementation applies the same table filter. The new test directly calls
`CDCPostgresDispatcher.dispatch(excludedTable)`, so it bypasses that gate and
only covers an artificially queued record. Could we add a test that produces an
actual excluded-table relation/DDL event (or point to the path that bypasses
this filter)? If none exists, this base fetcher API extension may be
unnecessary.
##########
flink-cdc-connect/flink-cdc-source-connectors/flink-cdc-base/src/main/java/org/apache/flink/cdc/connectors/base/source/reader/external/FetchTask.java:
##########
@@ -66,6 +66,14 @@ interface Context {
boolean isDataChangeRecord(SourceRecord record);
+ /** Returns whether the given record is a schema change event. */
+ boolean isSchemaChangeEvent(SourceRecord record);
Review Comment:
Could `isSchemaChangeEvent` be a default method returning `false`?
`FetchTask.Context` is public, and adding an abstract method forces every
existing implementation to recompile or implement it. Returning `false` retains
the previous behavior here—records that are not data changes continue to fall
through to the existing emit path—while Postgres can override it. This would
also remove the need for a no-op MongoDB override.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]