Skip to content

[Enhancement] Improve automatic DDL handling for full-database sync in CdcTools #618

@sgczy2746995629-blip

Description

@sgczy2746995629-blip

Search before asking

  • I had searched in the issues and found no similar issues.

Description

📝 Description

When using CdcTools with the oracle-sync-database mode for full-database synchronization,
the automatic DDL handling is still not stable under the --schema-change-mode debezium_structure mode.
We are using this mode intentionally to support multiple heterogeneous data sources (Oracle, MySQL, PostgreSQL, etc.), since sql_parser mode is not fully compatible with all of them.
However, when schema changes (DDL) occur — especially frequent ALTER TABLE ADD/DROP COLUMN — Doris sometimes fails to synchronize the schema correctly.

⚙️ Current Behavior

  • Some DDL operations (such as ADD COLUMN or DROP COLUMN) are not correctly applied to Doris tables.
  • When multiple DDLs occur within a short period, Doris schema can go out of sync with the source.
  • The connector logs occasionally show parsing or schema errors like:

    "The recordRoot cannot extract ddl sql"
    "Column does not exist" when Doris attempts to drop an already-dropped column.

  • These issues seem more frequent under debezium_structure mode.

Expected Behavior

  • DDL synchronization should be consistent and idempotent even when multiple DDLs occur rapidly.
  • Doris should gracefully skip redundant DDLs (for example, when a column already exists or is already dropped).
  • The debezium_structure mode should provide better schema evolution handling across multiple database dialects.
  • Ideally, CdcTools could include retry or verification mechanisms to validate Doris schema alignment after each DDL event.

🧩 Environment

  • Doris Flink Connector: 1.18-25.1.0
  • Flink Version: 1.18.0
  • Oracle Source: 19c (LogMiner)
  • Schema Change Mode: debezium_structure
  • Sync Mode: oracle-sync-database (CdcTools)
  • Sink: Doris 2.x

🧾 Example Log

schema change status:true, ddl: ALTER TABLE test_db.EX_CTRL_CARE_PLAN DROP COLUMN PLAN_TYPE
schema change error : Failed to execute sql: Column does not exist: PLAN_TYPE
The recordRoot cannot extract ddl sql

Solution

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions