Invalid schemas cannot evolve or be used by schema-registry client 0.8.1

17 views
Skip to first unread message

Fabiano Santos

unread,
Nov 13, 2019, 5:21:15 AM11/13/19
to Registry
With the new version of schema registry (0.8.1) which updates avro to 1.9.1 its not possible to use schemas that are invalid due to validations included in the new avro version.

One case is when you have an invalid schema and you try to fix it, but the schema-registry try to validate the old version, more information -> https://github.com/hortonworks/registry/issues/617

Another case is using the schema-registry client, for example as the serializer for kafka, because when client tries to get a schema actually it calls addSchemaVersion:

java.lang.RuntimeException: An exception was thrown while processing request with message: [Invalid default for field method: null not a "string"]
        at com
.hortonworks.registries.schemaregistry.client.SchemaRegistryClient.handleSchemaIdVersionResponse(SchemaRegistryClient.java:591) ~[schema-registry-client-0.5.4.jar:na]
        at com
.hortonworks.registries.schemaregistry.client.SchemaRegistryClient.doAddSchemaVersion(SchemaRegistryClient.java:577) ~[schema-registry-client-0.5.4.jar:na]
        at com
.hortonworks.registries.schemaregistry.client.SchemaRegistryClient.lambda$addSchemaVersion$1(SchemaRegistryClient.java:515) ~[schema-registry-client-0.5.4.jar:na]
        at com
.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4739) ~[guava-jdk5-17.0.jar:na]
        at com
.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) ~[guava-jdk5-17.0.jar:na]
        at com
.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) ~[guava-jdk5-17.0.jar:na]
        at com
.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) ~[guava-jdk5-17.0.jar:na]
        at com
.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) ~[guava-jdk5-17.0.jar:na]
       
... 176 common frames omitted



Note that the stacktrace uses an older version, but the server is updated.

For those who have invalid schemas its not possible to use the new version, unless, all schemas are fixed.

In my opinion, the client shouldn't call addSchemaVersion when its trying to get a schema.

Reply all
Reply to author
Forward
0 new messages