Commit a3875bc 1 parent c7a847c commit a3875bc Copy full SHA for a3875bc
File tree 2 files changed +3
-2
lines changed
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1657,7 +1657,8 @@ func regionErrorToLabel(e *errorpb.Error) string {
1657
1657
return "flashback_not_prepared"
1658
1658
} else if e .GetIsWitness () != nil {
1659
1659
return "peer_is_witness"
1660
- } else if strings .HasPrefix (e .Message , "mismatch peer id" ) {
1660
+ } else if strings .Contains (e .Message , "mismatch peer id" ) {
1661
+ // the error message is like "[components/raftstore/src/store/util.rs:428]: mismatch peer id ? != ?"
1661
1662
// the `mismatch peer id` error does not has a specific error type, so we have to match the error message.
1662
1663
// TODO: add a specific error type for `mismatch peer id`.
1663
1664
return "mismatch_peer_id"
Original file line number Diff line number Diff line change @@ -1067,7 +1067,7 @@ func (s *testRegionRequestToThreeStoresSuite) TestReplicaReadFallbackToLeaderReg
1067
1067
// Return `mismatch peer id` when accesses the leader.
1068
1068
if addr == s .cluster .GetStore (s .storeIDs [0 ]).Address {
1069
1069
return & tikvrpc.Response {Resp : & kvrpcpb.GetResponse {RegionError : & errorpb.Error {
1070
- Message : " mismatch peer id 1 != 2" ,
1070
+ Message : `"[components/raftstore/src/store/util.rs:428]: mismatch peer id 1 != 2"` ,
1071
1071
}}}, nil
1072
1072
}
1073
1073
return & tikvrpc.Response {Resp : & kvrpcpb.GetResponse {RegionError : & errorpb.Error {
You can’t perform that action at this time.
0 commit comments