-
Notifications
You must be signed in to change notification settings - Fork 720
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: Trying to get float64 after get uint64 fails. #7979
Conversation
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #7979 +/- ##
==========================================
+ Coverage 73.53% 73.56% +0.02%
==========================================
Files 436 436
Lines 48467 48472 +5
==========================================
+ Hits 35641 35659 +18
+ Misses 9760 9749 -11
+ Partials 3066 3064 -2
Flags with carried forward coverage won't be shown. Click here to find out more. |
@@ -876,7 +876,16 @@ func (o *PersistOptions) getTTLUint(key string) (uint64, bool, error) { | |||
return 0, false, nil | |||
} | |||
r, err := strconv.ParseUint(stringForm, 10, 64) | |||
return r, true, err | |||
if err == nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we need to provide a util about it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transfer function name getTTLUint
to getTTLNumber
and add more comment
c6d2588
to
953623d
Compare
Signed-off-by: husharp <[email protected]>
/merge |
@HuSharp: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: 296c811
|
What problem does this PR solve?
Issue Number: Close #7980
What is changed and how does it work?
when set
schedule.max-pending-peer-count
asuint64(math.MaxInt32)
json unmarshal will convert number(
uint64(math.MaxInt32)
) to float64and then set float64 into TTL config
pd/server/server.go
Line 1955 in 6ee25f9
and then
fmt.Sprint(float(math.MaxInt32))
will transferfloat(math.MaxInt32)
to2.147483647e+09
which will meet error when try to get TTL config[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 then get default value 64 which is not equal
math.MaxInt32
How does this pr work?
try to parse float64 when meet parse uint64 failed
Check List
Tests
Release note