Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new versions of schema are created when schema hasn't changed when using ccompat endpoint #551

Closed
zzztimbo opened this issue May 28, 2020 · 2 comments
Assignees
Labels
type/bug Something isn't working

Comments

@zzztimbo
Copy link

Each time I run this:

 ./bin/kafka-avro-console-producer --property schema.registry.url=http://localhost:8080/api/ccompat --topic SNACKS_AVRO --property value.schema='
{
  "type": "record",
  "name": "myrecord",
  "fields": [
      {"name": "name",  "type": "string" }
    , {"name": "calories", "type": "float" }
    , {"name": "color", "type": "string" }
  ]
}' < ~/Workspace/kafka-serialization/snacks_2.txt

I get another version in the apicurio registry. I don't think this is the expected behavior.

@alesj
Copy link
Contributor

alesj commented May 28, 2020 via email

@EricWittmann EricWittmann added the type/bug Something isn't working label May 29, 2020
@EricWittmann
Copy link
Member

Yeah I do think that the Confluent registry does a content check when registering a schema. If the schema already exists in the registry (based on the actual bytes of the schema) then they won't re-register a new one - you'll get back the same GlobalId. I'm not sure whether a new version will get created - I'm guessing not. Although if you register the same schema to a different subject, you'll get a new subject+version but keep the same GlobalId. That we will not do. It's a storage optimization that isn't really necessary IMO.

That said, we can probably tweak the register method to better mimic the confluent behavior. I've marked this as a bug.

@EricWittmann EricWittmann self-assigned this May 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants