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

The status code of Not Leader is sometimes wrong #4797

Closed
YuJuncen opened this issue Apr 8, 2022 · 6 comments
Closed

The status code of Not Leader is sometimes wrong #4797

YuJuncen opened this issue Apr 8, 2022 · 6 comments
Assignees
Labels

Comments

@YuJuncen
Copy link

YuJuncen commented Apr 8, 2022

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 of ErrNotLeader.

What did you see instead?

The error code is Unknown, and the error message is nested.

rpc error: code = Unknown desc = rpc error: code = Unavailable desc = not leader
                                 ^ The real `ErrNotLeader`.
github.com/tikv/pd/client.(*client).ScanRegions
	/go/pkg/mod/github.com/tikv/pd/client@v0.0.0-20220307081149-841fa61e9710/client.go:1500
github.com/pingcap/tidb/br/pkg/restore.(*pdClient).ScanRegions
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/br/br/pkg/restore/split_client.go:502
github.com/pingcap/tidb/br/pkg/restore.PaginateScanRegion.func1
	/home/jenkins/agent/workspace/build-common/go/src/github.com/pingcap/br/br/pkg/restore/split.go:452

What version of PD are you using (pd-server -V)?

Nightly

Notes

The cause of this error may be:

@YuJuncen YuJuncen added the type/bug The issue is confirmed as a bug. label Apr 8, 2022
@mayjiang0203
Copy link

mayjiang0203 commented Apr 8, 2022

/found automation
/severity major
/assign rleungx

@rleungx
Copy link
Member

rleungx commented Apr 8, 2022

Another problem is we also wrap the error of send or receive, which makes the status code change to unknown.

@rleungx
Copy link
Member

rleungx commented Apr 8, 2022

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.

ti-chi-bot added a commit that referenced this issue Apr 9, 2022
ref #4797

Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
@rleungx rleungx self-assigned this Apr 11, 2022
@VelocityLight VelocityLight added the affects-6.1 This bug affects the 6.1.x(LTS) versions. label May 20, 2022
@nolouch
Copy link
Contributor

nolouch commented May 23, 2022

Does this issue already fixed? @rleungx

@rleungx
Copy link
Member

rleungx commented May 23, 2022

The issue mentioned problem is fixed.

Another problem is we also wrap the error of send or receive, which makes the status code change to unknown.

This has not been fixed yet

@rleungx
Copy link
Member

rleungx commented May 24, 2022

Another problem is we also wrap the error of send or receive, which makes the status code change to unknown.

Create another issue to track the problem. See #5020

@rleungx rleungx closed this as completed May 24, 2022
@rleungx rleungx removed the affects-6.1 This bug affects the 6.1.x(LTS) versions. label May 24, 2022
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Jun 22, 2022
ref tikv#4797

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Jun 22, 2022
ref tikv#4797

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Jun 22, 2022
ref tikv#4797

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Jun 22, 2022
ref tikv#4797

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Jun 22, 2022
ref tikv#4797

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot added a commit that referenced this issue Jun 23, 2022
ref #4797, ref #4798

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ryan Leung <rleungx@gmail.com>
ti-chi-bot added a commit that referenced this issue Jul 5, 2022
ref #4797, ref #4798

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ryan Leung <rleungx@gmail.com>
ti-chi-bot added a commit that referenced this issue Jul 5, 2022
ref #4797, ref #4798

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ryan Leung <rleungx@gmail.com>
ti-chi-bot added a commit that referenced this issue Jul 18, 2022
ref #4797, ref #4798

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ryan Leung <rleungx@gmail.com>
ti-chi-bot added a commit that referenced this issue Sep 21, 2022
ref #4797, ref #4798

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: Ryan Leung <rleungx@gmail.com>

Co-authored-by: Ryan Leung <rleungx@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants