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

rpk cluster config get outputs scientific notation for large int values #6070

Closed
r-vasquez opened this issue Aug 17, 2022 · 0 comments
Closed
Labels
area/rpk kind/bug Something isn't working

Comments

@r-vasquez
Copy link
Contributor

Version & Environment

v22.2.1

What went wrong?

We solved a similar issue in #5249 for local config values (redpanda.yaml) but we still have the same problem for cluster configuration:

$ rpk cluster config get storage_min_free_bytes --api-urls '0.0.0.0:9645'
1.048576e+07

What should have happened instead?

$ rpk cluster config get storage_min_free_bytes --api-urls '0.0.0.0:9645'
10485760

How to reproduce the issue?

  1. Set an int value with a large number via rpk cluster config set <key> <value> (e.g: rpk cluster config set storage_min_free_bytes 10485760)
  2. Retrieve the value using rpk cluster config get <key> (e.g: rpk cluster config get storage_min_free_bytes)
@r-vasquez r-vasquez added kind/bug Something isn't working area/rpk labels Aug 17, 2022
twmb added a commit to twmb/redpanda that referenced this issue Oct 23, 2022
The scientific notation was from json unmarshal rules. We now convert to
int64 directly.

Note that edit, import, and export all handle this already.

We remove the one impossible branch in export, since we know we cannot
have an `int` in the config map, and we remove the hack in the test that
converted from scientific notation.

Closes redpanda-data#6070.
twmb added a commit to twmb/redpanda that referenced this issue Oct 24, 2022
The scientific notation was from json unmarshal rules. We now convert to
int64 directly.

Note that edit, import, and export all handle this already.

We remove the one impossible branch in export, since we know we cannot
have an `int` in the config map, and we remove the hack in the test that
converted from scientific notation.

Closes redpanda-data#6070.
twmb added a commit to twmb/redpanda that referenced this issue Oct 25, 2022
The scientific notation was from json unmarshal rules. We now convert to
int64 directly.

Note that edit, import, and export all handle this already.

We remove the one impossible branch in export, since we know we cannot
have an `int` in the config map, and we remove the hack in the test that
converted from scientific notation.

Closes redpanda-data#6070.

(cherry picked from commit 610e3ad)
twmb added a commit to twmb/redpanda that referenced this issue Oct 25, 2022
The scientific notation was from json unmarshal rules. We now convert to
int64 directly.

Note that edit, import, and export all handle this already.

We remove the one impossible branch in export, since we know we cannot
have an `int` in the config map, and we remove the hack in the test that
converted from scientific notation.

Closes redpanda-data#6070.

(cherry picked from commit 610e3ad)
(cherry picked from commit cc45add)
twmb added a commit to twmb/redpanda that referenced this issue Oct 25, 2022
The scientific notation was from json unmarshal rules. We now convert to
int64 directly.

Note that edit, import, and export all handle this already.

We remove the one impossible branch in export, since we know we cannot
have an `int` in the config map, and we remove the hack in the test that
converted from scientific notation.

Closes redpanda-data#6070.

(cherry picked from commit 610e3ad)
(cherry picked from commit cc45add)
r-vasquez added a commit to r-vasquez/redpanda that referenced this issue Jun 6, 2024
In 610e3ad we introduced a fix for redpanda-data#6070, to avoid
printing large numbers with scientific notation, we
treated all numbers as integers.

Now, the API uses float values and they are being
rounded, this change introduce a mod check to
determine whether the number is an integer or a
float.
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this issue Jun 6, 2024
In 610e3ad we introduced a fix for redpanda-data#6070, to avoid
printing large numbers with scientific notation, we
treated all numbers as integers.

Now, the API uses float values and they are being
rounded, this change introduce a mod check to
determine whether the number is an integer or a
float.

(cherry picked from commit b7a57ed)
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this issue Jun 6, 2024
In 610e3ad we introduced a fix for redpanda-data#6070, to avoid
printing large numbers with scientific notation, we
treated all numbers as integers.

Now, the API uses float values and they are being
rounded, this change introduce a mod check to
determine whether the number is an integer or a
float.

(cherry picked from commit b7a57ed)
vbotbuildovich pushed a commit to vbotbuildovich/redpanda that referenced this issue Jun 6, 2024
In 610e3ad we introduced a fix for redpanda-data#6070, to avoid
printing large numbers with scientific notation, we
treated all numbers as integers.

Now, the API uses float values and they are being
rounded, this change introduce a mod check to
determine whether the number is an integer or a
float.

(cherry picked from commit b7a57ed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rpk kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant