Hi, to he honest I'm nor really sure if this is a Debezium problem or Schema Registry problem or is me who don't understand how AVRO schema compatibility works, but I'm experiencing a really weird issue... Let me give you some context:
- I'm using a Kafka Connect connector with Debezium to ingest data from a SQL Server database table which only has two columns: id (int) and name (string). So, initially the AVRO schema generated in my schema registry looks like:
{
"type": "record",
"name": "Envelope",
"namespace": "example.lobby.dbo.categories",
"fields": [
{
"name": "before",
"type": [
"null",
{
"type": "record",
"name": "Value",
"fields": [
{
"name": "id",
"type": "int"
},
{
"name": "name",
"type": "string"
}
],
"
connect.name": "example.lobby.dbo.categories.Value"
}
],
"default": null
},
(more things here)
- Note that I've set backward compatibility mode for this AVRO schema in schema-registry
- Now, on database table I've deleted "name" column, added it again but as "integer", and updated CDC table to have Debezium taking the updated schema
- My expectations after that change would be schema-registry rejecting the change as this change is clearly breaking backward compatibility, but is not refusing it, is storing new version of the schema with "name" field as "int" type.
Is this the expected behaviour? Is not that change breaking backward compatibility in stored AVRO schema?
I've also checked that any backward incompatible change made inside a AVRO union which has "null" as part of the union seems to be ignored in the compatibility check. But, if you do a change in any other field which is not inside an union type that can be null, then schema-registry refuses the change if is incompatible.
Thanks