ttl: get uint64 value fails because passing uint64(math.MaxInt32)
#7980
Description
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
Line 1955 in 6ee25f9
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
Metadata
Assignees
Type
Projects
Status
Closed