> Just wondering - since it is such a dangerous > command, how can we help the user not make > an accidental mass deletion?
Just a suggestion: We can make this command executed on two-part Part-1: Give a summary print of the namespaces, and topics to delete, and ask the user to confirm if they want to delete the resources. Part-2: If users select “yes”, the deletion will be really executed. Part-3: Print a summary of the results Thanks Yubiao Feng On Sun, Apr 16, 2023 at 9:45 PM Asaf Mesika <asaf.mes...@gmail.com> wrote: > How about "truncate" instead of "clear"? > > Just wondering - since it is such a dangerous command, how can we help the > user not make an accidental mass deletion? > > On Sat, Apr 15, 2023 at 1:12 PM Girish Sharma <scrapmachi...@gmail.com> > wrote: > > > > However, the current goal is to keep the tenant and namespace intact > > while > > > cleaning up their contents. > > Ah, I see now. Yes, in that case a clear command is better. Will this > > command also take into account the value of the broker config > > `forceDeleteNamespaceAllowed` in case someone is clearing the owner > tenant? > > > > Regards > > > > On Sat, Apr 15, 2023 at 3:39 PM Enrico Olivelli <eolive...@gmail.com> > > wrote: > > > > > The proposal sounds really useful, especially for automated testing. > > > +1 > > > > > > Enrico > > > > > > Il giorno sab 15 apr 2023 alle ore 12:07 Xiangying Meng > > > <xiangy...@apache.org> ha scritto: > > > > > > > > Dear Girish, > > > > > > > > Thank you for your response and suggestion to extend the use of the > > > > `boolean force` flag for namespaces and tenants. > > > > I understand that the `force` flag is already implemented for > deleting > > > > topics, namespaces, and tenants, > > > > and it provides a consistent way to perform these actions. > > > > > > > > However, the current goal is to keep the tenant and namespace intact > > > while > > > > cleaning up their contents. > > > > In other words, I want to have a way to remove all topics within a > > > > namespace or all namespaces and topics > > > > within a tenant without actually deleting the namespace or tenant > > itself. > > > > > > > > To achieve this goal, I proposed adding a `clear` command for > > > `namespaces` > > > > and `tenants`. > > > > > > > > This approach would allow users to keep the tenant and namespace > > > structures > > > > in place > > > > while cleaning up their contents. > > > > I hope this clarifies my intention, and I would like to hear your > > > thoughts > > > > on this proposal. > > > > > > > > Best regards, > > > > Xiangying > > > > > > > > On Sat, Apr 15, 2023 at 5:49 PM Girish Sharma < > scrapmachi...@gmail.com > > > > > > > wrote: > > > > > > > > > Hello Xiangying, > > > > > This indeed is a cumbersome task to delete a filled namespace or > > > tenant. We > > > > > face this challenge in our organization where we use the > > multi-tenancy > > > > > feature of pulsar heavily. > > > > > > > > > > I would like to suggest a different command to do this though.. > > > Similar to > > > > > how you cannot delete a topic without deleting its > > > > > subscribers/producers/consumers, unless we use the `boolean force` > > > flag. > > > > > Why not extend this to namespace and tenant as well and let the > force > > > param > > > > > do the cleanup (which your suggested `clear` command would do). > > > > > > > > > > As of today, using force to delete a namespace just returns 405 > > saying > > > > > broker doesn't allow force delete of namespace containing topics. > > > > > > > > > > Any thoughts? > > > > > > > > > > On Sat, Apr 15, 2023 at 3:07 PM Xiangying Meng < > xiangy...@apache.org > > > > > > > > wrote: > > > > > > > > > > > Dear Apache Pulsar Community, > > > > > > > > > > > > I hope this email finds you well.I am writing to suggest a > > potential > > > > > > improvement to the Pulsar-admin tool, > > > > > > which I believe could simplify the process of cleaning up > tenants > > > and > > > > > > namespaces in Apache Pulsar. > > > > > > > > > > > > Currently, cleaning up all the namespaces and topics within a > > tenant > > > or > > > > > > cleaning up all the topics within a namespace requires several > > manual > > > > > > steps, > > > > > > such as listing the namespaces, listing the topics, and then > > deleting > > > > > each > > > > > > topic individually. > > > > > > This process can be time-consuming and error-prone for users. > > > > > > > > > > > > To address this issue, I propose the addition of a "clear" > > parameter > > > to > > > > > the > > > > > > Pulsar-admin tool, > > > > > > which would automate the cleanup process for tenants and > > namespaces. > > > > > Here's > > > > > > a conceptual implementation: > > > > > > > > > > > > 1. To clean up all namespaces and topics within a tenant: > > > > > > ``` bash > > > > > > pulsar-admin tenants clear <tenant-name> > > > > > > ``` > > > > > > 2. To clean up all topics within a namespace: > > > > > > ```bash > > > > > > pulsar-admin namespaces clear <tenant-name>/<namespace-name> > > > > > > ``` > > > > > > > > > > > > By implementing these new parameters, users would be able to > > perform > > > > > > cleanup operations more efficiently and with fewer manual steps. > > > > > > I believe this improvement would greatly enhance the user > > experience > > > when > > > > > > working with Apache Pulsar. > > > > > > > > > > > > I'd like to discuss the feasibility of this suggestion and gather > > > > > feedback > > > > > > from the community. > > > > > > If everyone agrees, I can work on implementing this feature and > > > submit a > > > > > > pull request for review. > > > > > > > > > > > > Looking forward to hearing your thoughts on this. > > > > > > > > > > > > Best regards, > > > > > > Xiangying > > > > > > > > > > > > > > > > > > > > > -- > > > > > Girish Sharma > > > > > > > > > > > > > > -- > > Girish Sharma > > >