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

store/tikv: handle the error of "mismatch cluster id" #7053

Merged
merged 3 commits into from Jul 16, 2018

Conversation

@zimulala
Copy link
Member

commented Jul 13, 2018

What have you changed? (mandatory)

We will exit the current TiDB when we encounter the error of "mismatch cluster id, need 6577643568868929567 but got 6577623361857143480".
The TiDB will meet the error of “mismatch cluster id” when the cluster ID of the TiDB‘s PD client does not match the PD.

What is the type of the changes? (mandatory)

  • Improvement (non-breaking change which is an improvement to an existing feature)

How has this PR been tested? (mandatory)

In local

Does this PR affect documentation (docs/docs-cn) update? (mandatory)

No

Does this PR affect tidb-ansible update? (mandatory)

No

Does this PR need to be added to the release notes? (mandatory)

release note:
Exit the current TiDB when it encounters the error of "mismatch cluster id".

@@ -233,6 +234,9 @@ func (b *Backoffer) Backoff(typ backoffType, err error) error {
}
}
log.Warn(errMsg)
if strings.Contains(errMsg, ErrMismatchClusterID.Error()) {

This comment has been minimized.

Copy link
@shenli

shenli Jul 13, 2018

Member

Can we define a string constant for "mismatch cluster id"?

This comment has been minimized.

Copy link
@shenli

shenli Jul 13, 2018

Member

Is it better to check and handle this in the pd-client? @disksing What do you think about it?

This comment has been minimized.

Copy link
@disksing

disksing Jul 13, 2018

Member

I think we can check it at the beginning of this function.

This comment has been minimized.

Copy link
@shenli

shenli Jul 16, 2018

Member

Good idea.

@@ -22,6 +22,8 @@ import (
var (
// ErrBodyMissing response body is missing error
ErrBodyMissing = errors.New("response body is missing")
// ErrMismatchClusterID returns the error that the cluster ID of the PD client does not match the PD.
ErrMismatchClusterID = errors.New("mismatch cluster id")

This comment has been minimized.

Copy link
@coocood

coocood Jul 16, 2018

Member

We don't need to define an error if we never throw it.
I think just make the string constant and check the string will do.

This comment has been minimized.

Copy link
@shenli

shenli Jul 16, 2018

Member

Agree

@zimulala

This comment has been minimized.

Copy link
Member Author

commented Jul 16, 2018

@disksing

This comment has been minimized.

Copy link
Member

commented Jul 16, 2018

LGTM

Copy link
Contributor

left a comment

LGTM

@ciscoxll

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2018

/run-all-tests

Copy link
Member

left a comment

LGTM

@ciscoxll ciscoxll merged commit b729a60 into pingcap:master Jul 16, 2018
4 checks passed
4 checks passed
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details
@zimulala zimulala deleted the zimulala:mismatch-cluster-id branch Aug 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.