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: core's uint64 max value isn't correctly handled #16723

Open
daisukebe opened this issue Feb 27, 2024 · 5 comments
Open

rpk: core's uint64 max value isn't correctly handled #16723

daisukebe opened this issue Feb 27, 2024 · 5 comments
Labels
area/rpk kind/bug Something isn't working stale

Comments

@daisukebe
Copy link
Contributor

daisukebe commented Feb 27, 2024

Version & Environment

Redpanda version: (use rpk version): dev (89731b2)

What went wrong?

In Redpanda core, max_concurrent_producer_ids is set to uint64 max 18446744073709551615 by default. Here's a snip from a startup log.

INFO  2024-02-27 14:41:56,186 [shard 0:main] main - application.cc:760 - redpanda.max_concurrent_producer_ids:18446744073709551615- Max number of the active sessions (producers). When the threshold is passed Redpanda terminates old sessions. When an idle producer corresponding to the terminated session wakes up and produces - it leads to its batches being rejected with out of order sequence error.

However, rpk cluster config get max_concurrent_producer_ids returns -9223372036854775808 as this conversion doesn't work correctly.

				// currentConfig is the result of json.Unmarshal into a
				// map[string]interface{}. Due to json rules, all numbers
				// are float64. We do not want to print floats, especially
				// for large numbers.
				if f64, ok := val.(float64); ok {
					val = int64(f64)
				}

What should have happened instead?

The command should return 18446744073709551615

How to reproduce the issue?

  1. Start a new cluster
  2. Run rpk cluster config get max_concurrent_producer_ids

JIRA Link: CORE-1812

JIRA Link: CORE-8989

@daisukebe daisukebe added kind/bug Something isn't working area/rpk labels Feb 27, 2024
@daisukebe
Copy link
Contributor Author

I see converting from float64 to uint64 doesn't work in a reliable way in Go. So, converting to string is the way to go as export.go does?

			case float64:
				scalarVal = strconv.FormatFloat(x, 'f', -1, 64)

Copy link

github-actions bot commented Oct 1, 2024

This issue hasn't seen activity in 3 months. If you want to keep it open, post a comment or remove the stale label – otherwise this will be closed in two weeks.

@github-actions github-actions bot added the stale label Oct 1, 2024
Copy link

This issue was closed due to lack of activity. Feel free to reopen if it's still relevant.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2024
@r-vasquez r-vasquez reopened this Jan 31, 2025
@r-vasquez
Copy link
Contributor

r-vasquez commented Feb 1, 2025

Hi @daisukebe, I'm taking a look into this, and we are currently losing precision with the current way of handling it in export, if you do rpk cluster config export --all and then grep for the value, you'll see 18446744073709552000 instead of 18446744073709551615.

The cleaner solution will be to use json.Number instead, this will require a change in https://github.com/redpanda-data/common-go/blob/main/rpadmin/api_config.go#L50 and some other parts of the rpk code. I'll be working on this

@daisukebe
Copy link
Contributor Author

Thank you, Rogger!

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 stale
Projects
None yet
Development

No branches or pull requests

2 participants