Schema Registry: Unable to Register New Schema ID

Last updated: August 10, 2026

Symptom

When a schema is updated, there is a case a new schema ID is not assigned. Instead, an existing (previous) ID is re-used.

Simple example:

1. Register a schema with type as long

curl -s -X POST  "http://localhost:8081/subjects/sensor-value/versions"  -H "Content-Type: application/vnd.schemaregistry.v1+json"  -d '{"schema": "{\"type\":\"record\",\"name\":\"sensor_sample\",\"fields\":[{\"name\":\"value\",\"type\":\"long\"}]}"}' | jq

2. rpk registry schema list returns below

$ rpk registry schema list
SUBJECT       VERSION  ID    TYPE  ERROR
sensor-value   1                1     AVRO

3. Update the schema with type as double

curl -s -X POST  "http://localhost:8081/subjects/sensor-value/versions"  -H "Content-Type: application/vnd.schemaregistry.v1+json"  -d '{"schema": "{\"type\":\"record\",\"name\":\"sensor_sample\",\"fields\":[{\"name\":\"value\",\"type\":\"double\"}]}"}' | jq

4. New version / ID are allocated

$ rpk registry schema list
SUBJECT       VERSION  ID    TYPE  ERROR
sensor-value   1                1     AVRO
sensor-value   2                2     AVRO

5. Delete version 1

curl -s -X DELETE "http://localhost:8081/subjects/sensor-value/versions/1" | jq .
$ rpk registry schema list
SUBJECT       VERSION  ID    TYPE  ERROR
sensor-value   2                2     AVRO

6. Update the schema with type as long as before

curl -s -X POST  "http://localhost:8081/subjects/sensor-value/versions"  -H "Content-Type: application/vnd.schemaregistry.v1+json"  -d '{"schema": "{\"type\":\"record\",\"name\":\"sensor_sample\",\"fields\":[{\"name\":\"value\",\"type\":\"long\"}]}"}' | jq

7. The same ID 1 is allocated

$ rpk registry schema list
SUBJECT       VERSION  ID    TYPE  ERROR
sensor-value   2                2     AVRO
sensor-value   3                1     AVRO
$ rpk registry schema get --id 1 --print-schema
{
 "type": "record",
 "name": "sensor_sample",
 "fields": [
   {
     "name": "value",
     "type": "long"
   }
 ]
}

 

Reason

This behavior is expected in the current Schema Registry spec. 

When you attempt to register a schema that’s identical to one already stored in the Schema Registry, the Registry doesn’t create a new ID. Instead, it detects the match and simply returns the existing schema’s ID. The ID number only advances when the incoming schema differs from every schema already registered under that subject.

 

If you have any issues with this behavior, please report it to the Redpanda Support team.