-
Notifications
You must be signed in to change notification settings - Fork 719
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
api: use suitable status code and make TestResetTS stable #7368
Conversation
Signed-off-by: lhy1024 <admin@liudos.us>
[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 #7368 +/- ##
==========================================
- Coverage 74.28% 74.28% -0.01%
==========================================
Files 451 451
Lines 48899 48905 +6
==========================================
+ Hits 36327 36331 +4
- Misses 9348 9358 +10
+ Partials 3224 3216 -8
Flags with carried forward coverage won't be shown. Click here to find out more. |
Please add some explanation of the reason for this unstable test. |
When we call ResetTS, we may meet etcd transaction conflict. |
server/api/admin_test.go
Outdated
case http.StatusOK: | ||
re.Contains(string(b), "Reset ts successfully.") | ||
return true | ||
case http.StatusForbidden: |
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.
The status code is strange.
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.
replace it with 503
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.
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
@@ -185,6 +185,11 @@ func ResetTS(c *gin.Context) { | |||
if err = svr.ResetTS(ts, ignoreSmaller, skipUpperBoundCheck, 0); err != nil { | |||
if err == errs.ErrServerNotStarted { | |||
c.String(http.StatusInternalServerError, err.Error()) | |||
} else if err == errs.ErrEtcdTxnConflict { |
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.
This is not only for test? Because it will effect the resp to users.
I want to know whether this PR needs to cherry-pick.
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.
yes, not only for test. But I am not sure whether it is a bug to need cherry-pick.
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.
If it's only for TSO services, IMO we don't need to.
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.
PD mode also returns 403 when meeting ErrEtcdTxnConflict before this PR
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.
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.
After discussion with @niubell, we will only fix it on master branch.
/merge |
@lhy1024: 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: 50e0365
|
Signed-off-by: lhy1024 <admin@liudos.us>
/hold |
After a discussion with @niubell, we will only fix it on the master branch. |
/merge |
@lhy1024: 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: 8730e26
|
@lhy1024: Your PR was out of date, I have automatically updated it for you. If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. 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. |
close tikv#7411 Signed-off-by: lhy1024 <admin@liudos.us> Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
What problem does this PR solve?
Issue Number: Close #7411 #7314
What is changed and how does it work?
Check List
Tests
Release note