Hi,
I believe we have run into a bug in the Oracle connector that affects how it builds a table schema when it receives a DML event for a table that is not in its schema history. The connector can fail to mark a primary key column as non optional.
Environment:
• Debezium 2.7.3 Final
• Kafka Connect in standalone mode
• Schema history stored in a local file
• XStream outbound server as the source
• Connector configured to capture only a specific set of table schemas
The issue appears at the intersection of two conditions.
Debezium connects to the database using a service name, for example DB1_SVC.WORLD rather than the actual database name DB1.WORLD. The connector is configured with database.dbname=DB1_SVC.WORLD. The database.pdb.name property is not set at the moment, although we will investigate it because it may allow a workaround.
The table has an ID primary key, but the CREATE TABLE statement does not declare ID as not null or include the primary key. A separate ALTER TABLE statement adds the primary key constraint later.
Here is the sequence that reveals the bug. When Debezium starts, it builds the initial table schema through JDBC. This uses the name in database.dbname, so the tableId is built with DB1_SVC.WORLD. The JDBC based path correctly marks ID as non optional.
However, the incoming DML events contain the database name DB1.WORLD. Because this does not match the initial tableId, Debezium fails to find the schema and the LcrEventHandler rebuilds it. This rebuild uses a different code path. It parses the table DDL rather than using JDBC. This path appears to have a bug. It does not infer that ID is non optional when it processes the ALTER TABLE that adds the primary key.
Later on, this mismatch causes Avro schema serialization failures.
--
You received this message because you are subscribed to the Google Groups "debezium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debezium+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/debezium/2c98dc42-b7ff-46ea-bfc0-c0c3917a9daan%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "debezium" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/debezium/mluoW9dlhak/unsubscribe.
To unsubscribe from this group and all its topics, send an email to debezium+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/debezium/0b6e1ca9-b06c-4694-9f6f-e07678a99eb6n%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "debezium" group.
To unsubscribe from this group and stop receiving emails from it, send an email to debezium+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/debezium/CANpG74HQyTV6kajOBnD%3DzK-xOQiBx-_8whh7XxX_sPfsvck-Ug%40mail.gmail.com.