-
Notifications
You must be signed in to change notification settings - Fork 727
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
The status code of Not Leader
is sometimes wrong
#4797
Comments
/found automation |
Another problem is we also wrap the error of send or receive, which makes the status code change to unknown. |
There might be two ways to solve this bug: one is we abandon the stack, another is we turn it into gRPC status, modify some fields and wrap it again. |
ref #4797 Signed-off-by: Ryan Leung <rleungx@gmail.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
Does this issue already fixed? @rleungx |
The issue mentioned problem is fixed.
This has not been fixed yet |
Create another issue to track the problem. See #5020 |
ref tikv#4797 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ref tikv#4797 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ref tikv#4797 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ref tikv#4797 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ref tikv#4797 Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Bug Report
What did you do?
Try to access the
ScanRegions
gRPC endpoint in a non-leader PD.What did you expect to see?
The gRPC status code should be
Unavailable
, according to the definition ofErrNotLeader
.What did you see instead?
The error code is
Unknown
, and the error message is nested.What version of PD are you using (
pd-server -V
)?Nightly
Notes
The cause of this error may be:
pd/server/grpc_service.go
Lines 1490 to 1493 in 25bd92b
status.Status
, via the methodGRPCStatus
...https://github.com/grpc/grpc-go/blob/5682cc6a321507ce2a865beb8dd4bed9a5db0e06/status/status.go#L87-L96
...which would always fail for
errors.withStack
and wrap it withUNKNOWN
status.The text was updated successfully, but these errors were encountered: