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

CallCommandOnLeader frequently received EpochNotMatch #415

Open
howz97 opened this issue Jul 19, 2022 · 0 comments
Open

CallCommandOnLeader frequently received EpochNotMatch #415

howz97 opened this issue Jul 19, 2022 · 0 comments

Comments

@howz97
Copy link

howz97 commented Jul 19, 2022

if CallCommandOnLeader request with stale region epoch (maybe split happend), client will receive EpochNotMatch, and it will retry with wrong region until timeout.

		if resp.Header.Error != nil {
			err := resp.Header.Error
			if err.GetStaleCommand() != nil || err.GetEpochNotMatch() != nil || err.GetNotLeader() != nil {
				log.Debugf("encouter retryable err %+v", resp)
				// fixme: maybe region splited when requesting, resp will be EpochNotMatch until timeout
				if err.GetNotLeader() != nil && err.GetNotLeader().Leader != nil {
					leader = err.GetNotLeader().Leader
					log.Debugf("retry on leader peer=%d,%d", leader.Id, leader.StoreId)
				} else {
					leader = c.LeaderOfRegion(regionID)
				}
				continue
			}
		}
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