We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
PreferLeader
It seems PreferLeader is broken after #843. In the following case, followers won't be tried even when they are available.
func (s *testRegionRequestToThreeStoresSuite) TestDebugPreferLeader() { key := []byte("key") bo := retry.NewBackoffer(context.Background(), -1) // load region into cache loc, err := s.cache.LocateKey(bo, key) s.Require().NoError(err) // make leader unreachable region := s.cache.GetCachedRegionWithRLock(loc.Region) leader, _, _, _ := region.WorkStorePeer(region.getStore()) atomic.StoreUint32(&leader.livenessState, uint32(unreachable)) // make request req := tikvrpc.NewReplicaReadRequest(tikvrpc.CmdGet, &kvrpcpb.GetRequest{Key: key}, kv.ReplicaReadPreferLeader, nil) req.ReadReplicaScope = oracle.GlobalTxnScope req.TxnScope = oracle.GlobalTxnScope // setup mock client s.regionRequestSender.client = &fnClient{fn: func(ctx context.Context, addr string, req *tikvrpc.Request, timeout time.Duration) (response *tikvrpc.Response, err error) { logutil.BgLogger().Sugar().Infof(">>> rpc to %s", addr) return &tikvrpc.Response{Resp: &kvrpcpb.GetResponse{Value: []byte(addr)}}, nil }} logutil.BgLogger().Sugar().Info(s.regionRequestSender.SendReqCtx(bo, req, loc.Region, time.Second, tikvrpc.TiKV)) }
The text was updated successfully, but these errors were encountered:
Please take a look @you06
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
It seems
PreferLeader
is broken after #843. In the following case, followers won't be tried even when they are available.The text was updated successfully, but these errors were encountered: