Skip to content
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

config: correct value of expected retention #5750

Merged
merged 1 commit into from
Aug 16, 2022

Commits on Jul 31, 2022

  1. config: correct value of expected retention

    the config's type of "retention.ms" is defined in `topic_properties`,
    like
    ```c++
    tristate<std::chrono::milliseconds> retention_duration{std::nullopt};
    ```
    
    and we use `describe_as_string()` to format the value of config
    description, and `describe_as_string()` in turn uses `fmt::format()`
    to stringify the value of config's value. in this case, the type
    of "retention.ms" is `std::chrono::milliseconds`, which is formatted
    like `1234ms` if its value is `std::chrono::milliseconds(1234)` in
    fmtlib v6.x, v7.x, v8.x and v.9.0.
    
    in this change, the expected value is changed from `"1234"` to
    `fmt::format("{}", 1234ms)` to more future-proof, in case fmtlib
    changes its formatting in future.
    
    for the same reason, the calls like
    `config::shard_local_cfg().delete_retention_ms().value_or(-1ms).count()`
    are also changed to
    `config::shard_local_cfg().delete_retention_ms().value_or(-1ms)`.
    
    Signed-off-by: Kefu Chai <tchaikov@gmail.com>
    tchaikov committed Jul 31, 2022
    Configuration menu
    Copy the full SHA
    8de1501 View commit details
    Browse the repository at this point in the history