Skip to content

--help and action are not consistent for set-retention on a namespace #16082

Closed

Description

@Anthony-Bible

Describe the bug
A clear and concise description of what the bug is.
When running set-retention with no units for the time. It defaults to seconds when --help says the default measurment is in minutes
To Reproduce
Steps to reproduce the behavior:
In pulsar 2.7.0, issue the following command:

  pulsar-admin namespaces set-retention dev/foo \
    --size 1024M \
    --time 1440

After that is set run

pulsar-toolset-0:/pulsar# pulsar-admin namespaces get-retention dev/foo
{
  "retentionTimeInMinutes" : 24,
  "retentionSizeInMB" : 9536
}

Expected behavior
This should in fact set the retention time to 1440 minutes like it says in the help docs:

pulsar-toolset-0:/pulsar# pulsar-admin namespaces set-retention --help
The following options are required: [--size | -s], [--time | -t]

Set the retention policy for a namespace
Usage: set-retention [options] tenant/namespace
  Options:
  * --size, -s
      Retention size limit (eg: 10M, 16G, 3T). 0 or less than 1MB means no 
      retention and -1 means infinite size retention
  * --time, -t
      Retention time in minutes (or minutes, hours,days,weeks eg: 100m, 3h, 
      2d, 5w). 0 means no retention and -1 means infinite time retention


Additional context
While at this time I can not confirm it still sets it this way in 2.9.0, I did find in 2.9.0 the help still says it defaults to minutes which makes me believe this is a bug or an undocumented change.

Activity

  1. added
    type/bug
    on Jun 15, 2022
  2. github-actions commented on Jul 16, 2022

    @github-actions

    The issue had no activity for 30 days, mark with Stale label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Staletype/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions