Schema Registry accepts incompatible schema evolution for referenced schemas under FULL_TRANSITIVE
Version & Environment
Redpanda version: v25.3.7
What went wrong?
When using TopicRecordNameStrategy with Avro schema references, the Schema Registry fails to enforce FULL_TRANSITIVE compatibility settings.
Specifically, evolving a schema that contains a reference by adding a mandatory (non-nullable) field - which is a backward-incompatible change - is accepted by the registry (HTTP 200) instead of being rejected (HTTP 409).
This effectively allows breaking changes to be committed despite strict compatibility settings being enabled.
What should have happened instead?
The Schema Registry should have rejected the registration of the new schema version with an HTTP 409 Conflict error.
Under FULL_TRANSITIVE (which implies BACKWARD compatibility), new schemas must be able to read data written with old schemas. Adding a mandatory field without a default value breaks this rule and should trigger a compatibility violation.
How to reproduce the issue?
-
Start Redpanda (v25.3.7) and create a topic named
sensor_events. -
Register Schema A (Referenced Schema): Create subject
sensor_events-com.example.SimpleRecordwith a simple Avro record containing one string field. -
Register Schema B (Referencing Schema): Create subject
sensor_events-com.example.CompositeRecordcontaining a field that references Schema A using thereferencesAPI field. -
Set Compatibility: Set the compatibility level for both subjects to
FULL_TRANSITIVE. -
Evolve Schema B Incompatibly: Attempt to register version 2 of Schema B by adding a new mandatory
stringfield (no default value).
Additional information
The issue can be reproduced consistently using a bash script interacting with the Schema Registry API.
Relevant Output: When running the reproduction steps, the API returns a success response (HTTP 200) with the new schema ID, where an error was expected.
--- Attempting to register incompatible schema to subject: sensor_events-com.example.CompositeRecord (Expect Failure) ---
{
"id": 2
}
❌ FAIL: Schema Registry ACCEPTED the update! It should have been rejected.
cc @BenPope @pgellert
@lpeppe Thanks for reporting this.
This is a known issue and has already been fixed in #28780. The fix is merged into dev and will be included in the next major release (26.1).
Since 26.1 is not released yet, I’ll work on backporting the fix to the upcoming 25.3 patch release. Because this has been long-standing behavior, the backport will be guarded behind a cluster configuration flag to avoid introducing a breaking change in a patch release.
I’ll update this issue once the backport PR is up.
The backport PR is up for review: https://github.com/redpanda-data/redpanda/pull/29627
Once it merges, we’ll include the fix in the next 25.3.x patch release.
Thanks for the quick response 🙏
@lpeppe, the PR above is now merged. It looks like it just missed the v25.3.9 release train, so it should land in v25.3.10.
The fix is now released in v25.3.10: https://github.com/redpanda-data/redpanda/releases/tag/v25.3.10