From a507bc1d6f8dcf82b12dcd7da98fb6d52118fa3b Mon Sep 17 00:00:00 2001 From: siddontang Date: Tue, 3 May 2016 13:55:35 +0800 Subject: [PATCH] remove peer (#88) remove peer --- cmd/Godeps/Godeps.json | 22 +- .../pingcap/kvproto/pkg/errorpb/errorpb.pb.go | 51 +++-- .../pingcap/kvproto/pkg/kvrpcpb/kvrpcpb.pb.go | 127 +++++------ .../pingcap/kvproto/pkg/metapb/metapb.pb.go | 66 ++---- .../kvproto/pkg/pd_jobpb/pd_jobpb.pb.go | 48 +++-- .../pingcap/kvproto/pkg/pdpb/pdpb.pb.go | 141 ++++++------ .../kvproto/pkg/raft_cmdpb/raft_cmdpb.pb.go | 202 ++++++++---------- .../pkg/raft_serverpb/raft_serverpb.pb.go | 61 +++--- pd-client/client_test.go | 6 +- server/cluster.go | 16 +- server/cluster_test.go | 30 +-- server/cluster_worker.go | 144 ++++++------- server/cluster_worker_test.go | 173 +++++++-------- server/command.go | 26 +-- 14 files changed, 504 insertions(+), 609 deletions(-) diff --git a/cmd/Godeps/Godeps.json b/cmd/Godeps/Godeps.json index f46d62986ef..12cdf71c080 100644 --- a/cmd/Godeps/Godeps.json +++ b/cmd/Godeps/Godeps.json @@ -75,47 +75,47 @@ }, { "ImportPath": "github.com/pingcap/kvproto/pkg/coprocessor", - "Rev": "50ccf55d2930f378d3803be9d040c6e6928b5d47" + "Rev": "cc49ef8f6deddd100328d62b054e268c14de27c5" }, { "ImportPath": "github.com/pingcap/kvproto/pkg/errorpb", - "Rev": "50ccf55d2930f378d3803be9d040c6e6928b5d47" + "Rev": "cc49ef8f6deddd100328d62b054e268c14de27c5" }, { "ImportPath": "github.com/pingcap/kvproto/pkg/kvrpcpb", - "Rev": "50ccf55d2930f378d3803be9d040c6e6928b5d47" + "Rev": "cc49ef8f6deddd100328d62b054e268c14de27c5" }, { "ImportPath": "github.com/pingcap/kvproto/pkg/metapb", - "Rev": "50ccf55d2930f378d3803be9d040c6e6928b5d47" + "Rev": "cc49ef8f6deddd100328d62b054e268c14de27c5" }, { "ImportPath": "github.com/pingcap/kvproto/pkg/msgpb", - "Rev": "50ccf55d2930f378d3803be9d040c6e6928b5d47" + "Rev": "cc49ef8f6deddd100328d62b054e268c14de27c5" }, { "ImportPath": "github.com/pingcap/kvproto/pkg/pd_jobpb", - "Rev": "50ccf55d2930f378d3803be9d040c6e6928b5d47" + "Rev": "cc49ef8f6deddd100328d62b054e268c14de27c5" }, { "ImportPath": "github.com/pingcap/kvproto/pkg/pdpb", - "Rev": "50ccf55d2930f378d3803be9d040c6e6928b5d47" + "Rev": "cc49ef8f6deddd100328d62b054e268c14de27c5" }, { "ImportPath": "github.com/pingcap/kvproto/pkg/raft_cmdpb", - "Rev": "50ccf55d2930f378d3803be9d040c6e6928b5d47" + "Rev": "cc49ef8f6deddd100328d62b054e268c14de27c5" }, { "ImportPath": "github.com/pingcap/kvproto/pkg/raft_serverpb", - "Rev": "50ccf55d2930f378d3803be9d040c6e6928b5d47" + "Rev": "cc49ef8f6deddd100328d62b054e268c14de27c5" }, { "ImportPath": "github.com/pingcap/kvproto/pkg/raftpb", - "Rev": "50ccf55d2930f378d3803be9d040c6e6928b5d47" + "Rev": "cc49ef8f6deddd100328d62b054e268c14de27c5" }, { "ImportPath": "github.com/pingcap/kvproto/pkg/util", - "Rev": "50ccf55d2930f378d3803be9d040c6e6928b5d47" + "Rev": "cc49ef8f6deddd100328d62b054e268c14de27c5" }, { "ImportPath": "github.com/twinj/uuid", diff --git a/cmd/vendor/github.com/pingcap/kvproto/pkg/errorpb/errorpb.pb.go b/cmd/vendor/github.com/pingcap/kvproto/pkg/errorpb/errorpb.pb.go index cac63dcb086..7018b3db0ed 100644 --- a/cmd/vendor/github.com/pingcap/kvproto/pkg/errorpb/errorpb.pb.go +++ b/cmd/vendor/github.com/pingcap/kvproto/pkg/errorpb/errorpb.pb.go @@ -20,7 +20,6 @@ package errorpb import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" -import metapb "github.com/pingcap/kvproto/pkg/metapb" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal @@ -32,9 +31,9 @@ var _ = math.Inf const _ = proto.ProtoPackageIsVersion1 type NotLeader struct { - RegionId *uint64 `protobuf:"varint,1,opt,name=region_id" json:"region_id,omitempty"` - Leader *metapb.Peer `protobuf:"bytes,2,opt,name=leader" json:"leader,omitempty"` - XXX_unrecognized []byte `json:"-"` + RegionId *uint64 `protobuf:"varint,1,opt,name=region_id" json:"region_id,omitempty"` + LeaderStoreId *uint64 `protobuf:"varint,2,opt,name=leader_store_id" json:"leader_store_id,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *NotLeader) Reset() { *m = NotLeader{} } @@ -49,11 +48,11 @@ func (m *NotLeader) GetRegionId() uint64 { return 0 } -func (m *NotLeader) GetLeader() *metapb.Peer { - if m != nil { - return m.Leader +func (m *NotLeader) GetLeaderStoreId() uint64 { + if m != nil && m.LeaderStoreId != nil { + return *m.LeaderStoreId } - return nil + return 0 } type RegionNotFound struct { @@ -181,22 +180,22 @@ func init() { } var fileDescriptor0 = []byte{ - // 272 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x90, 0x4f, 0x4b, 0xc3, 0x40, - 0x10, 0xc5, 0x49, 0xff, 0x58, 0x32, 0x89, 0xd5, 0xae, 0x07, 0x83, 0x78, 0x90, 0x15, 0xa4, 0xa7, - 0x80, 0x39, 0x7b, 0xad, 0x20, 0x8a, 0x88, 0x7a, 0x5f, 0x56, 0x33, 0xd6, 0x60, 0xbb, 0x1b, 0x36, - 0xeb, 0xa1, 0x1f, 0xd3, 0x6f, 0xe4, 0xce, 0x34, 0x6d, 0x6d, 0xf0, 0xb8, 0x6f, 0x7e, 0x6f, 0xe6, - 0xbd, 0x85, 0x43, 0x74, 0xce, 0xba, 0xfa, 0x2d, 0xaf, 0x9d, 0xf5, 0x56, 0x8c, 0xda, 0xe7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 0x00, 0xff, 0xff, 0x45, 0x2b, 0xa7, 0x94, 0xc1, 0x01, 0x00, 0x00, + // 262 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x90, 0x41, 0x4f, 0xc2, 0x40, + 0x10, 0x85, 0x53, 0x81, 0x90, 0x4e, 0x11, 0x64, 0x3d, 0xc0, 0xd1, 0xac, 0x89, 0xe1, 0x44, 0x62, + 0x2f, 0xfe, 0x02, 0x4c, 0x8c, 0xc6, 0x83, 0x7a, 0xdf, 0x54, 0x3b, 0x62, 0x23, 0xee, 0x34, 0xb3, + 0xeb, 0x81, 0x9f, 0xe9, 0x3f, 0xb2, 0x33, 0x45, 0xd0, 0xc6, 0xe3, 0xce, 0xfb, 0xde, 0xcc, 0x7b, + 0x0b, 0xc7, 0xc8, 0x4c, 0x5c, 0x3f, 0x2f, 0x6b, 0xa6, 0x48, 0x66, 0xb8, 0x7b, 0xda, 0x2b, 0x48, + 0xef, 0x29, 0xde, 0x61, 0x51, 0x22, 0x9b, 0x29, 0xa4, 0x8c, 0xeb, 0x8a, 0xbc, 0xab, 0xca, 0x79, + 0x72, 0x96, 0x2c, 0xfa, 0x66, 0x06, 0x93, 0x8d, 0x8a, 0x2e, 0x44, 0x62, 0x14, 0xe1, 0x48, 0x04, + 0x7b, 0x0e, 0xe3, 0x07, 0x65, 0x1b, 0xfb, 0x35, 0x7d, 0xfa, 0xf2, 0x1f, 0xb7, 0x7d, 0x82, 0xf1, + 0x2d, 0x6e, 0x1b, 0xe2, 0xc6, 0xb7, 0xb0, 0xc9, 0xa0, 0xf7, 0x8e, 0x5b, 0x95, 0x47, 0x7f, 0x1d, + 0xba, 0x56, 0x46, 0x21, 0x16, 0x1c, 0x9d, 0x50, 0x3d, 0xa5, 0x26, 0x30, 0x44, 0x5f, 0xea, 0xa0, + 0x2f, 0x03, 0x3b, 0x02, 0x78, 0x8c, 0xc5, 0x06, 0x57, 0x35, 0xbd, 0xbc, 0xd9, 0xaf, 0x04, 0x06, + 0x2b, 0x69, 0x23, 0xe0, 0x07, 0x86, 0x50, 0xac, 0x51, 0xf7, 0xa7, 0xe6, 0x02, 0xc0, 0x53, 0x74, + 0x6d, 0x01, 0x3d, 0x90, 0xe5, 0x66, 0xf9, 0xf3, 0x13, 0x87, 0xde, 0x97, 0x70, 0xb2, 0xcb, 0x21, + 0xf8, 0xab, 0xb4, 0xd1, 0xdb, 0x59, 0x3e, 0xdb, 0xd3, 0x9d, 0xb2, 0x39, 0x4c, 0x9b, 0x40, 0xca, + 0x57, 0xde, 0xb5, 0x6e, 0x8d, 0xf7, 0xdb, 0xd3, 0xe9, 0xbe, 0x80, 0x2c, 0x48, 0x6e, 0x87, 0x12, + 0x7c, 0x3e, 0x50, 0xfa, 0x74, 0x4f, 0x1f, 0x3a, 0x7d, 0x07, 0x00, 0x00, 0xff, 0xff, 0x19, 0x25, + 0x10, 0x74, 0xae, 0x01, 0x00, 0x00, } diff --git a/cmd/vendor/github.com/pingcap/kvproto/pkg/kvrpcpb/kvrpcpb.pb.go b/cmd/vendor/github.com/pingcap/kvproto/pkg/kvrpcpb/kvrpcpb.pb.go index 44fa801e917..fe3bdda6b10 100644 --- a/cmd/vendor/github.com/pingcap/kvproto/pkg/kvrpcpb/kvrpcpb.pb.go +++ b/cmd/vendor/github.com/pingcap/kvproto/pkg/kvrpcpb/kvrpcpb.pb.go @@ -212,7 +212,6 @@ func (m *KeyError) GetAbort() string { type Context struct { RegionId *uint64 `protobuf:"varint,1,opt,name=region_id" json:"region_id,omitempty"` RegionEpoch *metapb.RegionEpoch `protobuf:"bytes,2,opt,name=region_epoch" json:"region_epoch,omitempty"` - Peer *metapb.Peer `protobuf:"bytes,3,opt,name=peer" json:"peer,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -235,13 +234,6 @@ func (m *Context) GetRegionEpoch() *metapb.RegionEpoch { return nil } -func (m *Context) GetPeer() *metapb.Peer { - if m != nil { - return m.Peer - } - return nil -} - type CmdGetRequest struct { Key []byte `protobuf:"bytes,1,opt,name=key" json:"key,omitempty"` Version *uint64 `protobuf:"varint,2,opt,name=version" json:"version,omitempty"` @@ -924,65 +916,64 @@ func init() { } var fileDescriptor0 = []byte{ - // 957 bytes of a gzipped FileDescriptorProto + // 944 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x56, 0x5d, 0x8f, 0xdb, 0x54, - 0x10, 0x55, 0x62, 0x27, 0x4e, 0xc6, 0x4e, 0xd6, 0xeb, 0x2d, 0xdd, 0x34, 0x20, 0x94, 0x9a, 0x3e, - 0x40, 0x51, 0x83, 0x9a, 0xaa, 0xb4, 0x42, 0x55, 0x11, 0x84, 0x82, 0xd0, 0x52, 0x1a, 0x2d, 0x7d, - 0x8f, 0x1c, 0xef, 0x25, 0x6b, 0xc5, 0x89, 0xdd, 0xeb, 0x9b, 0x40, 0x7e, 0x06, 0x0f, 0xfc, 0x5c, - 0x24, 0xc6, 0xf7, 0xc3, 0x9f, 0xd9, 0x55, 0xba, 0x6f, 0xf1, 0xf5, 0x9c, 0x39, 0x67, 0x66, 0xce, - 0x9d, 0x18, 0x7a, 0xab, 0x1d, 0x8d, 0xfd, 0x78, 0x31, 0x8e, 0x69, 0xc4, 0x22, 0xc7, 0x90, 0x8f, - 0x43, 0x6b, 0x4d, 0x98, 0xa7, 0x8e, 0x87, 0x3d, 0x42, 0x69, 0x44, 0xd5, 0xa3, 0x3b, 0x85, 0xce, - 0x6f, 0x91, 0xbf, 0xfa, 0x75, 0xf3, 0x67, 0xe4, 0xdc, 0x03, 0x2b, 0xa6, 0xc1, 0xda, 0xa3, 0xfb, - 0x79, 0x88, 0x67, 0x83, 0xc6, 0xa8, 0xf1, 0xa5, 0x95, 0x9e, 0xa6, 0x4f, 0xf3, 0x1d, 0xa1, 0x49, - 0x10, 0x6d, 0x06, 0x4d, 0x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25, 0x4c, 0xf9, 0xd2, 0x7d, 0x27, 0x78, 0xe8, 0x22, 0xab, - 0xbe, 0xc3, 0x31, 0x6e, 0x11, 0x73, 0xc3, 0xfd, 0x78, 0x05, 0x4e, 0x41, 0xa3, 0xc2, 0x77, 0x39, - 0x7e, 0x54, 0xd7, 0x59, 0x41, 0xe3, 0xee, 0x48, 0xd1, 0x8b, 0x74, 0xfe, 0x19, 0x18, 0xea, 0x9d, - 0xa9, 0xb8, 0xca, 0xfd, 0x47, 0x87, 0x4e, 0x66, 0x96, 0x63, 0x0c, 0xf0, 0x28, 0xff, 0x4b, 0xe5, - 0xa6, 0x16, 0x2e, 0xe8, 0x8f, 0xd5, 0xc7, 0x82, 0x70, 0xb4, 0x1c, 0xab, 0x10, 0x92, 0xc4, 0xd2, - 0x04, 0xe7, 0x35, 0x13, 0x48, 0xe2, 0x6f, 0xa0, 0x57, 0x70, 0x01, 0xc6, 0x0b, 0x1b, 0x0c, 0xea, - 0x36, 0x90, 0x80, 0x17, 0xa2, 0xdc, 0x82, 0x0f, 0x10, 0x24, 0x8c, 0xf0, 0xd9, 0x61, 0x23, 0x48, - 0xa0, 0x1a, 0xab, 0x72, 0x02, 0xc2, 0xda, 0x07, 0xc6, 0x5a, 0xde, 0xc1, 0xd2, 0x75, 0xb9, 0x17, - 0x10, 0x65, 0xd4, 0x7b, 0x5b, 0x5d, 0xa4, 0xaf, 0x04, 0x57, 0xe6, 0x06, 0x44, 0x09, 0x3b, 0x7c, - 0x71, 0xab, 0x1d, 0x24, 0xfa, 0x35, 0x9c, 0xd5, 0xfc, 0x80, 0x19, 0x84, 0x21, 0x1e, 0xde, 0x62, - 0x08, 0x89, 0x7f, 0x29, 0xfc, 0x54, 0x74, 0x04, 0xc2, 0xa1, 0xde, 0xa3, 0xea, 0xce, 0x78, 0xfc, - 0x6f, 0x03, 0xcc, 0xe2, 0xc8, 0x01, 0xda, 0x62, 0x5e, 0x76, 0x03, 0x17, 0xa7, 0x21, 0x67, 0x61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2, + 0x45, 0x46, 0x8c, 0x98, 0xc0, 0xdf, 0xf8, 0x8c, 0x63, 0xba, 0x79, 0x1d, 0x1a, 0xd7, 0xf1, 0x33, + 0x34, 0xcf, 0xf7, 0x17, 0xae, 0x4f, 0x4f, 0xe0, 0x97, 0x15, 0xd5, 0x55, 0x62, 0x21, 0x46, 0x0c, + 0xe6, 0x29, 0xf4, 0x53, 0x31, 0xb2, 0xa0, 0xcf, 0xa1, 0x11, 0x61, 0xe2, 0x18, 0x13, 0x6a, 0x98, + 0xb0, 0x9f, 0x25, 0xe4, 0x84, 0xce, 0xf7, 0xd0, 0x7a, 0xb7, 0x63, 0x2e, 0x43, 0x31, 0xf6, 0x10, + 0xea, 0x61, 0xc4, 0x99, 0x7b, 0x33, 0x33, 0x0d, 0x7c, 0x1f, 0xdd, 0xca, 0xb9, 0x02, 0x1b, 0x39, + 0x2f, 0x28, 0xf9, 0x93, 0xfa, 0x8c, 0xa8, 0x26, 0x3c, 0x82, 0xf6, 0x46, 0xa6, 0x55, 0xd4, 0x59, + 0x2d, 0x29, 0x61, 0xd9, 0x81, 0x82, 0xe0, 0x13, 0xe8, 0x8a, 0x06, 0x16, 0x9b, 0xf4, 0x12, 0x06, + 0x05, 0x22, 0x59, 0x20, 0x1a, 0x90, 0x77, 0xac, 0x4a, 0xa3, 0x5a, 0x86, 0x7e, 0xb5, 0x10, 0x39, + 0x0f, 0x37, 0x38, 0x02, 0x25, 0xb0, 0x42, 0x22, 0xbc, 0xd6, 0x01, 0x1d, 0x2b, 0x8d, 0x51, 0x89, + 0x86, 0x4a, 0xee, 0x43, 0xcf, 0xe3, 0xa8, 0x92, 0x94, 0x6f, 0xe1, 0x2c, 0x97, 0xf0, 0x74, 0x21, + 0x2f, 0x04, 0x2e, 0x20, 0xee, 0x76, 0x17, 0x1d, 0xb5, 0x68, 0x45, 0x96, 0x30, 0xea, 0x6f, 0xbc, + 0xc9, 0x29, 0xf0, 0x64, 0xb3, 0x56, 0x0b, 0x10, 0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 0xc8, 0x01, 0x9a, 0x62, 0x5e, 0x56, 0x0d, 0x17, 0xa7, + 0x21, 0x67, 0x61, 0xd5, 0x71, 0x09, 0x99, 0xb9, 0x1e, 0x5b, 0x1a, 0x2e, 0xb2, 0x76, 0xaa, 0xc7, + 0xd2, 0xed, 0x1e, 0x40, 0xd6, 0x16, 0xab, 0x81, 0x2b, 0xd5, 0xae, 0x16, 0x6c, 0x35, 0x71, 0x01, + 0x5b, 0xe5, 0x32, 0x2c, 0x43, 0x66, 0x57, 0xea, 0xac, 0xd6, 0xe3, 0x09, 0xd4, 0xf1, 0xab, 0xc1, + 0x00, 0xed, 0x62, 0x97, 0x48, 0xc1, 0x1f, 0x3f, 0x91, 0x00, 0x65, 0xb4, 0x40, 0x4f, 0xbe, 0x0a, + 0x2d, 0xed, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x78, 0x7a, 0x43, 0xbd, 0x0a, 0x00, 0x00, } diff --git a/cmd/vendor/github.com/pingcap/kvproto/pkg/metapb/metapb.pb.go b/cmd/vendor/github.com/pingcap/kvproto/pkg/metapb/metapb.pb.go index c1bce69f35e..a69182d9724 100644 --- a/cmd/vendor/github.com/pingcap/kvproto/pkg/metapb/metapb.pb.go +++ b/cmd/vendor/github.com/pingcap/kvproto/pkg/metapb/metapb.pb.go @@ -12,7 +12,6 @@ It has these top-level messages: Cluster Store RegionEpoch - Peer Region */ package metapb @@ -109,45 +108,20 @@ func (m *RegionEpoch) GetVersion() uint64 { return 0 } -type Peer struct { - Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - StoreId *uint64 `protobuf:"varint,2,opt,name=store_id" json:"store_id,omitempty"` - XXX_unrecognized []byte `json:"-"` -} - -func (m *Peer) Reset() { *m = Peer{} } -func (m *Peer) String() string { return proto.CompactTextString(m) } -func (*Peer) ProtoMessage() {} -func (*Peer) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } - -func (m *Peer) GetId() uint64 { - if m != nil && m.Id != nil { - return *m.Id - } - return 0 -} - -func (m *Peer) GetStoreId() uint64 { - if m != nil && m.StoreId != nil { - return *m.StoreId - } - return 0 -} - type Region struct { Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` // Region key range [start_key, end_key). StartKey []byte `protobuf:"bytes,2,opt,name=start_key" json:"start_key,omitempty"` EndKey []byte `protobuf:"bytes,3,opt,name=end_key" json:"end_key,omitempty"` RegionEpoch *RegionEpoch `protobuf:"bytes,4,opt,name=region_epoch" json:"region_epoch,omitempty"` - Peers []*Peer `protobuf:"bytes,5,rep,name=peers" json:"peers,omitempty"` + StoreIds []uint64 `protobuf:"varint,5,rep,name=store_ids" json:"store_ids,omitempty"` XXX_unrecognized []byte `json:"-"` } func (m *Region) Reset() { *m = Region{} } func (m *Region) String() string { return proto.CompactTextString(m) } func (*Region) ProtoMessage() {} -func (*Region) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{4} } +func (*Region) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} } func (m *Region) GetId() uint64 { if m != nil && m.Id != nil { @@ -177,9 +151,9 @@ func (m *Region) GetRegionEpoch() *RegionEpoch { return nil } -func (m *Region) GetPeers() []*Peer { +func (m *Region) GetStoreIds() []uint64 { if m != nil { - return m.Peers + return m.StoreIds } return nil } @@ -188,25 +162,23 @@ func init() { proto.RegisterType((*Cluster)(nil), "metapb.Cluster") proto.RegisterType((*Store)(nil), "metapb.Store") proto.RegisterType((*RegionEpoch)(nil), "metapb.RegionEpoch") - proto.RegisterType((*Peer)(nil), "metapb.Peer") proto.RegisterType((*Region)(nil), "metapb.Region") } var fileDescriptor0 = []byte{ - // 234 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x5c, 0x90, 0xc1, 0x4e, 0xc3, 0x30, - 0x10, 0x44, 0x95, 0x36, 0x69, 0xe9, 0xd6, 0xa8, 0x60, 0x0e, 0x58, 0xe2,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x3f, 0x1e, 0x55, 0xb3, 0x9e, 0x32, 0x23, 0x7e, 0x98, 0x5c, 0xf0, 0x2b, 0x00, 0x00, - 0xff, 0xff, 0xe0, 0xfe, 0x89, 0x51, 0x47, 0x01, 0x00, 0x00, + // 214 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x54, 0x8f, 0x41, 0x4e, 0xc3, 0x30, + 0x10, 0x45, 0xd5, 0xd6, 0x6d, 0xe9, 0x34, 0xa8, 0x60, 0x16, 0x78, 0x19, 0x59, 0x2c, 0xc2, 0x26, + 0x42, 0x5c, 0x01, 0x71, 0x01, 0x38, 0x80, 0xe5, 0xc4, 0x03, 0x44, 0x10, 0xdb, 0x1a, 0x3b, 0x11, + 0xdc, 0x1e, 0xc7, 0x41, 0xa8, 0x59, 0xce, 0xf7, 0x7b, 0xdf, 0x33, 0x50, 0xf4, 0x18, 0xb5, 0x6f, + 0x6a, 0x4f, 0x2e, 0x3a, 0xbe, 0x9b, 0x27, 0x59, 0xc3, 0xfe, 0xe9, 0x6b, 0x08, 0x11, 0x89, 0x03, + 0xac, 0x3b, 0x23, 0x56, 0xe5, 0xaa, 0x62, 0xfc, 0x16, 0x4e, 0xbd, 0xfe, 0x56, 0x1e, 0x91, 0x94, + 0x1d, 0xfa, 0x06, 0x49, 0xac, 0xd3, 0xc3, 0xa5, 0xbc, 0x83, 0xed, 0x6b, 0x74, 0x84, 0x0b, 0xfa, + 0x04, 0x7b, 0x6d, 0x0c, 0x61, 0x08, 0x99, 0x3a, 0xc8, 0x07, 0x38, 0xbe, 0xe0, 0x7b, 0xe7, 0xec, + 0xb3, 0x77, 0xed, 0x07, 0xbf, 0x82, 0x8b, 0xd6, 0xd9, 0x37, 0x35, 0xa6, 0x9a, 0x7f, 0x23, 0x0d, + 0x21, 0x11, 0xd9, 0x60, 0x72, 0x84, 0xdd, 0x6c, 0x2c, 0x8a, 0xaf, 0xe1, 0x10, 0xa2, 0xa6, 0xa8, + 0x3e, 0xf1, 0x27, 0x83, 0xc5, 0x64, 0xa2, 0x35, 0x39, 0xd8, 0xe4, 0xe0, 0x1e, 0x0a, 0xca, 0xa6, + 0xc2, 0xe9, 0x33, 0xc1, 0x52, 0x7a, 0x7c, 0xbc, 0xa9, 0xff, 0xce, 0x3d, 0xdf, 0x23, 0xd7, 0xa5, + 0xe5, 0x55, 0x67, 0x82, 0xd8, 0x96, 0x9b, 0x8a, 0xfd, 0x06, 0x00, 0x00, 0xff, 0xff, 0x93, 0xf1, + 0xe9, 0x30, 0x16, 0x01, 0x00, 0x00, } diff --git a/cmd/vendor/github.com/pingcap/kvproto/pkg/pd_jobpb/pd_jobpb.pb.go b/cmd/vendor/github.com/pingcap/kvproto/pkg/pd_jobpb/pd_jobpb.pb.go index 1fe47b6249a..ff2132532bb 100644 --- a/cmd/vendor/github.com/pingcap/kvproto/pkg/pd_jobpb/pd_jobpb.pb.go +++ b/cmd/vendor/github.com/pingcap/kvproto/pkg/pd_jobpb/pd_jobpb.pb.go @@ -75,10 +75,12 @@ func (JobStatus) EnumDescriptor() ([]byte, []int) { return fileDescriptor0, []in // For each conf change, split operation, we will add this into job queue, // and in another thread, it will get first job, handle it, and then pop in cycle. type Job struct { - Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` - Status *JobStatus `protobuf:"varint,2,opt,name=status,enum=pd_jobpd.JobStatus" json:"status,omitempty"` - Region *metapb.Region `protobuf:"bytes,3,opt,name=region" json:"region,omitempty"` - Request *raft_cmdpb.RaftCmdRequest `protobuf:"bytes,4,opt,name=request" json:"request,omitempty"` + Id *uint64 `protobuf:"varint,1,opt,name=id" json:"id,omitempty"` + Status *JobStatus `protobuf:"varint,2,opt,name=status,enum=pd_jobpd.JobStatus" json:"status,omitempty"` + Region *metapb.Region `protobuf:"bytes,3,opt,name=region" json:"region,omitempty"` + // See comment in AskChangePeerRequest. + LeaderStoreId *uint64 `protobuf:"varint,4,opt,name=leader_store_id" json:"leader_store_id,omitempty"` + Request *raft_cmdpb.RaftCmdRequest `protobuf:"bytes,5,opt,name=request" json:"request,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -108,6 +110,13 @@ func (m *Job) GetRegion() *metapb.Region { return nil } +func (m *Job) GetLeaderStoreId() uint64 { + if m != nil && m.LeaderStoreId != nil { + return *m.LeaderStoreId + } + return 0 +} + func (m *Job) GetRequest() *raft_cmdpb.RaftCmdRequest { if m != nil { return m.Request @@ -121,19 +130,20 @@ func init() { } var fileDescriptor0 = []byte{ - // 211 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x4c, 0xce, 0x41, 0x4b, 0x86, 0x30, - 0x1c, 0x06, 0xf0, 0xa6, 0x2f, 0x6a, 0x7f, 0x45, 0x64, 0x5d, 0x86, 0x87, 0x88, 0xba, 0x44, 0xc1, - 0x0e, 0x7e, 0x83, 0x10, 0x3a, 0x74, 0x8a, 0xf5, 0x01, 0x64, 0xba, 0x65, 0x8b, 0xdc, 0x6c, 0x9b, - 0x9f, 0xa0, 0x2f, 0xde, 0x34, 0xa5, 0xf7, 0xb6, 0xdf, 0x9e, 0x87, 0x87, 0x3f, 0x94, 0xb3, 0xe8, - 0x3e, 0x4d, 0x3f, 0xf7, 0x74, 0xb6, 0xc6, 0x1b, 0x9c, 0xed, 0x16, 0x75, 0x65, 0xf9, 0xbb, 0xef, - 0x86, 0x49, 0x1c, 0x59, 0x5d, 0x4c, 0xd2, 0xf3, 0x43, 0xb7, 0x3f, 0x08, 0xe2, 0x17, 0xd3, 0x63, - 0x80, 0x48, 0x09, 0x82, 0x6e, 0xd0, 0xfd, 0x09, 0xdf, 0x41, 0xe2, 0x3c, 0xf7, 0x8b, 0x23, 0x51, - 0x70, 0xd9, 0x5c, 0xd1, 0x63, 0x8e, 0x86, 0xea, 0xdb, 0x16, 0xe1, 0x6b, 0x48, 0xac, 0x1c, 0x95, - 0xd1, 0x24, 0x0e, 0xa5, 0xbc, 0x29, 0xe9, 0xbe, 0xcb, 0xb6, 0x5f, 0xfc, 0x08, 0xa9, 0x95, 0xdf, - 0x8b, 0x74, 0x9e, 0x9c, 0xb6, 0x42, 0x4d, 0xcf, 0x4e, 0x61, 0xe1, 0xd9, 0x4e, 0x82, 0xfd, 0x35, - 0x1e, 0x9e, 0xe0, 0xf2, 0x7f, 0x39, 0x87, 0xf4, 0x55, 0x6a, 0xa1, 0xf4, 0x58, 0x5d, 0xac, 0x60, - 0x8b, 0xd6, 0x2b, 0x10, 0x2e, 0x20, 0x7b, 0x56, 0x5a, 0xb9, 0x0f, 0x29, 0xaa, 0x68, 0x55, 0xcb, - 0xf5, 0x20, 0xbf, 0x82, 0xe2, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3f, 0xe9, 0xfa, 0x7c, 0x03, - 0x01, 0x00, 0x00, + // 229 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x4c, 0x8e, 0x41, 0x4e, 0xc3, 0x30, + 0x10, 0x45, 0x49, 0x52, 0xda, 0x32, 0xad, 0x42, 0x64, 0x16, 0x44, 0x59, 0x20, 0x04, 0x1b, 0x04, + 0x92, 0x17, 0xbd, 0x01, 0xaa, 0xc4, 0x82, 0x15, 0x32, 0x07, 0xb0, 0x9c, 0xce, 0x50, 0x8c, 0x1a, + 0x3b, 0xd8, 0xce, 0x6d, 0x38, 0x2c, 0x8e, 0x69, 0x44, 0x77, 0x7e, 0xfe, 0x7f, 0xde, 0x0c, 0x94, + 0x3d, 0xca, 0x2f, 0xdb, 0xf6, 0x2d, 0xef, 0x9d, 0x0d, 0x96, 0x2d, 0x8f, 0x8c, 0x4d, 0xe5, 0xd4, + 0x47, 0x90, 0xbb, 0x0e, 0xa7, 0xac, 0x59, 0x77, 0x14, 0xd4, 0x44, 0x77, 0x3f, 0x19, 0x14, 0xaf, + 0xb6, 0x65, 0x00, 0xb9, 0xc6, 0x3a, 0xbb, 0xcd, 0x1e, 0x66, 0xec, 0x1e, 0xe6, 0x3e, 0xa8, 0x30, + 0xf8, 0x3a, 0x8f, 0x5c, 0x6e, 0xae, 0xf8, 0xa4, 0xe3, 0xb1, 0xfa, 0x9e, 0x22, 0x76, 0x03, 0x73, + 0x47, 0x7b, 0x6d, 0x4d, 0x5d, 0xc4, 0xd2, 0x6a, 0x53, 0xf2, 0xa3, 0x57, 0xa4, 0x5f, 0x76, 0x0d, + 0x97, 0x07, 0x52, 0x48, 0x4e, 0xfa, 0x60, 0x1d, 0xc9, 0x68, 0x9f, 0x25, 0xfb, 0x13, 0x2c, 0x1c, + 0x7d, 0x0f, 0xe4, 0x43, 0x7d, 0x9e, 0x26, 0x1b, 0x7e, 0x72, 0xa3, 0x88, 0xcf, 0x6d, 0x87, 0xe2, + 0xaf, 0xf1, 0xf8, 0x0c, 0x17, 0xff, 0x2b, 0x57, 0xb0, 0x78, 0x23, 0x83, 0xda, 0xec, 0xab, 0xb3, + 0x11, 0xc4, 0x60, 0xcc, 0x08, 0x19, 0x5b, 0xc3, 0xf2, 0x45, 0x1b, 0xed, 0x3f, 0x09, 0xab, 0x7c, + 0xa4, 0xad, 0x32, 0x3b, 0x3a, 0x44, 0x2a, 0x7e, 0x03, 0x00, 0x00, 0xff, 0xff, 0xb9, 0xbb, 0x3d, + 0xe1, 0x1c, 0x01, 0x00, 0x00, } diff --git a/cmd/vendor/github.com/pingcap/kvproto/pkg/pdpb/pdpb.pb.go b/cmd/vendor/github.com/pingcap/kvproto/pkg/pdpb/pdpb.pb.go index 89315f85845..21c0571fb8d 100644 --- a/cmd/vendor/github.com/pingcap/kvproto/pkg/pdpb/pdpb.pb.go +++ b/cmd/vendor/github.com/pingcap/kvproto/pkg/pdpb/pdpb.pb.go @@ -455,13 +455,13 @@ func (m *PutMetaResponse) GetMetaType() MetaType { type AskChangePeerRequest struct { Region *metapb.Region `protobuf:"bytes,1,opt,name=region" json:"region,omitempty"` - // The current leader peer of the region. - // Pd can first try to send command to this peer, + // The current leader store id of the region. + // Pd can first try to send command to this store, // if the peer is not leader now, pd will try to // find the new leader of the region and then send // command again. - Leader *metapb.Peer `protobuf:"bytes,2,opt,name=leader" json:"leader,omitempty"` - XXX_unrecognized []byte `json:"-"` + LeaderStoreId *uint64 `protobuf:"varint,2,opt,name=leader_store_id" json:"leader_store_id,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *AskChangePeerRequest) Reset() { *m = AskChangePeerRequest{} } @@ -476,11 +476,11 @@ func (m *AskChangePeerRequest) GetRegion() *metapb.Region { return nil } -func (m *AskChangePeerRequest) GetLeader() *metapb.Peer { - if m != nil { - return m.Leader +func (m *AskChangePeerRequest) GetLeaderStoreId() uint64 { + if m != nil && m.LeaderStoreId != nil { + return *m.LeaderStoreId } - return nil + return 0 } type AskChangePeerResponse struct { @@ -495,7 +495,7 @@ func (*AskChangePeerResponse) Descriptor() ([]byte, []int) { return fileDescript type AskSplitRequest struct { Region *metapb.Region `protobuf:"bytes,1,opt,name=region" json:"region,omitempty"` SplitKey []byte `protobuf:"bytes,2,opt,name=split_key" json:"split_key,omitempty"` - Leader *metapb.Peer `protobuf:"bytes,3,opt,name=leader" json:"leader,omitempty"` + LeaderStoreId *uint64 `protobuf:"varint,3,opt,name=leader_store_id" json:"leader_store_id,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -518,11 +518,11 @@ func (m *AskSplitRequest) GetSplitKey() []byte { return nil } -func (m *AskSplitRequest) GetLeader() *metapb.Peer { - if m != nil { - return m.Leader +func (m *AskSplitRequest) GetLeaderStoreId() uint64 { + if m != nil && m.LeaderStoreId != nil { + return *m.LeaderStoreId } - return nil + return 0 } type AskSplitResponse struct { @@ -836,62 +836,61 @@ func init() { } var fileDescriptor0 = []byte{ - // 898 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0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64, 0x21, 0x58, 0x05, 0x97, 0x59, 0x02, 0xee, - 0x85, 0xd9, 0xa1, 0x60, 0x3e, 0x6d, 0xfe, 0x2f, 0x0b, 0x1f, 0x17, 0x55, 0x48, 0xaa, 0x56, 0x27, - 0xbd, 0x85, 0x6e, 0x9e, 0xf4, 0x60, 0x2a, 0x9c, 0x29, 0xf4, 0xef, 0xe8, 0xea, 0xfe, 0xd5, 0x5d, - 0x2f, 0xc9, 0x13, 0x21, 0x49, 0x56, 0xf0, 0x96, 0x84, 0x5a, 0x25, 0x09, 0x23, 0x68, 0x06, 0x78, - 0xe1, 0x64, 0xb9, 0xed, 0x6c, 0x9f, 0x07, 0xe1, 0x0d, 0x58, 0x8a, 0x2a, 0x3b, 0x73, 0xce, 0xda, - 0x87, 0xae, 0x5e, 0xe2, 0xc0, 0x4f, 0x0f, 0xcd, 0xd4, 0x03, 0x9d, 0x72, 0x3c, 0xb6, 0x82, 0x82, - 0xad, 0xb0, 0x4d, 0xae, 0x56, 0x24, 0xb7, 0xc1, 0xda, 0xe6, 0x90, 0x79, 0xbf, 0x85, 0x8e, 0xcc, - 0xf7, 0x73, 0x3e, 0x26, 0x36, 0x1b, 0xd9, 0xb6, 0xe5, 0xde, 0xc2, 0x1e, 0x74, 0x7e, 0x03, 0x33, - 0x73, 0x3f, 0xd4, 0xc7, 0x3e, 0x81, 0x06, 0x49, 0x92, 0x28, 0xab, 0xcb, 0x10, 0x64, 0xff, 0xc4, - 0x4d, 0xce, 0x3f, 0x2a, 0xb4, 0xb2, 0x33, 0xb3, 0x71, 0xf5, 0x2a, 0x0e, 0x20, 0xce, 0xfc, 0x59, - 0x00, 0x77, 0x4b, 0xbc, 0x04, 0x6d, 0x11, 0x7a, 0x42, 0x3c, 0x05, 0xc5, 0xeb, 0x09, 0xd8, 0x7d, - 0x14, 0x86, 0xee, 0xda, 0xc3, 0xae, 0x39, 0x03, 0x35, 0xa5, 0x91, 0xcc, 0x67, 0xc9, 0x79, 0xb3, - 0x1d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, 0x1a, 0xb2, 0x33, 0x8b, 0x8b, 0xf7, 0x00, 0x0d, 0xfc, 0xe0, - 0x4f, 0x38, 0x7b, 0x88, 0xa9, 0xbb, 0x24, 0xf2, 0xef, 0xe0, 0x9b, 0xd2, 0xa3, 0xa7, 0x54, 0x12, - 0x9e, 0x05, 0xba, 0xf9, 0xbb, 0x06, 0x46, 0x51, 0x4c, 0x03, 0x5a, 0x8f, 0xeb, 0x3f, 0xdd, 0xc0, - 0xf7, 0xac, 0x4f, 0x76, 0x0b, 0x54, 0x26, 0xa4, 0x55, 0xb3, 0x3b, 0xa0, 0xe7, 0xae, 0x96, 0xc2, - 0xc6, 0x84, 0xb9, 0x2b, 0x84, 0xa5, 0x72, 0x47, 0x49, 0xb6, 0x55, 0xe7, 0x0b, 0x49, 0xa8, 0xd5, - 0xe0, 0x0b, 0x49, 0x9a, 0xd5, 0x64, 0x7f, 0x28, 0xf0, 0x23, 0x09, 0x48, 0x4a, 0x70, 0xdd, 0x62, - 0x93, 0xb0, 0xb3, 0xc3, 0x90, 0xa5, 0xb1, 0x91, 0xa4, 0x65, 0x24, 0x58, 0xfa, 0xcd, 0xef, 0xa0, - 0xe5, 0xcf, 0x49, 0x17, 0x0c, 0x59, 0x1c, 0x7a, 0x7f, 0xe2, 0x75, 0xe1, 0x53, 0xc2, 0x77, 0x59, - 0x99, 0x2c, 0xb8, 0x18, 0xb0, 0xb8, 0x56, 0x78, 0x24, 0x1e, 0x13, 0x57, 0xfc, 0x6f, 0xc7, 0x90, - 0xef, 0x0a, 0x1a, 0xea, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xa5, 0xdb, 0x1d, 0xf6, 0x81, 0x09, - 0x00, 0x00, + // 896 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x56, 0xdd, 0x6e, 0xab, 0x46, + 0x10, 0x3e, 0x06, 0xff, 0xc0, 0x60, 0x03,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, 0xf5, 0x17, 0x44, 0xfe, 0x13, 0x7c, 0x55, 0x7b, 0xea, 0x94, 0x46, 0xc2, 0x8b, 0x40, + 0x17, 0x7f, 0xb7, 0xc0, 0xa8, 0x8a, 0x69, 0x40, 0xef, 0x76, 0xf5, 0xa7, 0x1f, 0x85, 0x81, 0xfd, + 0xce, 0xe9, 0x81, 0xca, 0x84, 0xb4, 0x5b, 0xce, 0x00, 0xf4, 0xd2, 0xd5, 0x56, 0xd8, 0x98, 0x30, + 0xb7, 0x85, 0xb0, 0x55, 0xee, 0x28, 0xc9, 0xb6, 0xdb, 0x7c, 0x21, 0x09, 0xb5, 0x3b, 0x7c, 0x21, + 0x49, 0xb3, 0xbb, 0xec, 0xbf, 0x04, 0xbe, 0x27, 0x11, 0xc9, 0x09, 0xae, 0x7b, 0x6c, 0x08, 0x0e, + 0xb6, 0x18, 0xb2, 0x35, 0x36, 0x92, 0xb4, 0x82, 0x04, 0x5b, 0xbf, 0xf8, 0x0d, 0xb4, 0xf2, 0x11, + 0xb1, 0xc0, 0x90, 0xc5, 0xa1, 0xf7, 0x3b, 0x5e, 0x17, 0x3e, 0x20, 0x7c, 0x97, 0x95, 0xc9, 0x82, + 0x8b, 0xd9, 0x8a, 0x6b, 0x85, 0x47, 0xe2, 0x31, 0x71, 0xc5, 0xff, 0x71, 0x0c, 0xf9, 0x9a, 0xa0, + 0xa1, 0xfd, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, 0x44, 0xea, 0xa7, 0x77, 0x09, 0x00, 0x00, } diff --git a/cmd/vendor/github.com/pingcap/kvproto/pkg/raft_cmdpb/raft_cmdpb.pb.go b/cmd/vendor/github.com/pingcap/kvproto/pkg/raft_cmdpb/raft_cmdpb.pb.go index de12a07d840..0103b1505ae 100644 --- a/cmd/vendor/github.com/pingcap/kvproto/pkg/raft_cmdpb/raft_cmdpb.pb.go +++ b/cmd/vendor/github.com/pingcap/kvproto/pkg/raft_cmdpb/raft_cmdpb.pb.go @@ -464,7 +464,7 @@ func (m *Response) GetSnap() *SnapResponse { type ChangePeerRequest struct { ChangeType *raftpb.ConfChangeType `protobuf:"varint,1,opt,name=change_type,enum=raftpb.ConfChangeType" json:"change_type,omitempty"` - Peer *metapb.Peer `protobuf:"bytes,2,opt,name=peer" json:"peer,omitempty"` + StoreId *uint64 `protobuf:"varint,2,opt,name=store_id" json:"store_id,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -480,11 +480,11 @@ func (m *ChangePeerRequest) GetChangeType() raftpb.ConfChangeType { return raftpb.ConfChangeType_AddNode } -func (m *ChangePeerRequest) GetPeer() *metapb.Peer { - if m != nil { - return m.Peer +func (m *ChangePeerRequest) GetStoreId() uint64 { + if m != nil && m.StoreId != nil { + return *m.StoreId } - return nil + return 0 } type ChangePeerResponse struct { @@ -512,10 +512,8 @@ type SplitRequest struct { // We split the region into two, first uses the origin // parent region id, and the second uses the new_region_id. // We must guarantee that the new_region_id is global unique. - NewRegionId *uint64 `protobuf:"varint,2,opt,name=new_region_id" json:"new_region_id,omitempty"` - // The peer ids for the new split region. - NewPeerIds []uint64 `protobuf:"varint,3,rep,name=new_peer_ids" json:"new_peer_ids,omitempty"` - XXX_unrecognized []byte `json:"-"` + NewRegionId *uint64 `protobuf:"varint,2,opt,name=new_region_id" json:"new_region_id,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *SplitRequest) Reset() { *m = SplitRequest{} } @@ -537,13 +535,6 @@ func (m *SplitRequest) GetNewRegionId() uint64 { return 0 } -func (m *SplitRequest) GetNewPeerIds() []uint64 { - if m != nil { - return m.NewPeerIds - } - return nil -} - type SplitResponse struct { Left *metapb.Region `protobuf:"bytes,1,opt,name=left" json:"left,omitempty"` Right *metapb.Region `protobuf:"bytes,2,opt,name=right" json:"right,omitempty"` @@ -688,8 +679,8 @@ func (*RegionLeaderRequest) ProtoMessage() {} func (*RegionLeaderRequest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{20} } type RegionLeaderResponse struct { - Leader *metapb.Peer `protobuf:"bytes,1,opt,name=leader" json:"leader,omitempty"` - XXX_unrecognized []byte `json:"-"` + LeaderStoreId *uint64 `protobuf:"varint,1,opt,name=leader_store_id" json:"leader_store_id,omitempty"` + XXX_unrecognized []byte `json:"-"` } func (m *RegionLeaderResponse) Reset() { *m = RegionLeaderResponse{} } @@ -697,11 +688,11 @@ func (m *RegionLeaderResponse) String() string { return proto.Compact func (*RegionLeaderResponse) ProtoMessage() {} func (*RegionLeaderResponse) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{21} } -func (m *RegionLeaderResponse) GetLeader() *metapb.Peer { - if m != nil { - return m.Leader +func (m *RegionLeaderResponse) GetLeaderStoreId() uint64 { + if m != nil && m.LeaderStoreId != nil { + return *m.LeaderStoreId } - return nil + return 0 } // For getting more information of the region. @@ -724,7 +715,7 @@ func (*RegionDetailRequest) Descriptor() ([]byte, []int) { return fileDescriptor type RegionDetailResponse struct { Region *metapb.Region `protobuf:"bytes,1,opt,name=region" json:"region,omitempty"` - Leader *metapb.Peer `protobuf:"bytes,2,opt,name=leader" json:"leader,omitempty"` + LeaderStoreId *uint64 `protobuf:"varint,2,opt,name=leader_store_id" json:"leader_store_id,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -740,11 +731,11 @@ func (m *RegionDetailResponse) GetRegion() *metapb.Region { return nil } -func (m *RegionDetailResponse) GetLeader() *metapb.Peer { - if m != nil { - return m.Leader +func (m *RegionDetailResponse) GetLeaderStoreId() uint64 { + if m != nil && m.LeaderStoreId != nil { + return *m.LeaderStoreId } - return nil + return 0 } type StoreStatsRequest struct { @@ -885,13 +876,12 @@ func (m *StatusResponse) GetStoreStats() *StoreStatsResponse { } type RaftRequestHeader struct { - RegionId *uint64 `protobuf:"varint,1,opt,name=region_id" json:"region_id,omitempty"` - Peer *metapb.Peer `protobuf:"bytes,2,opt,name=peer" json:"peer,omitempty"` + RegionId *uint64 `protobuf:"varint,1,opt,name=region_id" json:"region_id,omitempty"` // true for read linearization - ReadQuorum *bool `protobuf:"varint,3,opt,name=read_quorum" json:"read_quorum,omitempty"` + ReadQuorum *bool `protobuf:"varint,2,opt,name=read_quorum" json:"read_quorum,omitempty"` // 16 bytes, to distinguish request. - Uuid []byte `protobuf:"bytes,4,opt,name=uuid" json:"uuid,omitempty"` - RegionEpoch *metapb.RegionEpoch `protobuf:"bytes,5,opt,name=region_epoch" json:"region_epoch,omitempty"` + Uuid []byte `protobuf:"bytes,3,opt,name=uuid" json:"uuid,omitempty"` + RegionEpoch *metapb.RegionEpoch `protobuf:"bytes,4,opt,name=region_epoch" json:"region_epoch,omitempty"` XXX_unrecognized []byte `json:"-"` } @@ -907,13 +897,6 @@ func (m *RaftRequestHeader) GetRegionId() uint64 { return 0 } -func (m *RaftRequestHeader) GetPeer() *metapb.Peer { - if m != nil { - return m.Peer - } - return nil -} - func (m *RaftRequestHeader) GetReadQuorum() bool { if m != nil && m.ReadQuorum != nil { return *m.ReadQuorum @@ -1091,75 +1074,74 @@ func init() { } var fileDescriptor0 = []byte{ - // 1111 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x56, 0xdd, 0x8e, 0xdb, 0x44, - 0x14, 0xc6, 0x8d, 0x93, 0xdd, 0x9e, 0xc4, 0xa9, 0xe3, 0x6c, 0xd9, 0x6c, 0xd4, 0x86, 0x95, 0x69, - 0xe9, 0x36, 0x88, 0x20, 0x76, 0x11, 0xbd, 0x46, 0x6d, 0x45, 0x11, 0x2b, 0x54, 0xed, 0x56, 0x70, - 0x83, 0x64, 0x99, 0x78, 0x36, 0x6b, 0x35, 0xb1, 0x5d, 0xff, 0x00, 0xe5, 0x29, 0x78, 0x2e, 0xb8, - 0x40, 0xe2, 0x09, 0xb8, 0xe0, 0x0d, 0xb8, 0xe2, 0x8e, 0x33, 0x33, 0x67, 0xec, 0x71, 0xec, 0xa0, - 0xe5, 0x2a, 0xca, 0x99, 0x33, 0xd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xa9, 0xf9, 0xe9, 0xc3, 0xde, 0x97, 0x11, 0xbe, 0x96, 0xc3, 0xc0, 0x7e, 0xc7, 0xd9, - 0x83, 0x0e, 0x3e, 0xb5, 0x6c, 0xc3, 0xd9, 0x07, 0x93, 0x3f, 0xa6, 0xec, 0x5b, 0x3c, 0x84, 0xef, - 0x25, 0xbb, 0xe3, 0x00, 0xf4, 0xe4, 0x7b, 0xc8, 0x36, 0xc5, 0x32, 0xbe, 0x78, 0xec, 0xee, 0xfc, - 0x2b, 0xfa, 0xec, 0x2a, 0x38, 0x1b, 0x06, 0x04, 0x27, 0xc2, 0x88, 0x39, 0x04, 0xa8, 0x3e, 0x37, - 0x08, 0x7d, 0x1b, 0xba, 0xe2, 0x7b, 0x82, 0xd8, 0x7c, 0xa9, 0xfc, 0x54, 0xd8, 0x9d, 0xf9, 0x37, - 0xea, 0xb6, 0x53, 0x68, 0x23, 0xb0, 0x08, 0x4d, 0xc6, 0x11, 0x0e, 0x0f, 0xd0, 0xc7, 0x19, 0x01, - 0xcb, 0x88, 0x9c, 0x53, 0x89, 0x5b, 0x8d, 0xa0, 0xdd, 0xf9, 0x37, 0x00, 0x00, 0xff, 0xff, 0x65, - 0xae, 0x68, 0x41, 0xf5, 0x0c, 0x00, 0x00, + // 1091 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x94, 0x56, 0x5d, 0x8f, 0xdb, 0x44, + 0x14, 0xc5, 0x8d, 0x93, 0x4d, 0x6f, 0xe2, 0xac, 0xe3, 0x6c, 0xd9, 0xec, 0xaa, 0x0d, 0x2b, 0xd3, + 0xd2, 0x6d, 0x10, 0xa9, 0xd8, 0x45, 0x94, 0x57, 0xd4, 0x56, 0x14, 0xb1, 0x12, 0xd5, 0x2e, 0x82, + 0x47, 0xcb, 0xc4, 0xb3, 0x59, 0xab, 0x89, 0xed, 0xda, 0x63, 0xa0, 0xfc, 0x44, 0x78, 0x40, 0xe2, + 0x17, 0xf0, 0xc0, 0x3f, 0xe0, 0x89, 0x37, 0xe6, 0xe3, 0x8e, 0x3d, 0x8e, 0x27, 0xd2, 0xf2, 0x14, + 0xe5, 0xce, 0x9d, 0x73, 0xe7, 0x9c, 0x7b, 0xee, 0x78, 0xc0, 0xcd, 0xc3, 0x6b, 0x1a, 0x2c, 0x37, + 0x51, 0xf6, 0xe3, 0x22, 0xcb, 0x53, 0x9a, 0x7a, 0x50, 0x47, 0x8e, 0x87, 0x1b, 0x42, 0x43, 0xb5, + 0x72, 0xec, 0x90, 0x3c, 0x4f, 0xf3, 0xea, 0xef, 0x90, 0x27, 0xaa, 0x7f, 0xfe, 0x11, 0xc0, 0x57, + 0x84, 0x5e, 0x92, 0xb7, 0x25, 0x29, 0xa8, 0x37, 0x80, 0xce, 0x1b, 0xf2, 0x6e, 0x6a, 0x9d, 0x58, + 0xa7, 0x43, 0xff, 0x3e, 0x0c, 0xc4, 0x52, 0x91, 0xa5, 0x49, 0x41, 0x3c, 0x07, 0xba, 0x3f, 0x85, + 0xeb, 0x92, 0xe0, 0xea, 0x31, 0x0c, 0xae, 0x08, 0x79, 0x63, 0xdc, 0x39, 0x87, 0xa1, 0x5c, 0xc3, + 0xad, 0xfa, 0x62, 0x8d, 0x73, 0x47, 0xe4, 0x9e, 0x02, 0xbc, 0x2e, 0x8d, 0x07, 0xd8, 0xce, 0x74, + 0x60, 0x20, 0x32, 0x25, 0x28, 0x3b, 0x9e, 0xf3, 0x82, 0xac, 0x09, 0x25, 0xc6, 0x23, 0xb8, 0x30, + 0x52, 0xab, 0x98, 0xcf, 0xb6, 0x5f, 0x25, 0x61, 0x86, 0xd9, 0xfe, 0x82, 0x9d, 0x51, 0xfc, 0xc5, + 0x33, 0xce, 0xa0, 0x97, 0x93, 0x55, 0x9c, 0x26, 0x02, 0x60, 0x70, 0x36, 0x5a, 0xa0, 0x88, 0x97, + 0x22, 0xea, 0xff, 0x63, 0xc1, 0x9e, 0xaa,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0x9f, 0xc7, 0x70, 0xb7, 0xe0, + 0xff, 0x83, 0x7a, 0x56, 0xee, 0x81, 0x93, 0x90, 0x9f, 0x03, 0x09, 0x53, 0xd7, 0xbb, 0x00, 0x07, + 0x77, 0x62, 0xa9, 0xfb, 0x60, 0xaf, 0xc9, 0x35, 0x35, 0x17, 0xf2, 0x1e, 0x40, 0x37, 0x8f, 0x57, + 0x37, 0xaa, 0x79, 0xdb, 0xe7, 0x98, 0x33, 0x45, 0xd2, 0x4d, 0x16, 0x2e, 0xe9, 0x45, 0xba, 0x52, + 0x87, 0x61, 0x95, 0x97, 0x32, 0x18, 0xc4, 0x49, 0x44, 0x7e, 0x11, 0xd0, 0xb6, 0x7f, 0xc0, 0x98, + 0x6a, 0xb9, 0xa8, 0xe9, 0xef, 0x16, 0x0c, 0xbf, 0x8c, 0x36, 0x71, 0xa2, 0x76, 0xcf, 0x5b, 0x9e, + 0x6a, 0x34, 0x44, 0xe4, 0x2a, 0x63, 0x9d, 0x55, 0xda, 0x67, 0x4c, 0x3d, 0x3c, 0xe3, 0x83, 0x86, + 0x05, 0x5b, 0xfd, 0x7a, 0x0c, 0x5d, 0x21, 0x95, 0xd1, 0x67, 0xba, 0xa6, 0x1c, 0x1c, 0x69, 0xac, + 0xd3, 0x15, 0xfa, 0xad, 0x09, 0xbe, 0x4d, 0xdd, 0xff, 0xc3, 0x02, 0x07, 0xd9, 0x54, 0x3e, 0xbc, + 0x3d, 0x9d, 0x73, 0x13, 0x9d, 0xd9, 0x2e, 0x3a, 0x58, 0xe0, 0xb4, 0xc9, 0xe7, 0xc8, 0xc0, 0x07, + 0x33, 0xcf, 0x4d, 0x84, 0x66, 0xbb, 0x08, 0x61, 0x7f, 0xee, 0xc1, 0x44, 0xf6, 0xfa, 0x82, 0x84, + 0x51, 0xa5, 0xa2, 0xff, 0x14, 0x0e, 0x9a, 0x61, 0xac, 0x71, 0x08, 0xfb, 0x6b, 0x11, 0x09, 0x2a, + 0x9f, 0xcb, 0xee,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 0xde, 0xd7, 0x09, 0x7b, 0xe6, 0xc6, 0x91, 0xfb, 0x9e, 0xb7, 0x07, 0x1d, 0xf6, 0x46, 0x72, + 0x2d, 0xaf, 0x0f, 0x36, 0x7f, 0x05, 0xb9, 0x77, 0x78, 0x88, 0x3d, 0x74, 0xdc, 0x8e, 0x07, 0xd0, + 0x93, 0x0f, 0x19, 0xd7, 0x16, 0xcb, 0xec, 0xa9, 0xe2, 0x76, 0xe7, 0xdf, 0xe0, 0xf7, 0x54, 0xc1, + 0xb9, 0x30, 0x44, 0x38, 0x11, 0x66, 0x98, 0x23, 0x80, 0xfa, 0x3b, 0xc2, 0xa0, 0xef, 0x42, 0x57, + 0x7c, 0x28, 0x18, 0x36, 0x5f, 0xaa, 0xbe, 0x01, 0x6e, 0x67, 0xfe, 0xbd, 0xba, 0xd0, 0x14, 0xda, + 0x18, 0x1c, 0x44, 0x93, 0x71, 0x06, 0xc7, 0x0a, 0xe8, 0x13, 0xcb, 0x00, 0xab, 0x88, 0x1c, 0x45, + 0x89, 0x5b, 0x4f, 0x99, 0xdb, 0xf9, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x1d, 0xc3, 0x59, 0xae, + 0x0c, 0x00, 0x00, } diff --git a/cmd/vendor/github.com/pingcap/kvproto/pkg/raft_serverpb/raft_serverpb.pb.go b/cmd/vendor/github.com/pingcap/kvproto/pkg/raft_serverpb/raft_serverpb.pb.go index c6d6a4964fd..57c23b31d31 100644 --- a/cmd/vendor/github.com/pingcap/kvproto/pkg/raft_serverpb/raft_serverpb.pb.go +++ b/cmd/vendor/github.com/pingcap/kvproto/pkg/raft_serverpb/raft_serverpb.pb.go @@ -34,8 +34,8 @@ const _ = proto.ProtoPackageIsVersion1 type RaftMessage struct { RegionId *uint64 `protobuf:"varint,1,opt,name=region_id" json:"region_id,omitempty"` - FromPeer *metapb.Peer `protobuf:"bytes,2,opt,name=from_peer" json:"from_peer,omitempty"` - ToPeer *metapb.Peer `protobuf:"bytes,3,opt,name=to_peer" json:"to_peer,omitempty"` + FromStoreId *uint64 `protobuf:"varint,2,opt,name=from_store_id" json:"from_store_id,omitempty"` + ToStoreId *uint64 `protobuf:"varint,3,opt,name=to_store_id" json:"to_store_id,omitempty"` Message *raftpb.Message `protobuf:"bytes,4,opt,name=message" json:"message,omitempty"` RegionEpoch *metapb.RegionEpoch `protobuf:"bytes,5,opt,name=region_epoch" json:"region_epoch,omitempty"` XXX_unrecognized []byte `json:"-"` @@ -53,18 +53,18 @@ func (m *RaftMessage) GetRegionId() uint64 { return 0 } -func (m *RaftMessage) GetFromPeer() *metapb.Peer { - if m != nil { - return m.FromPeer +func (m *RaftMessage) GetFromStoreId() uint64 { + if m != nil && m.FromStoreId != nil { + return *m.FromStoreId } - return nil + return 0 } -func (m *RaftMessage) GetToPeer() *metapb.Peer { - if m != nil { - return m.ToPeer +func (m *RaftMessage) GetToStoreId() uint64 { + if m != nil && m.ToStoreId != nil { + return *m.ToStoreId } - return nil + return 0 } func (m *RaftMessage) GetMessage() *raftpb.Message { @@ -190,25 +190,24 @@ func init() { } var fileDescriptor0 = []byte{ - // 309 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x6c, 0x91, 0x51, 0x4b, 0xc3, 0x30, - 0x14, 0x85, 0x99, 0xed, 0xdc, 0x76, 0x9b, 0xe9, 0xcc, 0x1e, 0x2c, 0x03, 0x75, 0x14, 0x14, 0x7d, - 0x29, 0xd8, 0xdf, 0xa0, 0x0f, 0x22, 0x82, 0xac, 0x22, 0xf8, 0x54, 0x62, 0x7b, 0xb7, 0x15, 0xd7, - 0xa6, 0x24, 0xe9, 0x70, 0x3f, 0xca, 0xff, 0x68, 0x92, 0xb6, 0x48, 0xc1, 0x97, 0xc2, 0x3d, 0xe7, - 0xdc, 0x73, 0x3f, 0x1a, 0x98, 0x0b, 0xb6, 0x56, 0x89, 0x44, 0xb1, 0x47, 0x51, 0x7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 0x38, 0xda, 0x3d, 0x0f, 0xfb, 0xaf, 0xd1, 0x9d, 0x0d, 0x22, 0x80, - 0x58, 0x71, 0x81, 0x4f, 0x19, 0x96, 0x8a, 0x52, 0x80, 0x74, 0x57, 0x4b, 0x8d, 0xf8, 0xf7, 0x93, - 0x67, 0x30, 0x96, 0x26, 0x61, 0x14, 0x8b, 0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x93, 0xe0, 0xe7, - 0xab, 0xda, 0x01, 0x00, 0x00, + // 298 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x54, 0x90, 0x51, 0x4b, 0xc3, 0x30, + 0x14, 0x85, 0x99, 0xed, 0x74, 0xde, 0xa6, 0x3a, 0x53, 0xc4, 0xb2, 0x07, 0x19, 0x05, 0x45, 0x5f, + 0x0a, 0xf6, 0x37, 0xe8, 0x83, 0x88, 0x2f, 0xab, 0x08, 0x3e, 0x95, 0xd8, 0xde, 0x6d, 0xc5, 0xb5, + 0x29, 0x49, 0x3a, 0xdc, 0x4f, 0xf1, 0xdf, 0x9a, 0xa4, 0x2d, 0xa3, 0x2f, 0x81, 0x9c, 0x73, 0xef, + 0x3d, 0x1f, 0x07, 0x02, 0xc1, 0xd6, 0x2a, 0x93, 0x28, 0xf6, 0x28, 0x9a, 0xef, 0xb8, 0x11, 0x5c, + 0x71, 0xea, 0x8f, 0xc4, 0x05, 0x31, 0xdf, 0xc1, 0x5c, 0x90, 0x0a, 0x15, 0x1b, 0x7e, 0xd1, 0xdf, + 0x04, 0xbc, 0x95, 0xb6, 0xdf, 0x51, 0x4a, 0xb6, 0x41, 0x7a, 0x05, 0xe7, 0x02, 0x37, 0x25, 0xaf, + 0xb3, 0xb2, 0x08, 0x27, 0xcb, 0xc9, 0x83, 0x4b, 0xaf, 0xc1, 0x5f, 0x0b, 0x5e, 0x65, 0x52, 0x71, + 0x81, 0x46, 0x3e, 0xb1, 0x72, 0x00, 0x9e, 0xe2, 0x47, 0xd1, 0xb1, 0xe2, 0x12, 0xce, 0xaa, 0xee, + 0x52, 0xe8, 0x6a, 0xc1, 0x4b, 0x2e, 0xe3, 0x3e, 0x7c, 0x08, 0x78, 0x04, 0xd2, 0x07, 0x60, 0xc3, + 0xf3, 0x6d, 0x38, 0xb5, 0x63, 0x41, 0xdc, 0x53, 0xad, 0xac, 0xf7, 0x62, 0xac, 0xe8, 0x09, 0xa8, + 0x41, 0xfb, 0x10, 0x6d, 0x9d, 0x33, 0x85, 0x45, 0xaa, 0xf4, 0x4b, 0x7d, 0x98, 0x96, 0x75, 0x81, + 0xbf, 0x3d, 0x1d, 0x01, 0x57, 0xa1, 0xa8, 0x3a, 0xa8, 0xe8, 0x1e, 0x66, 0x6f, 0x78, 0xf8, 0x64, + 0xbb, 0x16, 0xa9, 0x07, 0xce, 0x0f, 0x1e, 0xec, 0x18, 0x31, 0x5b, 0x7b, 0xa3, 0xda, 0x39, 0x12, + 0x7d, 0xc1, 0xdc, 0x9c, 0x4e, 0x6b, 0xd6, 0xc8, 0x2d, 0x57, 0xcf, 0x4c, 0x31, 0x7a, 0x0b, 0xa7, + 0x1d, 0x99, 0x5d, 0xf1, 0x92, 0x8b, 0x31, 0x13, 0xbd, 0x03, 0xb7, 0xd0, 0x73, 0xfa, 0x82, 0xa3, + 0xdd, 0x9b, 0x78, 0xdc, 0xfc, 0x10, 0x1b, 0x25, 0x00, 0xa9, 0x29, 0xe5, 0xb5, 0xc0, 0x5a, 0x51, + 0x0a, 0x90, 0xef, 0x5a, 0xa9, 0x11, 0x8f, 0x85, 0xce, 0x61, 0x36, 0xee, 0xf2, 0x3f, 0x00, 0x00, + 0xff, 0xff, 0xe0, 0xdc, 0x02, 0x28, 0xc6, 0x01, 0x00, 0x00, } diff --git a/pd-client/client_test.go b/pd-client/client_test.go index 39d7bc14768..734b6d8103f 100644 --- a/pd-client/client_test.go +++ b/pd-client/client_test.go @@ -36,17 +36,13 @@ var ( Id: proto.Uint64(1), Address: proto.String("localhost"), } - peer = &metapb.Peer{ - Id: proto.Uint64(2), - StoreId: proto.Uint64(store.GetId()), - } region = &metapb.Region{ Id: proto.Uint64(3), RegionEpoch: &metapb.RegionEpoch{ ConfVer: proto.Uint64(1), Version: proto.Uint64(1), }, - Peers: []*metapb.Peer{peer}, + StoreIds: []uint64{store.GetId()}, } ) diff --git a/server/cluster.go b/server/cluster.go index f2127ad78c0..0ab5e2f5794 100644 --- a/server/cluster.go +++ b/server/cluster.go @@ -211,17 +211,17 @@ func checkBootstrapRequest(clusterID uint64, req *pdpb.BootstrapRequest) error { return errors.New("invalid zero region id") } - peers := regionMeta.GetPeers() - if len(peers) != 1 { - return errors.Errorf("invalid first region peer number %d, must be 1 for bootstrap %d", len(peers), clusterID) + storeIDs := regionMeta.GetStoreIds() + if len(storeIDs) != 1 { + return errors.Errorf("invalid first region peer number %d, must be 1 for bootstrap %d", len(storeIDs), clusterID) } - peer := peers[0] + storeID := storeIDs[0] - if peer.GetStoreId() != storeMeta.GetId() { - return errors.Errorf("invalid peer store id %d != %d for bootstrap %d", peer.GetStoreId(), storeMeta.GetId(), clusterID) - } else if peer.GetId() == 0 { - return errors.New("invalid zero peer id") + if storeID != storeMeta.GetId() { + return errors.Errorf("invalid peer store id %d != %d for bootstrap %d", storeID, storeMeta.GetId(), clusterID) + } else if storeID == 0 { + return errors.New("invalid zero peer store id") } return nil diff --git a/server/cluster_test.go b/server/cluster_test.go index c0057f055a5..9b7920c1a66 100644 --- a/server/cluster_test.go +++ b/server/cluster_test.go @@ -66,21 +66,8 @@ func (s *testClusterBaseSuite) newStore(c *C, storeID uint64, addr string) *meta } } -func (s *testClusterBaseSuite) newPeer(c *C, storeID uint64, peerID uint64) *metapb.Peer { - c.Assert(storeID, Greater, uint64(0)) - - if peerID == 0 { - peerID = s.allocID(c) - } - - return &metapb.Peer{ - StoreId: proto.Uint64(storeID), - Id: proto.Uint64(peerID), - } -} - func (s *testClusterBaseSuite) newRegion(c *C, regionID uint64, startKey []byte, - endKey []byte, peers []*metapb.Peer, epoch *metapb.RegionEpoch) *metapb.Region { + endKey []byte, storeIDs []uint64, epoch *metapb.RegionEpoch) *metapb.Region { if regionID == 0 { regionID = s.allocID(c) } @@ -92,17 +79,12 @@ func (s *testClusterBaseSuite) newRegion(c *C, regionID uint64, startKey []byte, } } - for _, peer := range peers { - peerID := peer.GetId() - c.Assert(peerID, Greater, uint64(0)) - } - return &metapb.Region{ Id: proto.Uint64(regionID), StartKey: startKey, EndKey: endKey, - Peers: peers, RegionEpoch: epoch, + StoreIds: storeIDs, } } @@ -154,8 +136,7 @@ func (s *testClusterBaseSuite) newIsBootstrapRequest(clusterID uint64) *pdpb.Req func (s *testClusterBaseSuite) newBootstrapRequest(c *C, clusterID uint64, storeAddr string) *pdpb.Request { store := s.newStore(c, 0, storeAddr) - peer := s.newPeer(c, store.GetId(), 0) - region := s.newRegion(c, 0, []byte{}, []byte{}, []*metapb.Peer{peer}, nil) + region := s.newRegion(c, 0, []byte{}, []byte{}, []uint64{store.GetId()}, nil) req := &pdpb.Request{ Header: newRequestHeader(clusterID), @@ -258,11 +239,10 @@ func (s *testClusterSuite) TestGetPutMeta(c *C) { // Get region. region := s.getRegion(c, conn, clusterID, []byte("abc")) - c.Assert(region.GetPeers(), HasLen, 1) - peer := region.GetPeers()[0] + c.Assert(region.GetStoreIds(), HasLen, 1) // Get store. - storeID := peer.GetStoreId() + storeID := region.GetStoreIds()[0] store := s.getStore(c, conn, clusterID, storeID) c.Assert(store.GetAddress(), Equals, storeAddr) diff --git a/server/cluster_worker.go b/server/cluster_worker.go index e7b0c0ad37f..e040be6085e 100644 --- a/server/cluster_worker.go +++ b/server/cluster_worker.go @@ -176,13 +176,14 @@ func (c *raftCluster) updateJobStatus(job *pd_jobpd.Job, status pd_jobpd.JobStat return nil } -type checkOKFunc func(*raft_cmdpb.RaftCmdRequest) (*raft_cmdpb.AdminResponse, error) +type checkOKFunc func(uint64, *raft_cmdpb.RaftCmdRequest) (*raft_cmdpb.AdminResponse, error) func (c *raftCluster) handleJob(job *pd_jobpd.Job) error { log.Debugf("begin to handle job %v", job) var ( - request = job.Request + request = job.Request + leaderStoreID = job.GetLeaderStoreId() // must be administrator request, check later. adminRequest = request.AdminRequest @@ -215,7 +216,7 @@ func (c *raftCluster) handleJob(job *pd_jobpd.Job) error { // The got response != nil means we have already executed the job and // the region version/conf version is changed, so we don't need to process // the job again. - if resp, err = checkOK(request); err != nil { + if resp, err = checkOK(leaderStoreID, request); err != nil { return errors.Trace(err) } } @@ -244,7 +245,7 @@ func (c *raftCluster) handleJob(job *pd_jobpd.Job) error { func (c *raftCluster) processJob(job *pd_jobpd.Job, checkOK checkOKFunc) (*raft_cmdpb.AdminResponse, error) { request := job.Request - response, err := c.sendRaftCommand(request, job.Region) + response, storeID, err := c.sendRaftCommand(job.GetLeaderStoreId(), request, job.Region) if err != nil { return nil, errors.Trace(err) } @@ -259,7 +260,7 @@ func (c *raftCluster) processJob(job *pd_jobpd.Job, checkOK checkOKFunc) (*raft_ log.Errorf("handle %v but failed with response %v, check in raft server", job.Request, response.Header.Error) - adminResponse, err := checkOK(job.Request) + adminResponse, err := checkOK(storeID, job.Request) if err != nil { return nil, errors.Trace(err) } @@ -274,12 +275,7 @@ func (c *raftCluster) processJob(job *pd_jobpd.Job, checkOK checkOKFunc) (*raft_ return response.AdminResponse, nil } -func (c *raftCluster) handleAddPeerReq(region *metapb.Region) (*metapb.Peer, error) { - peerID, err := c.s.idAlloc.Alloc() - if err != nil { - return nil, errors.Trace(err) - } - +func (c *raftCluster) handleAddPeerReq(region *metapb.Region) (uint64, error) { mu := &c.mu mu.RLock() defer mu.RUnlock() @@ -299,8 +295,8 @@ func (c *raftCluster) handleAddPeerReq(region *metapb.Region) (*metapb.Peer, err storeID := store.GetId() existStore := false - for _, peer := range region.Peers { - if peer.GetStoreId() == storeID { + for _, peerStoreID := range region.StoreIds { + if peerStoreID == storeID { // we can't add peer in the same store. existStore = true break @@ -317,31 +313,29 @@ func (c *raftCluster) handleAddPeerReq(region *metapb.Region) (*metapb.Peer, err } if matchStore == nil { - return nil, errors.Errorf("find no store to add peer for region %v", region) + return 0, errors.Errorf("find no store to add peer for region %v", region) } - peer := &metapb.Peer{ - StoreId: proto.Uint64(matchStore.GetId()), - Id: proto.Uint64(peerID), - } - - return peer, nil + return matchStore.GetId(), nil } -// If leader is nil, we can remove any peer in the region, or else we can only remove none leader peer. -func (c *raftCluster) handleRemovePeerReq(region *metapb.Region, leader *metapb.Peer) (*metapb.Peer, error) { - if len(region.Peers) <= 1 { - return nil, errors.Errorf("can not remove peer for region %v", region) +// If leaderStoreID is 0, we will return an error, or else we can remove none leader peer. +func (c *raftCluster) handleRemovePeerReq(region *metapb.Region, leaderStoreID uint64) (uint64, error) { + if len(region.StoreIds) <= 1 { + return 0, errors.Errorf("can not remove peer for region %v", region) + } + if leaderStoreID == 0 { + return 0, errors.Errorf("invalid leader id for region %v", region) } - for _, peer := range region.Peers { - if peer.GetId() != leader.GetId() { - return peer, nil + for _, peerStoreID := range region.StoreIds { + if peerStoreID != leaderStoreID { + return peerStoreID, nil } } // Maybe we can't enter here. - return nil, errors.Errorf("find no proper peer to remove for region %v", region) + return 0, errors.Errorf("find no proper peer to remove for region %v", region) } func (c *raftCluster) HandleAskChangePeer(request *pdpb.AskChangePeerRequest) error { @@ -354,9 +348,9 @@ func (c *raftCluster) HandleAskChangePeer(request *pdpb.AskChangePeerRequest) er maxPeerNumber = int(clusterMeta.GetMaxPeerNumber()) region = request.GetRegion() regionID = region.GetId() - peerNumber = len(region.GetPeers()) + peerNumber = len(region.GetStoreIds()) changeType raftpb.ConfChangeType - peer *metapb.Peer + storeID uint64 ) if peerNumber == maxPeerNumber { @@ -365,13 +359,13 @@ func (c *raftCluster) HandleAskChangePeer(request *pdpb.AskChangePeerRequest) er } else if peerNumber < maxPeerNumber { log.Infof("region %d peer number %d < %d, need to add peer", regionID, peerNumber, maxPeerNumber) changeType = raftpb.ConfChangeType_AddNode - if peer, err = c.handleAddPeerReq(region); err != nil { + if storeID, err = c.handleAddPeerReq(region); err != nil { return errors.Trace(err) } } else { log.Infof("region %d peer number %d > %d, need to remove peer", regionID, peerNumber, maxPeerNumber) changeType = raftpb.ConfChangeType_RemoveNode - if peer, err = c.handleRemovePeerReq(region, request.Leader); err != nil { + if storeID, err = c.handleRemovePeerReq(region, request.GetLeaderStoreId()); err != nil { return errors.Trace(err) } } @@ -380,22 +374,22 @@ func (c *raftCluster) HandleAskChangePeer(request *pdpb.AskChangePeerRequest) er CmdType: raft_cmdpb.AdminCmdType_ChangePeer.Enum(), ChangePeer: &raft_cmdpb.ChangePeerRequest{ ChangeType: changeType.Enum(), - Peer: peer, + StoreId: proto.Uint64(storeID), }, } req := &raft_cmdpb.RaftCmdRequest{ Header: &raft_cmdpb.RaftRequestHeader{ RegionId: proto.Uint64(regionID), - Peer: request.Leader, RegionEpoch: region.RegionEpoch, }, AdminRequest: changePeer, } job := &pd_jobpd.Job{ - Request: req, - Region: request.Region, + Request: req, + LeaderStoreId: request.LeaderStoreId, + Region: request.Region, } return c.postJob(job) @@ -427,10 +421,9 @@ func (c *raftCluster) handleChangePeerOK(changePeer *raft_cmdpb.ChangePeerRespon return nil } -func (c *raftCluster) checkChangePeerOK(request *raft_cmdpb.RaftCmdRequest) (*raft_cmdpb.AdminResponse, error) { +func (c *raftCluster) checkChangePeerOK(storeID uint64, request *raft_cmdpb.RaftCmdRequest) (*raft_cmdpb.AdminResponse, error) { regionID := request.Header.GetRegionId() - leader := request.Header.Peer - detail, err := c.getRegionDetail(regionID, leader) + detail, err := c.getRegionDetail(storeID, regionID) if err != nil { return nil, errors.Trace(err) } @@ -455,18 +448,10 @@ func (c *raftCluster) HandleAskSplit(request *pdpb.AskSplitRequest) error { return errors.Trace(err) } - peerIDs := make([]uint64, len(request.Region.Peers)) - for i := 0; i < len(peerIDs); i++ { - if peerIDs[i], err = c.s.idAlloc.Alloc(); err != nil { - return errors.Trace(err) - } - } - split := &raft_cmdpb.AdminRequest{ CmdType: raft_cmdpb.AdminCmdType_Split.Enum(), Split: &raft_cmdpb.SplitRequest{ NewRegionId: proto.Uint64(newRegionID), - NewPeerIds: peerIDs, SplitKey: request.SplitKey, }, } @@ -474,15 +459,15 @@ func (c *raftCluster) HandleAskSplit(request *pdpb.AskSplitRequest) error { req := &raft_cmdpb.RaftCmdRequest{ Header: &raft_cmdpb.RaftRequestHeader{ RegionId: request.Region.Id, - Peer: request.Leader, RegionEpoch: request.Region.RegionEpoch, }, AdminRequest: split, } job := &pd_jobpd.Job{ - Request: req, - Region: request.Region, + Request: req, + LeaderStoreId: request.LeaderStoreId, + Region: request.Region, } return c.postJob(job) @@ -555,12 +540,11 @@ func (c *raftCluster) handleSplitOK(split *raft_cmdpb.SplitResponse) error { return nil } -func (c *raftCluster) checkSplitOK(request *raft_cmdpb.RaftCmdRequest) (*raft_cmdpb.AdminResponse, error) { +func (c *raftCluster) checkSplitOK(storeID uint64, request *raft_cmdpb.RaftCmdRequest) (*raft_cmdpb.AdminResponse, error) { split := request.AdminRequest.Split leftRegionID := request.Header.GetRegionId() rightRegionID := split.GetNewRegionId() - leader := request.Header.Peer - leftDetail, err := c.getRegionDetail(leftRegionID, leader) + leftDetail, err := c.getRegionDetail(storeID, leftRegionID) if err != nil { return nil, errors.Trace(err) } @@ -571,7 +555,7 @@ func (c *raftCluster) checkSplitOK(request *raft_cmdpb.RaftCmdRequest) (*raft_cm return nil, nil } - rightDetail, err := c.getRegionDetail(rightRegionID, leader) + rightDetail, err := c.getRegionDetail(storeID, rightRegionID) if err != nil { return nil, errors.Trace(err) } @@ -585,62 +569,60 @@ func (c *raftCluster) checkSplitOK(request *raft_cmdpb.RaftCmdRequest) (*raft_cm }, nil } -func (c *raftCluster) sendRaftCommand(request *raft_cmdpb.RaftCmdRequest, region *metapb.Region) (*raft_cmdpb.RaftCmdResponse, error) { - originPeer := request.Header.Peer +func (c *raftCluster) sendRaftCommand(storeID uint64, request *raft_cmdpb.RaftCmdRequest, region *metapb.Region) (*raft_cmdpb.RaftCmdResponse, uint64, error) { + originStoreID := storeID RETRY: for i := 0; i < maxSendRetry; i++ { - resp, err := c.callCommand(request) + resp, err := c.callCommand(storeID, request) if err != nil { // We may meet some error, maybe network broken, node down, etc. // We can check later next time. - return nil, errors.Trace(err) + return nil, 0, errors.Trace(err) } if resp.Header.Error != nil && resp.Header.Error.NotLeader != nil { - log.Warnf("peer %v is not leader, we got %v", request.Header.Peer, resp.Header.Error) + log.Warnf("peer %v is not leader, we got %v", storeID, resp.Header.Error) - leader := resp.Header.Error.NotLeader.Leader - if leader != nil { + leader := resp.Header.Error.NotLeader.GetLeaderStoreId() + if leader != 0 { // The origin peer is not leader and we get the new leader, // send this message to the new leader again. - request.Header.Peer = leader + storeID = leader continue } regionID := region.GetId() // The origin peer is not leader, but we can't get the leader now, // so we try to get the leader in other region peers. - for _, peer := range region.Peers { - if peer.GetId() == originPeer.GetId() { + for _, peerStoreID := range region.StoreIds { + if peerStoreID == originStoreID { continue } - leader, err := c.getRegionLeader(regionID, peer) + leader, err := c.getRegionLeader(peerStoreID, regionID) if err != nil { log.Errorf("get region %d leader err %v", regionID, err) continue } - if leader == nil { - log.Infof("can not get leader for region %d in peer %v", regionID, peer) + if leader == 0 { + log.Infof("can not get leader for region %d in peer %v", regionID, peerStoreID) continue } // We get leader here. - request.Header.Peer = leader + storeID = leader continue RETRY } } - return resp, nil + return resp, storeID, nil } - return nil, errors.Errorf("send raft command %v failed", request) + return nil, 0, errors.Errorf("send raft command %v failed", request) } -func (c *raftCluster) callCommand(request *raft_cmdpb.RaftCmdRequest) (*raft_cmdpb.RaftCmdResponse, error) { - storeID := request.Header.Peer.GetStoreId() - +func (c *raftCluster) callCommand(storeID uint64, request *raft_cmdpb.RaftCmdRequest) (*raft_cmdpb.RaftCmdResponse, error) { store, err := c.GetStore(storeID) if err != nil { return nil, errors.Trace(err) @@ -676,12 +658,11 @@ func (c *raftCluster) callCommand(request *raft_cmdpb.RaftCmdRequest) (*raft_cmd return msg.CmdResp, nil } -func (c *raftCluster) getRegionLeader(regionID uint64, peer *metapb.Peer) (*metapb.Peer, error) { +func (c *raftCluster) getRegionLeader(storeID uint64, regionID uint64) (uint64, error) { request := &raft_cmdpb.RaftCmdRequest{ Header: &raft_cmdpb.RaftRequestHeader{ Uuid: uuid.NewV4().Bytes(), RegionId: proto.Uint64(regionID), - Peer: peer, }, StatusRequest: &raft_cmdpb.StatusRequest{ CmdType: raft_cmdpb.StatusCmdType_RegionLeader.Enum(), @@ -689,24 +670,23 @@ func (c *raftCluster) getRegionLeader(regionID uint64, peer *metapb.Peer) (*meta }, } - resp, err := c.callCommand(request) + resp, err := c.callCommand(storeID, request) if err != nil { - return nil, errors.Trace(err) + return 0, errors.Trace(err) } if resp.StatusResponse != nil && resp.StatusResponse.RegionLeader != nil { - return resp.StatusResponse.RegionLeader.Leader, nil + return resp.StatusResponse.RegionLeader.GetLeaderStoreId(), nil } - return nil, errors.Errorf("get region %d leader failed, got resp %v", regionID, resp) + return 0, errors.Errorf("get region %d leader failed, got resp %v", regionID, resp) } -func (c *raftCluster) getRegionDetail(regionID uint64, peer *metapb.Peer) (*raft_cmdpb.RegionDetailResponse, error) { +func (c *raftCluster) getRegionDetail(storeID uint64, regionID uint64) (*raft_cmdpb.RegionDetailResponse, error) { request := &raft_cmdpb.RaftCmdRequest{ Header: &raft_cmdpb.RaftRequestHeader{ Uuid: uuid.NewV4().Bytes(), RegionId: proto.Uint64(regionID), - Peer: peer, }, StatusRequest: &raft_cmdpb.StatusRequest{ CmdType: raft_cmdpb.StatusCmdType_RegionDetail.Enum(), @@ -714,7 +694,7 @@ func (c *raftCluster) getRegionDetail(regionID uint64, peer *metapb.Peer) (*raft }, } - resp, err := c.callCommand(request) + resp, err := c.callCommand(storeID, request) if err != nil { return nil, errors.Trace(err) } diff --git a/server/cluster_worker_test.go b/server/cluster_worker_test.go index fe4870e631e..896ce103a5b 100644 --- a/server/cluster_worker_test.go +++ b/server/cluster_worker_test.go @@ -30,7 +30,7 @@ type testClusterWorkerSuite struct { stores map[uint64]*mockRaftStore regionLeaderLock sync.Mutex - regionLeaders map[uint64]metapb.Peer + regionLeaders map[uint64]uint64 quitCh chan struct{} } @@ -40,14 +40,14 @@ func (s *testClusterWorkerSuite) getRootPath() string { } type mockRaftPeer struct { - peer metapb.Peer - region metapb.Region + storeID uint64 + region metapb.Region } type mockRaftMsg struct { - peer metapb.Peer - region metapb.Region - req *raft_cmdpb.RaftCmdRequest + storeID uint64 + region metapb.Region + req *raft_cmdpb.RaftCmdRequest } type mockRaftStore struct { @@ -112,7 +112,7 @@ func (s *testClusterWorkerSuite) newMockRaftStore(c *C, metaStore *metapb.Store) } func (s *testClusterWorkerSuite) sendRaftMsg(c *C, msg *mockRaftMsg) { - storeID := msg.peer.GetStoreId() + storeID := msg.storeID s.storeLock.Lock() defer s.storeLock.Unlock() @@ -125,19 +125,19 @@ func (s *testClusterWorkerSuite) sendRaftMsg(c *C, msg *mockRaftMsg) { select { case store.raftMsgCh <- msg: default: - c.Logf("can not send msg to %v", msg.peer) + c.Logf("can not send msg to %v", msg.storeID) } } func (s *testClusterWorkerSuite) broadcastRaftMsg(c *C, leader *mockRaftPeer, req *raft_cmdpb.RaftCmdRequest) { region := leader.region - for _, peer := range region.Peers { - if peer.GetId() != leader.peer.GetId() { + for _, peerStoreID := range region.StoreIds { + if peerStoreID != leader.storeID { msg := &mockRaftMsg{ - peer: *peer, - region: *proto.Clone(®ion).(*metapb.Region), - req: req, + storeID: peerStoreID, + region: *proto.Clone(®ion).(*metapb.Region), + req: req, } s.sendRaftMsg(c, msg) } @@ -148,11 +148,11 @@ func (s *testClusterWorkerSuite) broadcastRaftMsg(c *C, leader *mockRaftPeer, if req.AdminRequest != nil && req.AdminRequest.ChangePeer != nil { changePeer := req.AdminRequest.ChangePeer if changePeer.GetChangeType() == raftpb.ConfChangeType_AddNode { - c.Assert(changePeer.Peer.GetId(), Not(Equals), leader.peer.GetId()) + c.Assert(changePeer.GetStoreId(), Not(Equals), leader.storeID) msg := &mockRaftMsg{ - peer: *changePeer.Peer, - region: *proto.Clone(®ion).(*metapb.Region), - req: req, + storeID: changePeer.GetStoreId(), + region: *proto.Clone(®ion).(*metapb.Region), + req: req, } s.sendRaftMsg(c, msg) } @@ -166,15 +166,15 @@ func (s *testClusterWorkerSuite) clearRegionLeader(c *C, regionID uint64) { delete(s.regionLeaders, regionID) } -func (s *testClusterWorkerSuite) chooseRegionLeader(c *C, region *metapb.Region) *metapb.Peer { +func (s *testClusterWorkerSuite) chooseRegionLeader(c *C, region *metapb.Region) uint64 { // randomly select a peer in the region as the leader - peer := region.Peers[rand.Intn(len(region.Peers))] + storeID := region.StoreIds[rand.Intn(len(region.StoreIds))] s.regionLeaderLock.Lock() defer s.regionLeaderLock.Unlock() - s.regionLeaders[region.GetId()] = *peer - return peer + s.regionLeaders[region.GetId()] = storeID + return storeID } func (s *mockRaftStore) addRegion(c *C, region *metapb.Region) { @@ -183,21 +183,21 @@ func (s *mockRaftStore) addRegion(c *C, region *metapb.Region) { storeID := s.store.GetId() var ( - peer metapb.Peer - found = false + peerStoreID uint64 + found = false ) - for _, p := range region.Peers { - if p.GetStoreId() == storeID { - peer = *p + for _, id := range region.StoreIds { + if id == storeID { + peerStoreID = id found = true break } } c.Assert(found, IsTrue) s.peers[region.GetId()] = &mockRaftPeer{ - peer: peer, - region: *proto.Clone(region).(*metapb.Region), + storeID: peerStoreID, + region: *proto.Clone(region).(*metapb.Region), } } @@ -268,8 +268,8 @@ func (s *mockRaftStore) handleRaftMsg(c *C, msg *mockRaftMsg) { if !ok { // No peer, create it. s.peers[regionID] = &mockRaftPeer{ - peer: msg.peer, - region: msg.region, + storeID: msg.storeID, + region: msg.region, } } @@ -311,14 +311,14 @@ func (s *mockRaftStore) proposeCommand(c *C, req *raft_cmdpb.RaftCmdRequest) *ra defer s.s.regionLeaderLock.Unlock() leader, ok := s.s.regionLeaders[regionID] - if !ok || leader.GetId() != peer.peer.GetId() { + if !ok || leader != peer.storeID { resp := newErrorCmdResponse(errors.New("peer not leader")) resp.Header.Error.NotLeader = &errorpb.NotLeader{ RegionId: proto.Uint64(regionID), } if ok { - resp.Header.Error.NotLeader.Leader = &leader + resp.Header.Error.NotLeader.LeaderStoreId = proto.Uint64(leader) } return resp @@ -329,7 +329,7 @@ func (s *mockRaftStore) proposeCommand(c *C, req *raft_cmdpb.RaftCmdRequest) *ra resp := s.handleWriteCommand(c, req) // update the region leader. - s.s.regionLeaders[regionID] = peer.peer + s.s.regionLeaders[regionID] = peer.storeID return resp } @@ -347,12 +347,12 @@ func (s *mockRaftStore) handleStatusRequest(c *C, req *raft_cmdpb.RaftCmdRequest peer := s.peers[regionID] - var leader *metapb.Peer + var leader uint64 s.s.regionLeaderLock.Lock() l, ok := s.s.regionLeaders[regionID] s.s.regionLeaderLock.Unlock() if ok { - leader = &l + leader = l } switch status.GetCmdType() { @@ -361,7 +361,7 @@ func (s *mockRaftStore) handleStatusRequest(c *C, req *raft_cmdpb.RaftCmdRequest StatusResponse: &raft_cmdpb.StatusResponse{ CmdType: raft_cmdpb.StatusCmdType_RegionLeader.Enum(), RegionLeader: &raft_cmdpb.RegionLeaderResponse{ - Leader: leader, + LeaderStoreId: proto.Uint64(leader), }, }, } @@ -370,8 +370,8 @@ func (s *mockRaftStore) handleStatusRequest(c *C, req *raft_cmdpb.RaftCmdRequest StatusResponse: &raft_cmdpb.StatusResponse{ CmdType: raft_cmdpb.StatusCmdType_RegionDetail.Enum(), RegionDetail: &raft_cmdpb.RegionDetailResponse{ - Leader: leader, - Region: proto.Clone(&peer.region).(*metapb.Region), + LeaderStoreId: proto.Uint64(leader), + Region: proto.Clone(&peer.region).(*metapb.Region), }, }, } @@ -398,7 +398,7 @@ func (s *mockRaftStore) handleAdminRequest(c *C, req *raft_cmdpb.RaftCmdRequest) func (s *mockRaftStore) handleChangePeer(c *C, req *raft_cmdpb.RaftCmdRequest) *raft_cmdpb.RaftCmdResponse { changePeer := req.AdminRequest.ChangePeer confType := changePeer.GetChangeType() - peer := changePeer.Peer + storeID := changePeer.GetStoreId() raftPeer := s.peers[req.Header.GetRegionId()] region := raftPeer.region @@ -410,31 +410,31 @@ func (s *mockRaftStore) handleChangePeer(c *C, req *raft_cmdpb.RaftCmdRequest) * } if confType == raftpb.ConfChangeType_AddNode { - for _, p := range region.Peers { - if p.GetId() == peer.GetId() || p.GetStoreId() == peer.GetStoreId() { - return newErrorCmdResponse(errors.Errorf("add duplicated peer %v for region %v", peer, region)) + for _, id := range region.StoreIds { + if id == storeID { + return newErrorCmdResponse(errors.Errorf("add duplicated peer %v for region %v", storeID, region)) } } - region.Peers = append(region.Peers, peer) + region.StoreIds = append(region.StoreIds, storeID) raftPeer.region = region } else { foundIndex := -1 - for i, p := range region.Peers { - if p.GetId() == peer.GetId() { + for i, id := range region.StoreIds { + if id == storeID { foundIndex = i break } } if foundIndex == -1 { - return newErrorCmdResponse(errors.Errorf("remove missing peer %v for region %v", peer, region)) + return newErrorCmdResponse(errors.Errorf("remove missing peer %v for region %v", storeID, region)) } - region.Peers = append(region.Peers[:foundIndex], region.Peers[foundIndex+1:]...) + region.StoreIds = append(region.StoreIds[:foundIndex], region.StoreIds[foundIndex+1:]...) raftPeer.region = region // remove itself - if peer.GetStoreId() == s.store.GetId() { + if storeID == s.store.GetId() { delete(s.peers, region.GetId()) } } @@ -456,12 +456,9 @@ func (s *mockRaftStore) handleSplit(c *C, req *raft_cmdpb.RaftCmdRequest) *raft_ raftPeer := s.peers[req.Header.GetRegionId()] splitKey := split.SplitKey newRegionID := split.GetNewRegionId() - newPeerIDs := split.GetNewPeerIds() region := raftPeer.region - c.Assert(newPeerIDs, HasLen, len(region.Peers)) - version := region.RegionEpoch.GetVersion() if version > req.Header.RegionEpoch.GetVersion() { return newErrorCmdResponse(errors.Errorf("stale message with epoch %v < %v", @@ -480,7 +477,7 @@ func (s *mockRaftStore) handleSplit(c *C, req *raft_cmdpb.RaftCmdRequest) *raft_ region.RegionEpoch.Version = proto.Uint64(version + 1) newRegion := &metapb.Region{ Id: proto.Uint64(newRegionID), - Peers: make([]*metapb.Peer, len(newPeerIDs)), + StoreIds: append([]uint64(nil), region.StoreIds...), StartKey: splitKey, EndKey: append([]byte(nil), region.GetEndKey()...), RegionEpoch: &metapb.RegionEpoch{ @@ -489,25 +486,21 @@ func (s *mockRaftStore) handleSplit(c *C, req *raft_cmdpb.RaftCmdRequest) *raft_ }, } - var newPeer metapb.Peer - - for i, id := range newPeerIDs { - peer := *region.Peers[i] - peer.Id = proto.Uint64(id) + var leaderStoreID uint64 - if peer.GetStoreId() == s.store.GetId() { - newPeer = peer + for _, id := range region.StoreIds { + if id == s.store.GetId() { + leaderStoreID = id + break } - - newRegion.Peers[i] = &peer } region.EndKey = append([]byte(nil), splitKey...) raftPeer.region = region s.peers[newRegionID] = &mockRaftPeer{ - peer: newPeer, - region: *newRegion, + storeID: leaderStoreID, + region: *newRegion, } resp := &raft_cmdpb.RaftCmdResponse{ @@ -531,7 +524,7 @@ func (s *testClusterWorkerSuite) SetUpSuite(c *C) { s.client = newEtcdClient(c) - s.regionLeaders = make(map[uint64]metapb.Peer) + s.regionLeaders = make(map[uint64]uint64) s.quitCh = make(chan struct{}) @@ -574,22 +567,22 @@ func (s *testClusterWorkerSuite) checkRegionPeerNumber(c *C, regionKey []byte, e for i := 0; i < 10; i++ { region, err1 := cluster.GetRegion(regionKey) c.Assert(err1, IsNil) - if len(region.Peers) == expectNumber { + if len(region.StoreIds) == expectNumber { return region } time.Sleep(100 * time.Millisecond) } region, err := cluster.GetRegion(regionKey) c.Assert(err, IsNil) - c.Assert(region.Peers, HasLen, expectNumber) + c.Assert(region.StoreIds, HasLen, expectNumber) return region } -func (s *testClusterWorkerSuite) regionPeerExisted(c *C, regionID uint64, peer *metapb.Peer) bool { +func (s *testClusterWorkerSuite) regionPeerExisted(c *C, regionID uint64, storeID uint64) bool { s.storeLock.Lock() defer s.storeLock.Unlock() - store, ok := s.stores[peer.GetStoreId()] + store, ok := s.stores[storeID] if !ok { return false } @@ -601,7 +594,7 @@ func (s *testClusterWorkerSuite) regionPeerExisted(c *C, regionID uint64, peer * return false } - c.Assert(p.peer.GetId(), Equals, peer.GetId()) + c.Assert(p.storeID, Equals, storeID) return true } @@ -617,7 +610,7 @@ func (s *testClusterWorkerSuite) TestChangePeer(c *C) { region, err := cluster.GetRegion(regionKey) c.Assert(err, IsNil) - c.Assert(region.Peers, HasLen, 1) + c.Assert(region.StoreIds, HasLen, 1) leaderPd := mustGetLeader(c, s.client, s.svr.getLeaderPath()) @@ -627,14 +620,14 @@ func (s *testClusterWorkerSuite) TestChangePeer(c *C) { // add another 4 peers. for i := 0; i < 4; i++ { - leaderPeer := s.chooseRegionLeader(c, region) + leaderID := s.chooseRegionLeader(c, region) askChangePeer := &pdpb.Request{ Header: newRequestHeader(s.clusterID), CmdType: pdpb.CommandType_AskChangePeer.Enum(), AskChangePeer: &pdpb.AskChangePeerRequest{ - Leader: leaderPeer, - Region: region, + LeaderStoreId: proto.Uint64(leaderID), + Region: region, }, } @@ -654,8 +647,8 @@ func (s *testClusterWorkerSuite) TestChangePeer(c *C) { region = s.checkRegionPeerNumber(c, regionKey, 5) regionID := region.GetId() - for _, peer := range region.Peers { - ok := s.regionPeerExisted(c, regionID, peer) + for _, id := range region.StoreIds { + ok := s.regionPeerExisted(c, regionID, id) c.Assert(ok, IsTrue) } @@ -669,14 +662,14 @@ func (s *testClusterWorkerSuite) TestChangePeer(c *C) { // remove 2 peers for i := 0; i < 2; i++ { - leaderPeer := s.chooseRegionLeader(c, region) + leaderID := s.chooseRegionLeader(c, region) askChangePeer := &pdpb.Request{ Header: newRequestHeader(s.clusterID), CmdType: pdpb.CommandType_AskChangePeer.Enum(), AskChangePeer: &pdpb.AskChangePeerRequest{ - Leader: leaderPeer, - Region: region, + LeaderStoreId: proto.Uint64(leaderID), + Region: region, }, } sendRequest(c, conn, 0, askChangePeer) @@ -688,16 +681,16 @@ func (s *testClusterWorkerSuite) TestChangePeer(c *C) { region = s.checkRegionPeerNumber(c, regionKey, 3) - for _, peer := range region.Peers { - ok := s.regionPeerExisted(c, regionID, peer) + for _, id := range region.StoreIds { + ok := s.regionPeerExisted(c, regionID, id) c.Assert(ok, IsTrue) } // check removed peer - for _, oldPeer := range oldRegion.Peers { + for _, oldID := range oldRegion.StoreIds { found := false - for _, peer := range region.Peers { - if oldPeer.GetId() == peer.GetId() { + for _, id := range region.StoreIds { + if oldID == id { found = true break } @@ -707,7 +700,7 @@ func (s *testClusterWorkerSuite) TestChangePeer(c *C) { continue } - ok := s.regionPeerExisted(c, regionID, oldPeer) + ok := s.regionPeerExisted(c, regionID, oldID) c.Assert(ok, IsFalse) } } @@ -742,7 +735,7 @@ func (s *testClusterWorkerSuite) TestSplit(c *C) { c.Assert(region.GetEndKey(), BytesEquals, []byte(t.endKey)) // Now we treat the first peer in region as leader. - leaderPeer := s.chooseRegionLeader(c, region) + leaderID := s.chooseRegionLeader(c, region) if rand.Intn(2) == 1 { // randomly change leader s.clearRegionLeader(c, region.GetId()) @@ -753,9 +746,9 @@ func (s *testClusterWorkerSuite) TestSplit(c *C) { Header: newRequestHeader(s.clusterID), CmdType: pdpb.CommandType_AskSplit.Enum(), AskSplit: &pdpb.AskSplitRequest{ - Region: region, - Leader: leaderPeer, - SplitKey: []byte(t.splitKey), + Region: region, + LeaderStoreId: proto.Uint64(leaderID), + SplitKey: []byte(t.splitKey), }, } @@ -770,8 +763,8 @@ func (s *testClusterWorkerSuite) TestSplit(c *C) { c.Assert(left.GetEndKey(), BytesEquals, []byte(t.splitKey)) c.Assert(left.GetId(), Equals, region.GetId()) - for _, peer := range left.Peers { - ok := s.regionPeerExisted(c, left.GetId(), peer) + for _, id := range left.StoreIds { + ok := s.regionPeerExisted(c, left.GetId(), id) c.Assert(ok, IsTrue) } diff --git a/server/command.go b/server/command.go index 58b6e86fd77..e5b26eb0e11 100644 --- a/server/command.go +++ b/server/command.go @@ -87,7 +87,7 @@ func (c *conn) handleBootstrap(req *pdpb.Request) (*pdpb.Response, error) { return c.s.bootstrapCluster(request) } -func (c *conn) getRaftCluster(req *pdpb.Request) (*raftCluster, error) { +func (c *conn) getRaftCluster() (*raftCluster, error) { cluster, err := c.s.getRaftCluster() if err != nil { return nil, errors.Trace(err) @@ -104,7 +104,7 @@ func (c *conn) handleGetMeta(req *pdpb.Request) (*pdpb.Response, error) { return nil, errors.Errorf("invalid get meta command, but %v", req) } - cluster, err := c.getRaftCluster(req) + cluster, err := c.getRaftCluster() if err != nil { return nil, errors.Trace(err) } @@ -150,7 +150,7 @@ func (c *conn) handlePutMeta(req *pdpb.Request) (*pdpb.Response, error) { return nil, errors.Errorf("invalid put meta command, but %v", req) } - cluster, err := c.getRaftCluster(req) + cluster, err := c.getRaftCluster() if err != nil { return nil, errors.Trace(err) } @@ -181,17 +181,14 @@ func (c *conn) handlePutMeta(req *pdpb.Request) (*pdpb.Response, error) { func (c *conn) handleAskChangePeer(req *pdpb.Request) (*pdpb.Response, error) { request := req.GetAskChangePeer() - if request == nil { - return nil, errors.Errorf("invalid ask change peer command, but %v", req) - } - if request.Region == nil { + if request.GetRegion() == nil { return nil, errors.New("missing region for changing peer") } - if request.Leader == nil { + if request.GetLeaderStoreId() == 0 { return nil, errors.New("missing leader for changing peer") } - cluster, err := c.getRaftCluster(req) + cluster, err := c.getRaftCluster() if err != nil { return nil, errors.Trace(err) } @@ -207,20 +204,17 @@ func (c *conn) handleAskChangePeer(req *pdpb.Request) (*pdpb.Response, error) { func (c *conn) handleAskSplit(req *pdpb.Request) (*pdpb.Response, error) { request := req.GetAskSplit() - if request == nil { - return nil, errors.Errorf("invalid ask split command, but %v", req) - } - if request.Region == nil { + if request.GetRegion() == nil { return nil, errors.New("missing region for split") } - if request.Leader == nil { + if request.GetLeaderStoreId() == 0 { return nil, errors.New("missing leader for split") } - if request.SplitKey == nil { + if request.GetSplitKey() == nil { return nil, errors.New("missing split key for split") } - cluster, err := c.getRaftCluster(req) + cluster, err := c.getRaftCluster() if err != nil { return nil, errors.Trace(err) }