Skip to content

[FLINK-40201] Fix Oracle CDC compatibility with Oracle 26ai and Debezium 3.4.2.Final - #4481

Open
Suhel0328 wants to merge 1 commit into
apache:release-3.6from
Suhel0328:FLINK-40201-oracle-26ai-debezium-3.4-compat
Open

[FLINK-40201] Fix Oracle CDC compatibility with Oracle 26ai and Debezium 3.4.2.Final#4481
Suhel0328 wants to merge 1 commit into
apache:release-3.6from
Suhel0328:FLINK-40201-oracle-26ai-debezium-3.4-compat

Conversation

@Suhel0328

@Suhel0328 Suhel0328 commented Jul 21, 2026

Copy link
Copy Markdown

What is the purpose of the change

Fixes 7 runtime errors that prevent the Oracle CDC connector from working with Oracle 26ai (CDB/PDB mode) when using Debezium 3.4.2.Final. Also applies the required Debezium 3.x API compatibility fixes across all JDBC source connectors (MySQL, DB2, Postgres, SQL Server) that result from the version upgrade.

JIRA: https://issues.apache.org/jira/browse/FLINK-40201

Brief change log

  • Fix NoSuchMethodError on LogMinerChangeRecordEmitter (10-arg → 9-arg constructor to match Debezium 3.4.2)
  • Add ResumePositionProvider local override: sessionContext null-guard and database.* prefix strip
  • Fix ORA-01031: use ALL_TABLES.NUM_ROWS instead of ANALYZE TABLE
  • Fix schema recovery in CDB/PDB mode with catalog-agnostic TableFilter
  • Guard isRecordBetween() against absent ROWID Connect header (Debezium 3.4.2 no longer injects it)
  • Include debezium-common in shade assembly to prevent ClassNotFoundException
  • Add EmbeddedFlinkSchemaHistory / RelationalDatabaseSchema for Debezium 3.x API
  • Upgrade DatabaseHistorySchemaHistory, SchemaNameAdjuster package, TopicSelectorTopicNamingStrategy across all JDBC connectors

Verifying this change

Tested end-to-end: Oracle 26ai FREE (CDB + FREEPDB1) → Flink CDC 3.6-SNAPSHOT → StarRocks sink.

  • Snapshot: 3 rows confirmed in StarRocks
  • Streaming CDC: live UPDATE propagated correctly within expected flush interval

AI Disclosure

  • I used AI tools (Claude Code, Anthropic) to assist with this contribution. I have reviewed, tested, and verified all changes.

…ium 3.4.2.Final

Upgrade Debezium dependency to 3.4.2.Final to support Oracle 26ai (23.26.x) and
apply all source-level fixes required for API compatibility across JDBC connectors.

Oracle CDC specific fixes:
- Update vendored LogMinerChangeRecordEmitter to 9-arg constructor (rowId removed
  in Debezium 3.4.2) to fix NoSuchMethodError from UnbufferedLogMinerStreamingChangeEventSource
- Add local ResumePositionProvider override: null-guard on sessionContext in close()
  and catch block; strip database.* prefix from JdbcConfiguration before OracleConnection
- Fix OracleUtils.queryApproximateRowCnt() to use ALL_TABLES.NUM_ROWS instead of
  ANALYZE TABLE to avoid ORA-01031 for CDC users without ANALYZE ANY privilege
- Fix OracleSchema.getTableSchema() to use catalog-agnostic TableFilter so readSchema()
  works in CDB/PDB mode where Oracle JDBC returns PDB name as TABLE_CAT
- Guard isRecordBetween() against absent ROWID Connect header; fall back to SCN-range
  inclusion for tables without a primary key
- Include debezium-common in shade assembly to prevent ClassNotFoundException at runtime
- Add EmbeddedFlinkSchemaHistory and RelationalDatabaseSchema adapters for Debezium 3.x API

Debezium 3.x API compatibility (all JDBC source connectors):
- Rename EmbeddedFlinkDatabaseHistory to EmbeddedFlinkSchemaHistory (Debezium 3.x rename)
- Replace DatabaseHistory with SchemaHistory (Debezium 3.x rename)
- Update SchemaNameAdjuster import: io.debezium.util -> io.debezium.spi.schema
- Update TopicSelector to TopicNamingStrategy across base dispatcher
- Replace quotedColumnIdString() with quoteIdentifier() (Postgres/SQL Server)

Tested end-to-end: 3 snapshot rows + live CDC UPDATE confirmed in StarRocks sink
using Oracle 26ai FREE CDB/FREEPDB1 with Debezium 3.4.2.Final.

See: https://issues.apache.org/jira/browse/FLINK-40201

Generated-by: Claude Code (Anthropic)
@Suhel0328
Suhel0328 changed the base branch from master to release-3.6 July 21, 2026 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant