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

errs: remove redundant FastGenWithCause in ZapError #7497

Merged
merged 6 commits into from
Dec 13, 2023

Conversation

CabinfeverB
Copy link
Member

What problem does this PR solve?

Issue Number: Close #7496

What is changed and how does it work?

Check List

Tests

  • Manual test (add detailed scripts or steps below)
    after
[2023/12/06 10:43:25.636 +08:00] [ERROR] [tso_dispatcher.go:498] ["[tso] getTS error after processing requests"] [dc-location=global] [stream-addr=http://127.0.0.1:64317] [error="[PD:client:ErrClientGetTSO]get TSO failed, rpc error: code = Unknown desc = [PD:tso:ErrGenerateTimestamp]generate timestamp failed, requested pd is not leader of cluster"]

some example

[2023/12/06 11:16:43.550 +08:00] [ERROR] [client_test.go:506] ["[pd] failed to close grpc clientConn"] [error="[PD:grpc:ErrCloseGRPCConn]close gRPC connection failed: test"] [stack="github.com/tikv/pd/tests/integrations/client_test.TestCustomTimeout\n\t/Users/jiangyongbo/github/pd/tests/integrations/client/client_test.go:506\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1595"]
[2023/12/06 11:16:43.551 +08:00] [ERROR] [client_test.go:507] ["[tso] fetch pending tso requests error"] [error="[PD:client:ErrClientGetTSO]get TSO failed: test"] [stack="github.com/tikv/pd/tests/integrations/client_test.TestCustomTimeout\n\t/Users/jiangyongbo/github/pd/tests/integrations/client/client_test.go:507\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1595"]
[2023/12/06 11:16:43.551 +08:00] [ERROR] [client_test.go:508] ["send heartbeat message fail"] [error="[PD:grpc:ErrGRPCSend]send request error: test"] [stack="github.com/tikv/pd/tests/integrations/client_test.TestCustomTimeout\n\t/Users/jiangyongbo/github/pd/tests/integrations/client/client_test.go:508\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1595"]
[2023/12/06 11:16:43.551 +08:00] [ERROR] [client_test.go:509] ["watch gc safe point v2 error"] [error="[PD:client:ErrClientWatchGCSafePointV2Stream]watch gc safe point v2 stream failed: test"] [stack="github.com/tikv/pd/tests/integrations/client_test.TestCustomTimeout\n\t/Users/jiangyongbo/github/pd/tests/integrations/client/client_test.go:509\ntesting.tRunner\n\t/usr/local/go/src/testing/testing.go:1595"]

Code changes

Side effects

  • Possible performance regression
  • Increased code complexity
  • Breaking backward compatibility

Related changes

Release note

None.

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Copy link
Contributor

ti-chi-bot bot commented Dec 6, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • lhy1024
  • nolouch

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 ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 6, 2023
@CabinfeverB CabinfeverB changed the title errs: fix wrong wrap in ZapError errs: remove redundant FastGenWithCause in ZapError Dec 6, 2023
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
Copy link

codecov bot commented Dec 6, 2023

Codecov Report

Merging #7497 (98f5a6f) into master (0e220b0) will decrease coverage by 0.07%.
Report is 1 commits behind head on master.
The diff coverage is 20.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7497      +/-   ##
==========================================
- Coverage   74.66%   74.59%   -0.07%     
==========================================
  Files         454      454              
  Lines       50142    50142              
==========================================
- Hits        37437    37404      -33     
- Misses       9392     9403      +11     
- Partials     3313     3335      +22     
Flag Coverage Δ
unittests 74.59% <20.00%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@@ -27,7 +27,7 @@ func ZapError(err error, causeError ...error) zap.Field {
}
if e, ok := err.(*errors.Error); ok {
if len(causeError) >= 1 {
err = e.Wrap(causeError[0]).FastGenWithCause()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to check other FastGenWithCause?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I forgot about other direct use cases

@ti-chi-bot ti-chi-bot bot added the status/LGT1 Indicates that a PR has LGTM 1. label Dec 7, 2023
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Dec 8, 2023
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 8, 2023
Copy link
Contributor

@nolouch nolouch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ti-chi-bot ti-chi-bot bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Dec 13, 2023
@nolouch
Copy link
Contributor

nolouch commented Dec 13, 2023

/merge

Copy link
Contributor

ti-chi-bot bot commented Dec 13, 2023

@nolouch: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

You only need to trigger /merge once, and 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.

If you have any questions about the PR merge process, please refer to pr process.

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.

Copy link
Contributor

ti-chi-bot bot commented Dec 13, 2023

This pull request has been accepted and is ready to merge.

Commit hash: 3efb9a3

@ti-chi-bot ti-chi-bot bot added the status/can-merge Indicates a PR has been approved by a committer. label Dec 13, 2023
@ti-chi-bot ti-chi-bot bot merged commit f51f913 into tikv:master Dec 13, 2023
24 of 26 checks passed
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.1: #7544.

ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this pull request Dec 13, 2023
close tikv#7496

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-7.5: #7545.

ti-chi-bot bot pushed a commit that referenced this pull request Dec 22, 2023
close #7496

Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>

Co-authored-by: Cabinfever_B <cabinfeveroier@gmail.com>
ti-chi-bot bot added a commit that referenced this pull request Dec 22, 2023
close #7496

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Cabinfever_B <cabinfeveroier@gmail.com>

Co-authored-by: Yongbo Jiang <cabinfeveroier@gmail.com>
Co-authored-by: Cabinfever_B <cabinfeveroier@gmail.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
@JmPotato JmPotato deleted the fix_zap_error branch January 2, 2024 08:14
rleungx pushed a commit to rleungx/pd that referenced this pull request Jan 25, 2024
…ikv#245)

Co-authored-by: Yongbo Jiang <cabinfeveroier@gmail.com>
Co-authored-by: ti-chi-bot[bot] <108142056+ti-chi-bot[bot]@users.noreply.github.com>
close tikv#7496
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-cherry-pick-release-7.1 Should cherry pick this PR to release-7.1 branch. needs-cherry-pick-release-7.5 Should cherry pick this PR to release-7.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The error log of TSO doesn't print the cause
4 participants