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

For stale read request, we can retry DataIsNotReady replica by replica-read #1175

Closed
crazycs520 opened this issue Feb 23, 2024 · 2 comments
Closed

Comments

@crazycs520
Copy link
Contributor

Issue

1. Minimal reproduce step

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

	ca = replicaSelectorAccessPathCase{
		reqType:   tikvrpc.CmdGet,
		readType:  kv.ReplicaReadMixed,
		staleRead: true,
		label:     &metapb.StoreLabel{Key: "id", Value: "2"},
		accessErr: []RegionErrorType{DataIsNotReadyErr, ServerIsBusyErr, ServerIsBusyErr, ServerIsBusyErr},

2. What did you expect to see?

			accessPath: []string{
				"{addr: store2, replica-read: false, stale-read: true}",
				"{addr: store1, replica-read: false, stale-read: false}", // try leader with leader read.
				"{addr: store2, replica-read: true, stale-read: false}",
				"{addr: store3, replica-read: true, stale-read: false}",
			},

3. What did you see instead?

			accessPath: []string{
				"{addr: store2, replica-read: false, stale-read: true}",
				"{addr: store1, replica-read: false, stale-read: false}", // try leader with leader read.
				"{addr: store3, replica-read: true, stale-read: false}",

Currently, the replica selector logic is:

  1. try store2 by stale-read, since store2 has match label, but got DataIsNotReadyErr.
  2. retry leader in store1, but got ServerIsBusyErr.
  3. retry store3, but got ServerIsBusyErr too.
  4. failed, since no replica available.

The problem is, store2 is available, it's meet DataIsNotReadyErr, and we can use replica-read to retry store2 again.

@crazycs520
Copy link
Contributor Author

should fix by crazycs520@2d31d6f

@crazycs520
Copy link
Contributor Author

fix by #1181

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