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

try remain replica when proxy access meet NotLeader region error #1207

Open
crazycs520 opened this issue Mar 6, 2024 · 0 comments
Open

try remain replica when proxy access meet NotLeader region error #1207

crazycs520 opened this issue Mar 6, 2024 · 0 comments

Comments

@crazycs520
Copy link
Contributor

Issue

1. Minimal reproduce step

Make config EnableForwarding set to true, which is enable forwarding.

In the following case, suppose the region leader is in store1.

	ca = replicaSelectorAccessPathCase{
		reqType:   tikvrpc.CmdPrewrite,
		readType:  kv.ReplicaReadLeader,
		accessErr: []RegionErrorType{DeadLineExceededErr, NotLeaderErr},

2. What did you expect to see?

		expect: &accessPathResult{
			accessPath: []string{
				"{addr: store1, replica-read: false, stale-read: false}",
				"{addr: store2, replica-read: false, stale-read: false, forward_addr: store1}",
				"{addr: store3, replica-read: false, stale-read: false}",
			},
			respErr:         "",
			respRegionError: nil,
		},

3. What did you see instead?

		expect: &accessPathResult{
			accessPath: []string{
				"{addr: store1, replica-read: false, stale-read: false}",
				"{addr: store2, replica-read: false, stale-read: false, forward_addr: store1}",
			},
			respErr:         "",
			respRegionError: fakeEpochNotMatch,
		},

The replica selector logic is:

  1. Try store1, but got DeadLineExceededErr, since store1 is unreachable.
  2. Try store2 and forward the request to store1, but got NotLeaderErr.
  3. return the fakeEpochNotMatch region error to up layer.

But maybe we can try remain replica which in store3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant