-
Notifications
You must be signed in to change notification settings - Fork 599
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sr/avro: fix missing default compat check for null
This fixes two related bugs in the avro compatibility checks where our implementation was too lenient for the check `reader_field_missing_default_value`. In Avro, a record field may declare a null default (`"default": null`) which is different from not declaring a default (no `"default"`). The first case means that by default the reader will set the field to `null` unless the field was set by the writer. The second case means that the writer must declare the field, otherwise the data is invalid for the reader. https://avro.apache.org/docs/1.11.1/specification/#schema-record However, the C++ avro implementation used a null object to represent even missing fields, which meant that the redpanda schema registry implementation could not tell the difference between a missing field and a null field. (See the associated avro fix PR). This meant that we incorrectly didn't detect when the reader schema had a new record field without a default value and always thought that a `null` default value is present. This surfaced as a bug for `"null"` and `["null", ...]` (union) types but it was constrained to these two types because the default-value-vs-field type mismatch check caught this as an incompatibility otherwise.
- Loading branch information
Showing
5 changed files
with
67 additions
and
21 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters