-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Issue 9790] Support disabled the tenants/namespaces force deletion in the broker.conf #9819
Conversation
@@ -290,6 +290,12 @@ protected void internalDeleteTenant(AsyncResponse asyncResponse, String tenant) | |||
} | |||
|
|||
protected void internalDeleteTenantForcefully(AsyncResponse asyncResponse, String tenant) { | |||
if (!pulsar().getConfiguration().isForceDeleteTenantAllowed()) { | |||
asyncResponse.resume( | |||
new RestException(Status.FORBIDDEN, "Broker doesn't allow forced deletion of tenants")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The @ApiReponse use 403 to indicate if the request has admin permission, I think 405 is more reasonable here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tips, done.
/pulsarbot run-failure-checks |
@murong00 thanks for your great work! Shall the changes be documented to the broker -configuration section? |
@Anonymitaet Added the docs accordingly, please help to take a look when you are available. |
@@ -185,6 +185,8 @@ internalListenerName|Specify the internal listener name for the broker.<br><br>* | |||
|brokerDeleteInactiveTopicsFrequencySeconds| How often to check for inactive topics |60| | |||
| brokerDeleteInactiveTopicsMode | Set the mode to delete inactive topics. <li> `delete_when_no_subscriptions`: delete the topic which has no subscriptions or active producers. <li> `delete_when_subscriptions_caught_up`: delete the topic whose subscriptions have no backlogs and which has no active producers or consumers. | `delete_when_no_subscriptions` | | |||
| brokerDeleteInactiveTopicsMaxInactiveDurationSeconds | Set the maximum duration for inactive topics. If it is not specified, the `brokerDeleteInactiveTopicsFrequencySeconds` parameter is adopted. | N/A | | |||
|forceDeleteTenantAllowed| Allow forced deletion of tenants.|false| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|forceDeleteTenantAllowed| Allow forced deletion of tenants.|false| | |
|forceDeleteTenantAllowed| Allow you to delete a tenant forcefully. |false| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
conf/broker.conf
Outdated
@@ -165,6 +165,12 @@ brokerDeleteInactivePartitionedTopicMetadataEnabled=false | |||
# Topics that are inactive for longer than this value will be deleted | |||
brokerDeleteInactiveTopicsMaxInactiveDurationSeconds= | |||
|
|||
# Allow forced deletion of tenants. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Allow forced deletion of tenants. | |
# Allow you to delete a tenant forcefully. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
conf/broker.conf
Outdated
# Allow forced deletion of tenants. | ||
forceDeleteTenantAllowed=false | ||
|
||
# Allow forced deletion of namespaces. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Allow forced deletion of namespaces. | |
# Allow you to delete a namespace forcefully. |
@@ -185,6 +185,8 @@ internalListenerName|Specify the internal listener name for the broker.<br><br>* | |||
|brokerDeleteInactiveTopicsFrequencySeconds| How often to check for inactive topics |60| | |||
| brokerDeleteInactiveTopicsMode | Set the mode to delete inactive topics. <li> `delete_when_no_subscriptions`: delete the topic which has no subscriptions or active producers. <li> `delete_when_subscriptions_caught_up`: delete the topic whose subscriptions have no backlogs and which has no active producers or consumers. | `delete_when_no_subscriptions` | | |||
| brokerDeleteInactiveTopicsMaxInactiveDurationSeconds | Set the maximum duration for inactive topics. If it is not specified, the `brokerDeleteInactiveTopicsFrequencySeconds` parameter is adopted. | N/A | | |||
|forceDeleteTenantAllowed| Allow forced deletion of tenants.|false| | |||
|forceDeleteNamespaceAllowed| Allow forced deletion of namespaces.|false| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|forceDeleteNamespaceAllowed| Allow forced deletion of namespaces.|false| | |
|forceDeleteNamespaceAllowed| Allow you to delete a namespace forcefully. |false| |
/pulsarbot run-failure-checks |
Motivation
Fixes #9790
Modifications
false
: