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

ttl: get uint64 value fails because passing uint64(math.MaxInt32) #7980

Closed
HuSharp opened this issue Mar 26, 2024 · 0 comments · Fixed by #7979
Closed

ttl: get uint64 value fails because passing uint64(math.MaxInt32) #7980

HuSharp opened this issue Mar 26, 2024 · 0 comments · Fixed by #7979
Labels
severity/moderate type/bug The issue is confirmed as a bug.

Comments

@HuSharp
Copy link
Member

HuSharp commented Mar 26, 2024

Bug Report

What did you do?

set schedule.max-pending-peer-count as uint64(math.MaxInt32)

What did you expect to see?

parse value success

What did you see instead?

[2024/03/25 06:55:50.799 +00:00] [WARN] [persist_options.go:887] ["failed to parse schedule.max-pending-peer-count from PersistOptions's ttl storage"] [error="strconv.ParseUint: parsing \"2.147483647e+09\": invalid syntax"]
and get default value

Error Stack

json unmarshal will convert number(such as uint64(math.MaxInt32)) to float64

and then set float64 into TTL config

if err := s.persistOptions.SetTTLData(s.ctx, s.client, k, fmt.Sprint(v), ttl); err != nil {

will transfer fmt.Sprint(math.MaxInt32) to 2.147483647e+09 which will meet error

[2024/03/25 06:55:50.799 +00:00] [WARN] [persist_options.go:887] ["failed to parse schedule.max-pending-peer-count from PersistOptions's ttl storage"] [error="strconv.ParseUint: parsing \"2.147483647e+09\": invalid syntax"]

What version of PD are you using (pd-server -V)?

master

@HuSharp HuSharp added the type/bug The issue is confirmed as a bug. label Mar 26, 2024
ti-chi-bot bot pushed a commit that referenced this issue Mar 27, 2024
close #7980

Signed-off-by: husharp <jinhao.hu@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/moderate type/bug The issue is confirmed as a bug.
Projects
Development

Successfully merging a pull request may close this issue.

1 participant