1 Schema 2 ids. Is it possible?

We currently have an issue where because of a surge in the kafka broker, schema registry has returned an id for a message to the serializer even though it failed publishing it to the _schemas topic.
afterwards another publisher published the schema and gained a successfully stored schema id.
so currently we have messages in kafka topics where the same schema message contains 2 different ids.
1 which doesn’t exist in the schema registry (which means it keeps failing the consumer on the other side) and 1 that doesn’t.
what i want to do is to publish the same schema with the failed id so it will be fetched by the deserializer but it seems like we can’t do that.

io.confluent.rest.exceptions.RestException: Schema already registered with id 52 instead of input id 28; error code: 42207

the schema registry even when using the schema client register with a designated id still checks the schema for an existing saved schema record and aborts the register command.

is there anything we can do about that?

i even tried storing it to a different subject and it was futile.

Any assistance would be greatly appreciated
Meir Shmaiovitch.

It sounds like you are using IMPORT mode to register the schema. You can try altering the schema slightly in a way that it is still semantically the same. For example, if it is Avro, add or modify a doc field. If it is JSON, add or modify a title field. If it is Protobuf, reorder the imports, etc.

@ryokota thanks for your reply
we use protobuff and the question is would it break backwards compatibility if we reorder the fields?
Also any idea why does schema registry do not allow writing a schema with 2 different ids?

writing a schema with 2 different ids

The schema text is hashed when compared, and therefore has a unique fingerprint, separate from the ID. Uploading the same schema should generate the same ID.