The new operation will delete all the data and the metadata under
a tenant or namespace. I would like to suggest to use

`delete-all-namespaces` and `delete-all-topics`

The `delete` actually acts as a fact of deleting metadata and data.
And `truncate` is for deleting the data. IMO, we'd better not
introduce another new keyword, either `clear` or `wipe`, because
it will bring more knowledge to Pulsar users who must understand.


Thanks,
Penghui

On Mon, Apr 17, 2023 at 10:56 AM Xiangying Meng <xiangy...@apache.org>
wrote:

> Hi Enrico,
>
> Thank you for your feedback. While I understand that
> "delete-all-namespaces" is more explicit,
> I also think it's a bit lengthy for a command-line parameter.
> I personally believe the "wipe" option, combined with a safety confirmation
> step,
>  would be more user-friendly and efficient.
>
> By adding a safety confirmation step, we can minimize the risk of
> accidental mass deletion.
> Users would be required to confirm their intention to perform the deletion
> by
> typing 'YES' or a similar confirmation word before the operation proceeds.
>
> What do you think about this approach?
> If there's a consensus, I can work on implementing this feature with the
> "wipe" option and the safety confirmation step.
>
> Best regards,
> Xiangying
>
> On Sun, Apr 16, 2023 at 11:25 PM Enrico Olivelli <eolive...@gmail.com>
> wrote:
>
> > Il Dom 16 Apr 2023, 15:45 Asaf Mesika <asaf.mes...@gmail.com> ha
> scritto:
> >
> > > How about "truncate" instead of "clear"?
> > >
> >
> >
> > Truncate is better, or maybe 'wipe' (because truncate means another
> > operation for topics currently)
> >
> > Another alternative, more explicit:
> > pulsar-admin tenants delete-all-namespaces TENANT
> >
> > Enrico
> >
> > >
> > > 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
> > > >
> > >
> >
>

Reply via email to