jangwind opened a new pull request #10326:
URL: https://github.com/apache/pulsar/pull/10326
Fixes #9597
### Motivation
Add support for truncate all data of the topic without disconnect the
producers and consumers.
### Modifications
Add a API to truncate data of the topic which can delete all inactive
ledgers even if the data retention is enabled. The truncate operation will move
all cursors to the end of the topic and delete all inactive ledgers. The
truncate operation will not rollover the current ledger, so the active ledger
will not been deleted. So for this cases, if users want to delete all data from
the topic and currently no new data writes to the topic, all the data will be
deleted after the ledger rollover triggered.
And, in the future we can add a separate command for rollover the ledger
manually. Which can decouple with the truncate api. So that from the admin
side, we can combine the rollover API and the truncate API to delete both the
current active ledger and inactive ledgers.
### Verifying this change
### Does this pull request potentially affect one of the following parts:
*If `yes` was chosen, please highlight the changes*
- Dependencies (does it add or upgrade a dependency): (no)
- The public API: (yes)
- The schema: (no)
- The default values of configurations: (no)
- The wire protocol: (no)
- The rest endpoints: (yes)
- The admin cli options: (yes)
- Anything that affects deployment: (no)
### Documentation
- Does this pull request introduce a new feature? (yes)
--
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]