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

client.go: Degrade log level when passing unavailable endpoint to client (#1852) #1856

Merged
merged 1 commit into from Oct 29, 2019

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Oct 29, 2019

cherry-pick #1852 to release-3.0


What problem does this PR solve?

when some endpoint passing into the client is unavailable
in calling NewClient() will log the error log, but the service is
supported to be still available if one of the endpoints can work.
error level log will be too serious and confuse the user.

What is changed and how it works?

client.go: Degrade log level when passing unavailable endpoint to client

Check List

Tests

  • Manual test (add detailed scripts or steps below)
    log after this pr:
[2019/10/28 18:51:04.975 +08:00] [INFO] [client.go:144] ["[pd] create pd client with endpoints"] [pd-address="[localhost:9999,localhost:2379]"]
[2019/10/28 18:51:04.987 +08:00] [WARN] [client.go:200] ["[pd] failed to get cluster id"] [url=http://localhost:9999] [error="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = \"transport: Error while dialing dial tcp [::1]:9999: connect: connection refused\""] [errorVerbose="rpc error: code = Unavailable desc = all SubConns are in TransientFailure, latest connection error: connection error: desc = \"transport: Error while dialing dial tcp [::1]:9999: connect: connection refused\"\ngithub.com/pingcap/pd/client.(*client).getMembers\n\t/Users/huangjiahao/go/pkg/mod/github.com/july2993/pd@v1.1.0-beta.0.20191028103916-ec504e3dce8f/client/client.go:235\ngithub.com/pingcap/pd/client.(*client).initClusterID\n\t/Users/huangjiahao/go/pkg/mod/github.com/july2993/pd@v1.1.0-beta.0.20191028103916-ec504e3dce8f/client/client.go:197\ngithub.com/pingcap/pd/client.(*client).initRetry\n\t/Users/huangjiahao/go/pkg/mod/github.com/july2993/pd@v1.1.0-beta.0.20191028103916-ec504e3dce8f/client/client.go:184\ngithub.com/pingcap/pd/client.NewClient\n\t/Users/huangjiahao/go/pkg/mod/github.com/july2993/pd@v1.1.0-beta.0.20191028103916-ec504e3dce8f/client/client.go:157\nmain.main\n\t/Users/huangjiahao/go/src/github.com/pingcap/tidb-binlog/cmd/pd.go:10\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1357"]
[2019/10/28 18:51:04.994 +08:00] [INFO] [client.go:252] ["[pd] switch leader"] [new-leader=http://127.0.0.1:2379] [old-leader=]
[2019/10/28 18:51:04.994 +08:00] [INFO] [client.go:163] ["[pd] init cluster id"] [cluster-id=6752802479515318396]

Code changes

Side effects

Related changes

  • Need to cherry-pick to the release branch

when some endpoint passing into the client is unavailable
in calling NewClient() will log the error log, but the service is
supported to be still available if one of the endpoint can work.
error level log will be too serious and confuse user.
@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Oct 29, 2019
@lhy1024
Copy link
Contributor

lhy1024 commented Oct 29, 2019

/run-all-tests

@lhy1024
Copy link
Contributor

lhy1024 commented Oct 29, 2019

/run-integration-common-test

@lhy1024 lhy1024 merged commit ea30680 into tikv:release-3.0 Oct 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/can-merge Indicates a PR has been approved by a committer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants