aparajita89 commented on a change in pull request #14102:
URL: https://github.com/apache/pulsar/pull/14102#discussion_r812559749
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/impl/SchemasResourceBase.java
##########
@@ -117,7 +117,7 @@ public void deleteSchema(boolean authoritative,
AsyncResponse response) {
validateDestinationAndAdminOperation(authoritative);
String schemaId = getSchemaId();
- pulsar().getSchemaRegistryService().deleteSchema(schemaId,
defaultIfEmpty(clientAppId(), ""))
+ pulsar().getSchemaRegistryService().putEmptySchema(schemaId,
defaultIfEmpty(clientAppId(), ""))
Review comment:
as per the current code, when user tries to explicitly delete a schema
from the topic, an empty schema is pushed to the schema storage so that the
latest schema is an empty schema. this preserves the older versions of the
schema in the storage. the topic itself remains unchanged.
the schema is deleted from storage only when the topic itself is deleted.
i expected that this would affect the behavior of a transitive compatibility
check. however, that's not the case. the schema registry contains additional
logic to ignore all existing schema versions if the latest schema instance is
empty. by removing `deleteSchema(...)` and replacing its usages with
`deleteSchemaStorage(...)` we can remove the `trimDeletedSchemaAndGetList(...)`
method as well from the schema registry.
what do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]