You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "dchristle (via GitHub)" <gi...@apache.org> on 2024/02/27 17:59:05 UTC
[I] [Bug] pulsar-admin set-retention reports an invalid retention policy when size != -1 [pulsar]
dchristle opened a new issue, #22138:
URL: https://github.com/apache/pulsar/issues/22138
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
### Version
Pulsar 3.2.0, official x86 Docker image.
Did not see this error on Pulsar 3.1.2.
### Minimal reproduce step
1. Have an existing namespace with some existing topics.
2. `kubectl exec -it` into a Broker pod `bash` shell.
3. Run `./bin/pulsar-admin namespaces set-retention my_tenant/my_namespace -s 5T -t 2h`
### What did you expect to see?
The CLI should produce no output when the command completes successfully, and the retention policy returned with `get-retention` should reflect the desired size and time parameters.
### What did you see instead?
```
2024-02-27T17:25:16,809+0000 [AsyncHttpClient-7-1] WARN org.apache.pulsar.client.admin.internal.BaseResource - [http://localhost:8080/admin/v2/namespaces/my_tenant/my_namespace/retention] Failed to perform http post request: javax.ws.rs.BadRequestException: HTTP 400 {"reason":"Invalid retention policy: Setting a single time or size limit to 0 is invalid when one of the limits has a non-zero value. Use the value of -1 instead of 0 to ignore a specific limit. To disable retention both limits must be set to 0."}
Invalid retention policy: Setting a single time or size limit to 0 is invalid when one of the limits has a non-zero value. Use the value of -1 instead of 0 to ignore a specific limit. To disable retention both limits must be set to 0.
Reason: Invalid retention policy: Setting a single time or size limit to 0 is invalid when one of the limits has a non-zero value. Use the value of -1 instead of 0 to ignore a specific limit. To disable retention both limits must be set to 0.
```
### Anything else?
We've run this command on Pulsar 3.1.2 with the same tenant/namespace & identical time and size retention parameters, and it completed successfully. Only after upgrading to 3.2.0 have we started seeing this error. Trying it other tenant/namespaces gives the same error, too.
Importantly for root-causing this, there are `set-retention` commands that do work.
_Working:_
`./bin/pulsar-admin namespaces set-retention my_tenant/my_namespace -t 12h -s -1`
`./bin/pulsar-admin namespaces set-retention my_tenant/my_namespace -t 24h -s -1`
`./bin/pulsar-admin namespaces set-retention my_tenant/my_namespace -t -1 -s -1`
`./bin/pulsar-admin namespaces set-retention my_tenant/my_namespace -s -1 -t 12h`
_Not working:_
`./bin/pulsar-admin namespaces set-retention my_tenant/my_namespace -t -1 -s 5T`
`./bin/pulsar-admin namespaces set-retention my_tenant/my_namespace -s 1000G -t 12h`
It looks like the command fails whenever `size != -1`.
I also verified with `get-retention` that the policy still appears to update when `set-retention` returns successfully, e.g. for `-t 12h -s -1`, `get-retention` returns:
```
{
"retentionTimeInMinutes" : 720,
"retentionSizeInMB" : -1
}
```
In case it matters, this tenant/namespace has a `message_age` backlog quota enabled. I tried different size/time arguments (with `size != -1`) relative to the respective backlog parameters and it didn't make a difference.
### Are you willing to submit a PR?
- [ ] I'm willing to submit a PR!
--
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.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] pulsar-admin set-retention reports an invalid retention policy when size != -1 [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #22138:
URL: https://github.com/apache/pulsar/issues/22138#issuecomment-1968241118
@liangyepianzhou Do you have a chance to check this? This looks like a regression in 3.2.0 . Is this related to #20782?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] pulsar-admin set-retention reports an invalid retention policy when size != -1 [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari closed issue #22138: [Bug] pulsar-admin set-retention reports an invalid retention policy when size != -1
URL: https://github.com/apache/pulsar/issues/22138
--
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.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org