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:
imo, schema registry should be maintaining this info. given the below
understanding now, we should not rename the `deleteSchema(...)` method or
replace its usages. but we can rename `deleteSchemaStorage(...)` to
`deleteSchemaFromStorage(...)`. is that fine?
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 and also maintains metadata about the delete operation. the topic
itself remains unchanged.
the schema is deleted from storage only when the topic itself is deleted.
replacing the `deleteSchema(...)` call with `deleteSchemaStorage(...)` will
mean that we will lose the following metadata:
* user who deleted the schema
* timestamp at which the schema was deleted
--
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]