-
Notifications
You must be signed in to change notification settings - Fork 599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
avro backwards-compatibility check is too permissive #16649
Comments
Additional note - in this case, I see the "correct" backwards-compatible schema as: {
"type": "record",
"name": "car",
"fields": [
{
"name": "model",
"type": "string"
},
{
"name": "make",
"type": "string"
},
{
"name": "year",
"type": "float"
},
{
"name": "color",
"type": ["null", "string"],
"default": null
}
]
} |
I've verified that the Confluent Schema Registry for Kafka correctly rejects |
This issue hasn't seen activity in 3 months. If you want to keep it open, post a comment or remove the |
I haven't heard any more activity on this ticket; I think it is still an issue. |
Hi @devinrsmith, thanks for reflagging this. We'll take a look at it and see if we can get a fix for this |
Version & Environment
Redpanda version: (use
rpk version
):What went wrong?
A
BACKWARDS
compatible schema is allowing the registration of an avro schema that is not backwards compatible; adding a field that is["null", <type>]
without actually specifying a default is improperly getting validated as compatible. Ultimately, this causes a downstream error on the clients who assume backwards compatibility.Note: in testing, the type
[<type>, "null"]
without a default is properly getting blocked as invalid.What should have happened instead?
The schema registration should have been blocked. The documentation for the schema registry and
BACKWARDS
compatibility mentions:https://docs.redpanda.com/current/manage/schema-reg/schema-reg-api/#compatibility-uses-and-constraints
https://docs.confluent.io/platform/current/schema-registry/fundamentals/schema-evolution.html#compatibility-types
How to reproduce the issue?
$ rpk registry schema create test-validation --schema car-v1.avro --type avro SUBJECT VERSION ID TYPE test-validation 1 1 AVRO $ rpk registry compatibility-level set test-validation --level BACKWARD SUBJECT LEVEL ERROR test-validation BACKWARD $ rpk registry schema check-compatibility test-validation --schema-version latest --schema car-v2a.avro --type avro Schema is not compatible. $ rpk registry schema check-compatibility test-validation --schema-version latest --schema car-v2b.avro --type avro Schema is compatible.
Additional information
car-v1.avro
:car-v2a.avro
:car-v2b.avro
:Potentially related to #4297?
JIRA Link: CORE-1796
The text was updated successfully, but these errors were encountered: