YasuoStudyJava opened a new pull request, #4642: URL: https://github.com/apache/flink-cdc/pull/4642
Linked Jira: https://issues.apache.org/jira/browse/FLINK-41777 ### Purpose of this pull request Fix a bug where Oracle Pipeline jobs fail on startup in pure-stream modes (`latest-offset`, `timestamp`, `specific-offsets`) with: `io.debezium.DebeziumException: The db history topic or its content is fully or partially missing.` ### Cause & Solution - **Cause:** In pure-stream mode the stream split carries no snapshot schema, so `IncrementalSourceReader#discoverTableSchemasForStreamSplit` re-discovers table schemas via `OracleDialect#discoverDataCollections` → `OracleConnectionUtils#listTables`. That query restricts results with `TABLESPACE_NAME IS NOT NULL AND TABLESPACE_NAME NOT IN ('SYSTEM','SYSAUX')`, while the tables captured at pipeline build time (`OracleSchemaUtils#listTables`) are listed with no tablespace restriction. A captured table stored in the `SYSTEM` tablespace is therefore listed at build time and put into `table.include.list`, but never discovered at runtime → empty discovered schema set → empty embedded database history → `OracleSourceFetchTaskContext#validateAndLoadDatabaseHistory` fails in `HistorizedRelationalDatabaseSchema#recover`. `initial`/`snapshot` modes are unaffected because their splits already carry the snapshot schemas. - **Solution:** Drop the tablespace restriction (and the now-unused `TABLESPACE_NAME` column) from the discovery query. The captured table set is already restricted by `table.include.list`, so the tablespace filter only hides valid tables. The `NESTED = 'NO'` and nested-table exclusion are unrelated and are kept. ### Tests - Added `OracleSourceReaderTest#testDiscoverTableLocatedInSystemTablespace`: creates a captured table with `TABLESPACE SYSTEM` and asserts that `OracleDialect#discoverDataCollectionSchemas` discovers it (returns an empty map without this fix). - Aligned the `listTables` helper of both Oracle test bases with the production query, so test cleanup also covers tables in the SYSTEM tablespace. ### Does this pull request potentially affect one of the following parts: - Dependencies (does it add or upgrade a dependency): no - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no - The serializers: no - The runtime per-record code paths (performance sensitive): no — only the startup-time table discovery scan is widened; results are still filtered by `table.include.list` -- 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]
