BewareMyPower opened a new pull request #8167:
URL: https://github.com/apache/pulsar/pull/8167
Master Issue: #8134
### Motivation
The REST APIs of `PersistentTopics#deleteTopic` and
`PersistentTopics#deletePartitionedTopic` didn't support delete schema of
topics, which may cause after topics were deleted, the schema ledgers still
existed. And current implementation of delete schema is just add a empty schema
ledger but not delete existed schema ledgers.
### Modifications
- Add a `deleteSchema` query param to REST APIs of deleting
topics/partitioned topics;
- Add a map to record the created ledgers in `BookkeeperSchemaStorage`;
- Expose `deleteSchema` param in pulsar-admin APIs;
- Delete schema ledgers when delete the cluster with `-a` option.
### Verifying this change
- [ ] Make sure that the change passes the CI checks.
It has been tested in local environments:
1. Check the current count of ledgers;
2. Create a new partitioned topic or non-partitioned topic;
3. Create producers/consumers with schema to send and receive messages with
the created topic;
4. Delete the topic with `deleteSchema=true` query param or call admin API
that set `deleteSchema` to false;
5. Recheck the count of ledgers, make sure it's the same with step 1.
### Does this pull request potentially affect one of the following parts:
*If `yes` was chosen, please highlight the changes*
- **The rest endpoints**: (yes)
### Documentation
- Does this pull request introduce a new feature? (yes)
- If yes, how is the feature documented? (JavaDocs)
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]