tidb-operator icon indicating copy to clipboard operation
tidb-operator copied to clipboard

tidb status add gethealth info

Open mikechengwei opened this issue 2 years ago • 6 comments
trafficstars

What problem does this PR solve?

Close #4772 .

What is changed and how does it work?

When tidb sync status info, not ignoring error, and adding message field to sync error detail info.

Code changes

  • [ ] Has Go code change
  • [ ] Has CI related scripts change

Tests

  • [ ] Unit test
  • [ ] E2E test
  • [ ] Manual test
  • [ ] No code

Side effects

  • [ ] Breaking backward compatibility
  • [ ] Other side effects:

Related changes

  • [ ] Need to cherry-pick to the release branch
  • [ ] Need to update the documentation

Release Notes

Please refer to Release Notes Language Style Guide before writing the release note.


mikechengwei avatar Jan 19 '23 07:01 mikechengwei

[REVIEW NOTIFICATION]

This pull request has not been approved.

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment. After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review. Reviewer can cancel approval by submitting a request changes review.

ti-chi-bot avatar Jan 19 '23 07:01 ti-chi-bot

Codecov Report

Merging #4844 (5566df9) into master (ce44c90) will increase coverage by 5.38%. The diff coverage is 0.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4844      +/-   ##
==========================================
+ Coverage   59.39%   64.77%   +5.38%     
==========================================
  Files         226      230       +4     
  Lines       25622    28698    +3076     
==========================================
+ Hits        15218    18590    +3372     
+ Misses       8957     8581     -376     
- Partials     1447     1527      +80     
Flag Coverage Δ
e2e 42.40% <0.00%> (?)
unittest 59.39% <0.00%> (+<0.01%) :arrow_up:

codecov-commenter avatar Jan 19 '23 07:01 codecov-commenter

It is ok to return err in syncTidbClusterStatus the issue is GetHealth() DO NOT return the error and also DO NOT log the error when getBodyOk return the error(so we lost this error), so if something makes it keep failing to request the status API, we do not know what happens.

The original issue is /status keeps blocking(caused by some bug of the pd version), not returning a response. I can not see any log or other thinks about this, and I need to kubectl exec .. into the pod the request the status API to make sure that this keeps not health in the tc status.

Ok, I modified the code from your perspective. Ref: https://github.com/pingcap/tidb-operator/blob/cc2e2ee8adef538e3a0e2a77dc9bed43041d4174/pkg/controller/tidb_control.go#L74

original code is:

https://github.com/pingcap/tidb-operator/blob/dc1508a8a2998c376f7c97fc9d56bb285ba5ebf4/pkg/controller/tidb_control.go#L74

mikechengwei avatar Jan 27 '23 15:01 mikechengwei

/run-all-tests

mikechengwei avatar Jan 28 '23 06:01 mikechengwei

/run-all-tests

mikechengwei avatar Jan 30 '23 01:01 mikechengwei

PR needs rebase.

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 kubernetes/test-infra repository.

ti-chi-bot[bot] avatar Jul 20 '23 15:07 ti-chi-bot[bot]