apache / pulsar

Apache Pulsar - distributed pub-sub messaging system
https://pulsar.apache.org/
Apache License 2.0
14.11k stars 3.57k forks source link

[feat] admin api/cli to delete package uploaded by pulsar-admin functions upload #21942

Open truong-hua opened 7 months ago

truong-hua commented 7 months ago

Search before asking

Motivation

There is pulsar-admin functions upload feature but no delete feature provided. So any file/package uploaded by this method will be in the pulsar storage forever (including anonymous package provided when create a function via API).

Due to some reason, our client team keep uploading package to pulsar functions and seem like now every new pulsar-worker started, it has to download all uploaded package including orphan ones.

Solution

Provide a feature to list and delete orphan package or simply delete a package

Alternatives

Provide a document to manual delete related znode in /pulsar/functions/... and their related entries in bookeepers

Anything else?

No response

Are you willing to submit a PR?

truong-hua commented 4 months ago

Can any body help on this? I think the right process is to find related znodes and read their entries. Then remove all bookeepers entries and znodes. But I can not completely understand the logic behind the metadata to be able to implement the feature yet. Hope that anyone can explain the logic.

sandeep-mst commented 3 months ago

There is a delete command available for packages in apache pulsar 3.2.2. admin packages delete Doesn't that already meet your requirements?

truong-hua commented 2 months ago

Hi @sandeep-mst the packages delete only remove the package from packages upload but not functions upload. Currently I found no way to delete functions upload packages, it's great if you can help.