redpanda icon indicating copy to clipboard operation
redpanda copied to clipboard

Schema Registry accepts incompatible schema evolution for referenced schemas under FULL_TRANSITIVE

Open lpeppe opened this issue 9 months ago • 6 comments

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?

  1. Start Redpanda (v25.3.7) and create a topic named sensor_events.

  2. Register Schema A (Referenced Schema): Create subject sensor_events-com.example.SimpleRecord with a simple Avro record containing one string field.

  3. Register Schema B (Referencing Schema): Create subject sensor_events-com.example.CompositeRecord containing a field that references Schema A using the references API field.

  4. Set Compatibility: Set the compatibility level for both subjects to FULL_TRANSITIVE.

  5. Evolve Schema B Incompatibly: Attempt to register version 2 of Schema B by adding a new mandatory string field (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.


lpeppe avatar Feb 17 '26 14:02 lpeppe

cc @BenPope @pgellert

dotnwat avatar Feb 17 '26 20:02 dotnwat

@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.

pgellert avatar Feb 18 '26 11:02 pgellert

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.

pgellert avatar Feb 18 '26 14:02 pgellert

Thanks for the quick response 🙏

lpeppe avatar Feb 18 '26 14:02 lpeppe

@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.

pgellert avatar Feb 26 '26 13:02 pgellert

The fix is now released in v25.3.10: https://github.com/redpanda-data/redpanda/releases/tag/v25.3.10

pgellert avatar Mar 06 '26 09:03 pgellert