Closed Herbacha closed 1 month ago
Hi @Herbacha,
I like the command-like approach, so this could definitely be implemented. Would you like to contribute ?
Not sure to understand your point in the additional context tho. Schemas are actually duplicated across subjects so there should not be dependencies between subjects.
Hello @loicgreffier, I think I heard of a case were all subjects referencing the same schema are erased, and the schema itself was also erased from the registry. So creating a new subject re-creates the schema in the registry with a new ID. But I'm not 100% sure about this, and it may depend on cluster-side or ns4kafka-side configuration?
I may contribute, but not sure I'll have the time nowadays. Maybe in a few months, if the issue is still open!
Hello, with the feature developped in server-side ns4kafka and the linked PR in kafkactl, you should now be able to delete a specific version of a schema with the command lines:
kafkactl delete schema MyTopic-value -V latest
kafkactl delete schema MyTopic-value -V 1
kafkactl delete schema MyTopic-value --version latest
kafkactl delete schema MyTopic-value --version 1
The delete command kafkactl delete schema MyTopic-value
should behave like before: deleting all versions of the schema Mytopic-value.
You can also delete schema version using "By file" deletion kafkactl delete schema -f mySchema.yml
if the version is specified in the field spec.version
. If it is not specified, that deletion will delete all versions of the schema.
FYI, in server-side, I added a version
query parameter in the endpoint like this: DELETE /api/namespaces/<namespace>/schemas/<subject>?version=<version>
Only numbers or latest
work for the parameter, like the Confluent Schema Registry endpoint.
Problem
After applying several version of a schema in the same subject, sometimes I'd wish to erase the last one or an intermediary one (for example, one that is totally unused, or a new schema added to the subject that contains error and is not being used by a producer or consumer yet).
The current command
kafkactl delete schema MyTopic-value
deletes all the existing schemas from a subjectSuggestion
I'd like the possibility to delete one specific schema, similar to how the Schema Registry API works:
kafkactl delete schema MyTopic-value
: deletes all known schemas for this subject.kafkactl delete schema MyTopic-value/versions/latest
: deletes the latest registered schema for this subject.kafkactl delete schema MyTopic-value/versions/2
: deletes the version 2 schema if found in this subject.Alternatively, the command could be more "command-line" like:
kafkactl delete schema MyTopic-value
equivalent tokafkactl delete schema MyTopic-value --versions all
kafkactl delete schema MyTopic-value --versions latest
kafkactl delete schema MyTopic-value --versions 2
Additional context
Like how the
delete schema
command works right now, if many subjects share the same schema, the schema should be deleted from the registry only if the latest existing subject is deleted, to avoid losing existing compatibility.