-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[fix][cli] Fix set topic retention policy failed #23688
[fix][cli] Fix set topic retention policy failed #23688
Conversation
@hangc0276 Please add the following content to your PR description and select a checkbox:
|
@hangc0276 Good catch! There seems to also be a problem with sizeLimit. It's an integer and could overflow. Instead of |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #23688 +/- ##
============================================
+ Coverage 73.57% 74.38% +0.80%
- Complexity 32624 35064 +2440
============================================
Files 1877 1945 +68
Lines 139502 147448 +7946
Branches 15299 16270 +971
============================================
+ Hits 102638 109678 +7040
- Misses 28908 29287 +379
- Partials 7956 8483 +527
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Addressed in #23689. It also covers changes to |
It seems that this PR applies only to branch-3.3 and branch-3.4. The bug was most likely introduced in PIP-280 and PIP-343 changes. |
(cherry picked from commit 85b3d54)
(cherry picked from commit 85b3d54)
Fixes #xyz
Main Issue: #xyz
PIP: #xyz
Motivation
When using this command
bin/pulsar-admin topics set-retention -s 20g -t 200d persistent://public/default/test_v1
to set a retention policy for a topic, it failed with following exceptionIt is caused by cast Long to Integer failed
pulsar/pulsar-client-tools/src/main/java/org/apache/pulsar/admin/cli/CmdTopics.java
Lines 1854 to 1855 in 28e47fa
pulsar/pulsar-cli-utils/src/main/java/org/apache/pulsar/cli/converters/picocli/TimeUnitToSecondsConverter.java
Lines 28 to 35 in 28e47fa
Modifications
Change the type of
retentionTimeInSec
fromInteger
toLong
Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.
(or)
This change is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(example:)
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: