From dcd622b2c79d8827708a2e15ea1cce8719973b09 Mon Sep 17 00:00:00 2001 From: Jingyi Hu Date: Tue, 26 Nov 2019 13:56:21 -0800 Subject: [PATCH 1/5] etcdserver: add v3 request type for cluster attr Added ClusterVersionSetRequest for setting cluster version via v3 apply. Added ClusterMemberAttrSetRequest for setting clsuter member attributes via v3 apply. --- .../membership/membershippb/membership.pb.go | 1035 +++++++++++++++++ .../membership/membershippb/membership.proto | 38 + etcdserver/etcdserverpb/raft_internal.pb.go | 276 +++-- etcdserver/etcdserverpb/raft_internal.proto | 4 + scripts/genproto.sh | 2 +- 5 files changed, 1270 insertions(+), 85 deletions(-) create mode 100644 etcdserver/api/membership/membershippb/membership.pb.go create mode 100644 etcdserver/api/membership/membershippb/membership.proto diff --git a/etcdserver/api/membership/membershippb/membership.pb.go b/etcdserver/api/membership/membershippb/membership.pb.go new file mode 100644 index 00000000000..57242a1231c --- /dev/null +++ b/etcdserver/api/membership/membershippb/membership.pb.go @@ -0,0 +1,1035 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: membership.proto + +/* + Package membershippb is a generated protocol buffer package. + + It is generated from these files: + membership.proto + + It has these top-level messages: + RaftAttributes + Attributes + Member + ClusterVersionSetRequest + ClusterMemberAttrSetRequest +*/ +package membershippb + +import ( + "fmt" + + proto "github.com/golang/protobuf/proto" + + math "math" + + _ "github.com/gogo/protobuf/gogoproto" + + io "io" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package + +// RaftAttributes represents the raft related attributes of an etcd member. +type RaftAttributes struct { + // peerURLs is the list of peers in the raft cluster. + PeerUrls []string `protobuf:"bytes,1,rep,name=peer_urls,json=peerUrls" json:"peer_urls,omitempty"` + // isLearner indicates if the member is raft learner. + IsLearner bool `protobuf:"varint,2,opt,name=is_learner,json=isLearner,proto3" json:"is_learner,omitempty"` +} + +func (m *RaftAttributes) Reset() { *m = RaftAttributes{} } +func (m *RaftAttributes) String() string { return proto.CompactTextString(m) } +func (*RaftAttributes) ProtoMessage() {} +func (*RaftAttributes) Descriptor() ([]byte, []int) { return fileDescriptorMembership, []int{0} } + +// Attributes represents all the non-raft related attributes of an etcd member. +type Attributes struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + ClientUrls []string `protobuf:"bytes,2,rep,name=client_urls,json=clientUrls" json:"client_urls,omitempty"` +} + +func (m *Attributes) Reset() { *m = Attributes{} } +func (m *Attributes) String() string { return proto.CompactTextString(m) } +func (*Attributes) ProtoMessage() {} +func (*Attributes) Descriptor() ([]byte, []int) { return fileDescriptorMembership, []int{1} } + +type Member struct { + ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + RaftAttributes *RaftAttributes `protobuf:"bytes,2,opt,name=raft_attributes,json=raftAttributes" json:"raft_attributes,omitempty"` + MemberAttributes *Attributes `protobuf:"bytes,3,opt,name=member_attributes,json=memberAttributes" json:"member_attributes,omitempty"` +} + +func (m *Member) Reset() { *m = Member{} } +func (m *Member) String() string { return proto.CompactTextString(m) } +func (*Member) ProtoMessage() {} +func (*Member) Descriptor() ([]byte, []int) { return fileDescriptorMembership, []int{2} } + +type ClusterVersionSetRequest struct { + Ver string `protobuf:"bytes,1,opt,name=ver,proto3" json:"ver,omitempty"` +} + +func (m *ClusterVersionSetRequest) Reset() { *m = ClusterVersionSetRequest{} } +func (m *ClusterVersionSetRequest) String() string { return proto.CompactTextString(m) } +func (*ClusterVersionSetRequest) ProtoMessage() {} +func (*ClusterVersionSetRequest) Descriptor() ([]byte, []int) { + return fileDescriptorMembership, []int{3} +} + +type ClusterMemberAttrSetRequest struct { + Member_ID uint64 `protobuf:"varint,1,opt,name=member_ID,json=memberID,proto3" json:"member_ID,omitempty"` + MemberAttributes *Attributes `protobuf:"bytes,2,opt,name=member_attributes,json=memberAttributes" json:"member_attributes,omitempty"` +} + +func (m *ClusterMemberAttrSetRequest) Reset() { *m = ClusterMemberAttrSetRequest{} } +func (m *ClusterMemberAttrSetRequest) String() string { return proto.CompactTextString(m) } +func (*ClusterMemberAttrSetRequest) ProtoMessage() {} +func (*ClusterMemberAttrSetRequest) Descriptor() ([]byte, []int) { + return fileDescriptorMembership, []int{4} +} + +func init() { + proto.RegisterType((*RaftAttributes)(nil), "membershippb.RaftAttributes") + proto.RegisterType((*Attributes)(nil), "membershippb.Attributes") + proto.RegisterType((*Member)(nil), "membershippb.Member") + proto.RegisterType((*ClusterVersionSetRequest)(nil), "membershippb.ClusterVersionSetRequest") + proto.RegisterType((*ClusterMemberAttrSetRequest)(nil), "membershippb.ClusterMemberAttrSetRequest") +} +func (m *RaftAttributes) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RaftAttributes) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.PeerUrls) > 0 { + for _, s := range m.PeerUrls { + dAtA[i] = 0xa + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } + if m.IsLearner { + dAtA[i] = 0x10 + i++ + if m.IsLearner { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + return i, nil +} + +func (m *Attributes) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Attributes) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Name) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintMembership(dAtA, i, uint64(len(m.Name))) + i += copy(dAtA[i:], m.Name) + } + if len(m.ClientUrls) > 0 { + for _, s := range m.ClientUrls { + dAtA[i] = 0x12 + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } + return i, nil +} + +func (m *Member) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Member) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.ID != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintMembership(dAtA, i, uint64(m.ID)) + } + if m.RaftAttributes != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintMembership(dAtA, i, uint64(m.RaftAttributes.Size())) + n1, err := m.RaftAttributes.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + if m.MemberAttributes != nil { + dAtA[i] = 0x1a + i++ + i = encodeVarintMembership(dAtA, i, uint64(m.MemberAttributes.Size())) + n2, err := m.MemberAttributes.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n2 + } + return i, nil +} + +func (m *ClusterVersionSetRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClusterVersionSetRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.Ver) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintMembership(dAtA, i, uint64(len(m.Ver))) + i += copy(dAtA[i:], m.Ver) + } + return i, nil +} + +func (m *ClusterMemberAttrSetRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalTo(dAtA) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ClusterMemberAttrSetRequest) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Member_ID != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintMembership(dAtA, i, uint64(m.Member_ID)) + } + if m.MemberAttributes != nil { + dAtA[i] = 0x12 + i++ + i = encodeVarintMembership(dAtA, i, uint64(m.MemberAttributes.Size())) + n3, err := m.MemberAttributes.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n3 + } + return i, nil +} + +func encodeVarintMembership(dAtA []byte, offset int, v uint64) int { + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return offset + 1 +} +func (m *RaftAttributes) Size() (n int) { + var l int + _ = l + if len(m.PeerUrls) > 0 { + for _, s := range m.PeerUrls { + l = len(s) + n += 1 + l + sovMembership(uint64(l)) + } + } + if m.IsLearner { + n += 2 + } + return n +} + +func (m *Attributes) Size() (n int) { + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovMembership(uint64(l)) + } + if len(m.ClientUrls) > 0 { + for _, s := range m.ClientUrls { + l = len(s) + n += 1 + l + sovMembership(uint64(l)) + } + } + return n +} + +func (m *Member) Size() (n int) { + var l int + _ = l + if m.ID != 0 { + n += 1 + sovMembership(uint64(m.ID)) + } + if m.RaftAttributes != nil { + l = m.RaftAttributes.Size() + n += 1 + l + sovMembership(uint64(l)) + } + if m.MemberAttributes != nil { + l = m.MemberAttributes.Size() + n += 1 + l + sovMembership(uint64(l)) + } + return n +} + +func (m *ClusterVersionSetRequest) Size() (n int) { + var l int + _ = l + l = len(m.Ver) + if l > 0 { + n += 1 + l + sovMembership(uint64(l)) + } + return n +} + +func (m *ClusterMemberAttrSetRequest) Size() (n int) { + var l int + _ = l + if m.Member_ID != 0 { + n += 1 + sovMembership(uint64(m.Member_ID)) + } + if m.MemberAttributes != nil { + l = m.MemberAttributes.Size() + n += 1 + l + sovMembership(uint64(l)) + } + return n +} + +func sovMembership(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozMembership(x uint64) (n int) { + return sovMembership(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RaftAttributes) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RaftAttributes: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RaftAttributes: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PeerUrls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PeerUrls = append(m.PeerUrls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsLearner", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.IsLearner = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipMembership(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMembership + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Attributes) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Attributes: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Attributes: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClientUrls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ClientUrls = append(m.ClientUrls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMembership(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMembership + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Member) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Member: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Member: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType) + } + m.ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ID |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RaftAttributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RaftAttributes == nil { + m.RaftAttributes = &RaftAttributes{} + } + if err := m.RaftAttributes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MemberAttributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MemberAttributes == nil { + m.MemberAttributes = &Attributes{} + } + if err := m.MemberAttributes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMembership(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMembership + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClusterVersionSetRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClusterVersionSetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClusterVersionSetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Ver", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Ver = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMembership(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMembership + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ClusterMemberAttrSetRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ClusterMemberAttrSetRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ClusterMemberAttrSetRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Member_ID", wireType) + } + m.Member_ID = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Member_ID |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MemberAttributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMembership + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMembership + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.MemberAttributes == nil { + m.MemberAttributes = &Attributes{} + } + if err := m.MemberAttributes.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMembership(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthMembership + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMembership(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMembership + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMembership + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + return iNdEx, nil + case 1: + iNdEx += 8 + return iNdEx, nil + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMembership + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + iNdEx += length + if length < 0 { + return 0, ErrInvalidLengthMembership + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMembership + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + innerWire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + innerWireType := int(innerWire & 0x7) + if innerWireType == 4 { + break + } + next, err := skipMembership(dAtA[start:]) + if err != nil { + return 0, err + } + iNdEx = start + next + } + return iNdEx, nil + case 4: + return iNdEx, nil + case 5: + iNdEx += 4 + return iNdEx, nil + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + } + panic("unreachable") +} + +var ( + ErrInvalidLengthMembership = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMembership = fmt.Errorf("proto: integer overflow") +) + +func init() { proto.RegisterFile("membership.proto", fileDescriptorMembership) } + +var fileDescriptorMembership = []byte{ + // 333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x41, 0x4e, 0xc2, 0x40, + 0x14, 0x86, 0x99, 0x42, 0x08, 0x7d, 0x18, 0xc4, 0x09, 0x8b, 0x46, 0xb4, 0x92, 0xae, 0x58, 0x18, + 0x4c, 0xf4, 0x04, 0x28, 0x2c, 0x48, 0x60, 0x33, 0x46, 0xb7, 0xa4, 0x35, 0x0f, 0x6c, 0x52, 0xda, + 0xfa, 0x66, 0xea, 0xde, 0x5b, 0x78, 0x02, 0xcf, 0xc2, 0xd2, 0x23, 0x28, 0x5e, 0xc4, 0x74, 0xa6, + 0x81, 0x36, 0x71, 0xe3, 0xee, 0xe5, 0xef, 0xff, 0xbe, 0xf7, 0xff, 0xcd, 0x40, 0x77, 0x83, 0x9b, + 0x00, 0x49, 0x3e, 0x87, 0xe9, 0x28, 0xa5, 0x44, 0x25, 0xfc, 0xe8, 0xa0, 0xa4, 0xc1, 0x69, 0x6f, + 0x9d, 0xac, 0x13, 0xfd, 0xe1, 0x2a, 0x9f, 0x8c, 0xc7, 0x9b, 0x43, 0x47, 0xf8, 0x2b, 0x35, 0x56, + 0x8a, 0xc2, 0x20, 0x53, 0x28, 0x79, 0x1f, 0xec, 0x14, 0x91, 0x96, 0x19, 0x45, 0xd2, 0x61, 0x83, + 0xfa, 0xd0, 0x16, 0xad, 0x5c, 0x78, 0xa0, 0x48, 0xf2, 0x73, 0x80, 0x50, 0x2e, 0x23, 0xf4, 0x29, + 0x46, 0x72, 0xac, 0x01, 0x1b, 0xb6, 0x84, 0x1d, 0xca, 0xb9, 0x11, 0xbc, 0x31, 0x40, 0x89, 0xc4, + 0xa1, 0x11, 0xfb, 0x1b, 0x74, 0xd8, 0x80, 0x0d, 0x6d, 0xa1, 0x67, 0x7e, 0x01, 0xed, 0xa7, 0x28, + 0xc4, 0x58, 0x19, 0xbe, 0xa5, 0xf9, 0x60, 0xa4, 0xfc, 0x82, 0xf7, 0xc1, 0xa0, 0xb9, 0xd0, 0xb9, + 0x79, 0x07, 0xac, 0xd9, 0x44, 0x6f, 0x37, 0x84, 0x35, 0x9b, 0xf0, 0x29, 0x1c, 0x93, 0xbf, 0x52, + 0x4b, 0x7f, 0x7f, 0x42, 0x27, 0x68, 0x5f, 0x9f, 0x8d, 0xca, 0x4d, 0x47, 0xd5, 0x42, 0xa2, 0x43, + 0xd5, 0x82, 0x53, 0x38, 0x31, 0xf6, 0x32, 0xa8, 0xae, 0x41, 0x4e, 0x15, 0x54, 0x82, 0x14, 0x7f, + 0xf7, 0xa0, 0x78, 0x97, 0xe0, 0xdc, 0x45, 0x99, 0x54, 0x48, 0x8f, 0x48, 0x32, 0x4c, 0xe2, 0x7b, + 0x54, 0x02, 0x5f, 0x32, 0x94, 0x8a, 0x77, 0xa1, 0xfe, 0x8a, 0x54, 0x14, 0xcf, 0x47, 0xef, 0x8d, + 0x41, 0xbf, 0xb0, 0x2f, 0xf6, 0xa4, 0xd2, 0x46, 0x1f, 0xec, 0x22, 0xd4, 0xbe, 0x72, 0xcb, 0x08, + 0xba, 0xf8, 0x1f, 0x89, 0xad, 0xff, 0x26, 0xbe, 0xed, 0x6d, 0xbf, 0xdd, 0xda, 0x76, 0xe7, 0xb2, + 0xcf, 0x9d, 0xcb, 0xbe, 0x76, 0x2e, 0x7b, 0xff, 0x71, 0x6b, 0x41, 0x53, 0x3f, 0x84, 0x9b, 0xdf, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x24, 0x78, 0x39, 0x52, 0x40, 0x02, 0x00, 0x00, +} diff --git a/etcdserver/api/membership/membershippb/membership.proto b/etcdserver/api/membership/membershippb/membership.proto new file mode 100644 index 00000000000..9f555c0281d --- /dev/null +++ b/etcdserver/api/membership/membershippb/membership.proto @@ -0,0 +1,38 @@ +syntax = "proto3"; +package membershippb; + +import "gogoproto/gogo.proto"; + +option (gogoproto.marshaler_all) = true; +option (gogoproto.sizer_all) = true; +option (gogoproto.unmarshaler_all) = true; +option (gogoproto.goproto_getters_all) = false; + +// RaftAttributes represents the raft related attributes of an etcd member. +message RaftAttributes { + // peerURLs is the list of peers in the raft cluster. + repeated string peer_urls = 1; + // isLearner indicates if the member is raft learner. + bool is_learner = 2; +} + +// Attributes represents all the non-raft related attributes of an etcd member. +message Attributes { + string name = 1; + repeated string client_urls = 2; +} + +message Member { + uint64 ID = 1; + RaftAttributes raft_attributes = 2; + Attributes member_attributes = 3; +} + +message ClusterVersionSetRequest { + string ver = 1; +} + +message ClusterMemberAttrSetRequest { + uint64 member_ID = 1; + Attributes member_attributes = 2; +} diff --git a/etcdserver/etcdserverpb/raft_internal.pb.go b/etcdserver/etcdserverpb/raft_internal.pb.go index b170499e4b6..c82e7ce46dc 100644 --- a/etcdserver/etcdserverpb/raft_internal.pb.go +++ b/etcdserver/etcdserverpb/raft_internal.pb.go @@ -12,6 +12,8 @@ import ( _ "github.com/gogo/protobuf/gogoproto" + membershippb "go.etcd.io/etcd/etcdserver/api/membership/membershippb" + io "io" ) @@ -36,34 +38,36 @@ func (*RequestHeader) Descriptor() ([]byte, []int) { return fileDescriptorRaftIn // An InternalRaftRequest is the union of all requests which can be // sent via raft. type InternalRaftRequest struct { - Header *RequestHeader `protobuf:"bytes,100,opt,name=header" json:"header,omitempty"` - ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` - V2 *Request `protobuf:"bytes,2,opt,name=v2" json:"v2,omitempty"` - Range *RangeRequest `protobuf:"bytes,3,opt,name=range" json:"range,omitempty"` - Put *PutRequest `protobuf:"bytes,4,opt,name=put" json:"put,omitempty"` - DeleteRange *DeleteRangeRequest `protobuf:"bytes,5,opt,name=delete_range,json=deleteRange" json:"delete_range,omitempty"` - Txn *TxnRequest `protobuf:"bytes,6,opt,name=txn" json:"txn,omitempty"` - Compaction *CompactionRequest `protobuf:"bytes,7,opt,name=compaction" json:"compaction,omitempty"` - LeaseGrant *LeaseGrantRequest `protobuf:"bytes,8,opt,name=lease_grant,json=leaseGrant" json:"lease_grant,omitempty"` - LeaseRevoke *LeaseRevokeRequest `protobuf:"bytes,9,opt,name=lease_revoke,json=leaseRevoke" json:"lease_revoke,omitempty"` - Alarm *AlarmRequest `protobuf:"bytes,10,opt,name=alarm" json:"alarm,omitempty"` - LeaseCheckpoint *LeaseCheckpointRequest `protobuf:"bytes,11,opt,name=lease_checkpoint,json=leaseCheckpoint" json:"lease_checkpoint,omitempty"` - AuthEnable *AuthEnableRequest `protobuf:"bytes,1000,opt,name=auth_enable,json=authEnable" json:"auth_enable,omitempty"` - AuthDisable *AuthDisableRequest `protobuf:"bytes,1011,opt,name=auth_disable,json=authDisable" json:"auth_disable,omitempty"` - Authenticate *InternalAuthenticateRequest `protobuf:"bytes,1012,opt,name=authenticate" json:"authenticate,omitempty"` - AuthUserAdd *AuthUserAddRequest `protobuf:"bytes,1100,opt,name=auth_user_add,json=authUserAdd" json:"auth_user_add,omitempty"` - AuthUserDelete *AuthUserDeleteRequest `protobuf:"bytes,1101,opt,name=auth_user_delete,json=authUserDelete" json:"auth_user_delete,omitempty"` - AuthUserGet *AuthUserGetRequest `protobuf:"bytes,1102,opt,name=auth_user_get,json=authUserGet" json:"auth_user_get,omitempty"` - AuthUserChangePassword *AuthUserChangePasswordRequest `protobuf:"bytes,1103,opt,name=auth_user_change_password,json=authUserChangePassword" json:"auth_user_change_password,omitempty"` - AuthUserGrantRole *AuthUserGrantRoleRequest `protobuf:"bytes,1104,opt,name=auth_user_grant_role,json=authUserGrantRole" json:"auth_user_grant_role,omitempty"` - AuthUserRevokeRole *AuthUserRevokeRoleRequest `protobuf:"bytes,1105,opt,name=auth_user_revoke_role,json=authUserRevokeRole" json:"auth_user_revoke_role,omitempty"` - AuthUserList *AuthUserListRequest `protobuf:"bytes,1106,opt,name=auth_user_list,json=authUserList" json:"auth_user_list,omitempty"` - AuthRoleList *AuthRoleListRequest `protobuf:"bytes,1107,opt,name=auth_role_list,json=authRoleList" json:"auth_role_list,omitempty"` - AuthRoleAdd *AuthRoleAddRequest `protobuf:"bytes,1200,opt,name=auth_role_add,json=authRoleAdd" json:"auth_role_add,omitempty"` - AuthRoleDelete *AuthRoleDeleteRequest `protobuf:"bytes,1201,opt,name=auth_role_delete,json=authRoleDelete" json:"auth_role_delete,omitempty"` - AuthRoleGet *AuthRoleGetRequest `protobuf:"bytes,1202,opt,name=auth_role_get,json=authRoleGet" json:"auth_role_get,omitempty"` - AuthRoleGrantPermission *AuthRoleGrantPermissionRequest `protobuf:"bytes,1203,opt,name=auth_role_grant_permission,json=authRoleGrantPermission" json:"auth_role_grant_permission,omitempty"` - AuthRoleRevokePermission *AuthRoleRevokePermissionRequest `protobuf:"bytes,1204,opt,name=auth_role_revoke_permission,json=authRoleRevokePermission" json:"auth_role_revoke_permission,omitempty"` + Header *RequestHeader `protobuf:"bytes,100,opt,name=header" json:"header,omitempty"` + ID uint64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"` + V2 *Request `protobuf:"bytes,2,opt,name=v2" json:"v2,omitempty"` + Range *RangeRequest `protobuf:"bytes,3,opt,name=range" json:"range,omitempty"` + Put *PutRequest `protobuf:"bytes,4,opt,name=put" json:"put,omitempty"` + DeleteRange *DeleteRangeRequest `protobuf:"bytes,5,opt,name=delete_range,json=deleteRange" json:"delete_range,omitempty"` + Txn *TxnRequest `protobuf:"bytes,6,opt,name=txn" json:"txn,omitempty"` + Compaction *CompactionRequest `protobuf:"bytes,7,opt,name=compaction" json:"compaction,omitempty"` + LeaseGrant *LeaseGrantRequest `protobuf:"bytes,8,opt,name=lease_grant,json=leaseGrant" json:"lease_grant,omitempty"` + LeaseRevoke *LeaseRevokeRequest `protobuf:"bytes,9,opt,name=lease_revoke,json=leaseRevoke" json:"lease_revoke,omitempty"` + Alarm *AlarmRequest `protobuf:"bytes,10,opt,name=alarm" json:"alarm,omitempty"` + LeaseCheckpoint *LeaseCheckpointRequest `protobuf:"bytes,11,opt,name=lease_checkpoint,json=leaseCheckpoint" json:"lease_checkpoint,omitempty"` + AuthEnable *AuthEnableRequest `protobuf:"bytes,1000,opt,name=auth_enable,json=authEnable" json:"auth_enable,omitempty"` + AuthDisable *AuthDisableRequest `protobuf:"bytes,1011,opt,name=auth_disable,json=authDisable" json:"auth_disable,omitempty"` + Authenticate *InternalAuthenticateRequest `protobuf:"bytes,1012,opt,name=authenticate" json:"authenticate,omitempty"` + AuthUserAdd *AuthUserAddRequest `protobuf:"bytes,1100,opt,name=auth_user_add,json=authUserAdd" json:"auth_user_add,omitempty"` + AuthUserDelete *AuthUserDeleteRequest `protobuf:"bytes,1101,opt,name=auth_user_delete,json=authUserDelete" json:"auth_user_delete,omitempty"` + AuthUserGet *AuthUserGetRequest `protobuf:"bytes,1102,opt,name=auth_user_get,json=authUserGet" json:"auth_user_get,omitempty"` + AuthUserChangePassword *AuthUserChangePasswordRequest `protobuf:"bytes,1103,opt,name=auth_user_change_password,json=authUserChangePassword" json:"auth_user_change_password,omitempty"` + AuthUserGrantRole *AuthUserGrantRoleRequest `protobuf:"bytes,1104,opt,name=auth_user_grant_role,json=authUserGrantRole" json:"auth_user_grant_role,omitempty"` + AuthUserRevokeRole *AuthUserRevokeRoleRequest `protobuf:"bytes,1105,opt,name=auth_user_revoke_role,json=authUserRevokeRole" json:"auth_user_revoke_role,omitempty"` + AuthUserList *AuthUserListRequest `protobuf:"bytes,1106,opt,name=auth_user_list,json=authUserList" json:"auth_user_list,omitempty"` + AuthRoleList *AuthRoleListRequest `protobuf:"bytes,1107,opt,name=auth_role_list,json=authRoleList" json:"auth_role_list,omitempty"` + AuthRoleAdd *AuthRoleAddRequest `protobuf:"bytes,1200,opt,name=auth_role_add,json=authRoleAdd" json:"auth_role_add,omitempty"` + AuthRoleDelete *AuthRoleDeleteRequest `protobuf:"bytes,1201,opt,name=auth_role_delete,json=authRoleDelete" json:"auth_role_delete,omitempty"` + AuthRoleGet *AuthRoleGetRequest `protobuf:"bytes,1202,opt,name=auth_role_get,json=authRoleGet" json:"auth_role_get,omitempty"` + AuthRoleGrantPermission *AuthRoleGrantPermissionRequest `protobuf:"bytes,1203,opt,name=auth_role_grant_permission,json=authRoleGrantPermission" json:"auth_role_grant_permission,omitempty"` + AuthRoleRevokePermission *AuthRoleRevokePermissionRequest `protobuf:"bytes,1204,opt,name=auth_role_revoke_permission,json=authRoleRevokePermission" json:"auth_role_revoke_permission,omitempty"` + ClusterVersionSet *membershippb.ClusterVersionSetRequest `protobuf:"bytes,1300,opt,name=cluster_version_set,json=clusterVersionSet" json:"cluster_version_set,omitempty"` + ClusterMemberAttrSet *membershippb.ClusterMemberAttrSetRequest `protobuf:"bytes,1301,opt,name=cluster_member_attr_set,json=clusterMemberAttrSet" json:"cluster_member_attr_set,omitempty"` } func (m *InternalRaftRequest) Reset() { *m = InternalRaftRequest{} } @@ -460,6 +464,30 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) { } i += n27 } + if m.ClusterVersionSet != nil { + dAtA[i] = 0xa2 + i++ + dAtA[i] = 0x51 + i++ + i = encodeVarintRaftInternal(dAtA, i, uint64(m.ClusterVersionSet.Size())) + n28, err := m.ClusterVersionSet.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n28 + } + if m.ClusterMemberAttrSet != nil { + dAtA[i] = 0xaa + i++ + dAtA[i] = 0x51 + i++ + i = encodeVarintRaftInternal(dAtA, i, uint64(m.ClusterMemberAttrSet.Size())) + n29, err := m.ClusterMemberAttrSet.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n29 + } return i, nil } @@ -656,6 +684,14 @@ func (m *InternalRaftRequest) Size() (n int) { l = m.AuthRoleRevokePermission.Size() n += 2 + l + sovRaftInternal(uint64(l)) } + if m.ClusterVersionSet != nil { + l = m.ClusterVersionSet.Size() + n += 2 + l + sovRaftInternal(uint64(l)) + } + if m.ClusterMemberAttrSet != nil { + l = m.ClusterMemberAttrSet.Size() + n += 2 + l + sovRaftInternal(uint64(l)) + } return n } @@ -1752,6 +1788,72 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 1300: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClusterVersionSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftInternal + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClusterVersionSet == nil { + m.ClusterVersionSet = &membershippb.ClusterVersionSetRequest{} + } + if err := m.ClusterVersionSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 1301: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ClusterMemberAttrSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRaftInternal + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRaftInternal + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ClusterMemberAttrSet == nil { + m.ClusterMemberAttrSet = &membershippb.ClusterMemberAttrSetRequest{} + } + if err := m.ClusterMemberAttrSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipRaftInternal(dAtA[iNdEx:]) @@ -2068,60 +2170,66 @@ var ( func init() { proto.RegisterFile("raft_internal.proto", fileDescriptorRaftInternal) } var fileDescriptorRaftInternal = []byte{ - // 867 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x96, 0xcb, 0x52, 0x33, 0x45, - 0x14, 0xc7, 0x49, 0xb8, 0xa6, 0x13, 0x2e, 0x36, 0xa0, 0x6d, 0xa8, 0x8a, 0x10, 0xbc, 0xe0, 0x0d, - 0xad, 0xf0, 0x00, 0x1a, 0x13, 0x0a, 0xa8, 0xa2, 0x90, 0x9a, 0xc2, 0x2a, 0xab, 0x5c, 0x8c, 0xcd, - 0xcc, 0x21, 0x19, 0x99, 0xcc, 0x8c, 0x3d, 0x9d, 0x88, 0x6f, 0xe2, 0x63, 0x78, 0xdb, 0xbb, 0x65, - 0xe1, 0x05, 0xf5, 0x05, 0x14, 0x37, 0xee, 0xbf, 0xef, 0x01, 0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- 0xc9, 0x82, 0xd4, 0x93, 0xa2, 0xfe, 0x72, 0x98, 0xf5, 0xe3, 0x08, 0x11, 0xee, 0xa0, 0x9a, 0x0f, - 0x21, 0x70, 0x70, 0x95, 0xc9, 0xa2, 0x2c, 0xda, 0x2d, 0x16, 0x75, 0xa5, 0xa2, 0x60, 0x55, 0xf5, - 0xf3, 0x98, 0x30, 0xe4, 0x77, 0x11, 0x59, 0xb2, 0x19, 0x5e, 0xdd, 0x45, 0xc6, 0x90, 0xdf, 0x45, - 0xf8, 0x23, 0x84, 0xbc, 0x78, 0x90, 0x50, 0x8f, 0x8b, 0xef, 0xb7, 0x2c, 0x4b, 0x5e, 0x2b, 0x96, - 0x74, 0x4c, 0x3e, 0xab, 0x1c, 0x2b, 0xc1, 0x1f, 0xa3, 0x6a, 0x08, 0x34, 0x05, 0xb7, 0xc7, 0x68, - 0xc4, 0xc9, 0x8a, 0x8d, 0x70, 0x2e, 0x04, 0x27, 0x22, 0x6f, 0x08, 0xa1, 0x09, 0x89, 0x77, 0x56, - 0x04, 0x06, 0xa3, 0xf8, 0x16, 0x48, 0xc5, 0xf6, 0xce, 0x12, 0xe1, 0x48, 0x81, 0x79, 0xe7, 0x30, - 0x8f, 0x89, 0x63, 0xa1, 0x21, 0x65, 0x03, 0x82, 0x6c, 0xc7, 0xd2, 0x16, 0x29, 0x73, 0x2c, 0x52, - 0x88, 0x3f, 0x45, 0x1b, 0xca, 0xd6, 0xeb, 0x83, 0x77, 0x9b, 0xc4, 0x41, 0xc4, 0x49, 0x55, 0x16, - 0xbf, 0x6e, 0xb1, 0xee, 0x18, 0x51, 0x86, 0x59, 0x0f, 0x8b, 0x71, 0x7c, 0x84, 0x96, 0xfa, 0x72, - 0x86, 0x89, 0x2f, 0x31, 0x3b, 0xd6, 0x21, 0x52, 0x63, 0xee, 0x68, 0x29, 0x6e, 0xa3, 0xaa, 0x1c, - 0x61, 0x88, 0xe8, 0x75, 0x08, 0xe4, 0x7f, 0xeb, 0x09, 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 0x7e, 0xe3, 0x3d, 0x54, 0x4b, 0x83, 0x41, 0x12, 0x82, 0xcb, 0xe3, 0x5b, - 0x50, 0xb7, 0x88, 0x8a, 0x53, 0x55, 0xb1, 0x2b, 0x11, 0xfa, 0x64, 0xeb, 0xfe, 0xdf, 0xc6, 0xdc, - 0xfd, 0x63, 0xa3, 0xf4, 0xf0, 0xd8, 0x28, 0xfd, 0xf3, 0xd8, 0x28, 0x7d, 0xf7, 0x5f, 0x63, 0xee, - 0x7a, 0x49, 0xde, 0x61, 0x8e, 0x5e, 0x04, 0x00, 0x00, 0xff, 0xff, 0xed, 0x36, 0xf0, 0x6f, 0x1b, - 0x09, 0x00, 0x00, + // 961 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x96, 0x49, 0x73, 0x1b, 0x45, + 0x14, 0xc7, 0x23, 0xc5, 0x71, 0xac, 0x96, 0xed, 0x38, 0x6d, 0x87, 0x34, 0x72, 0x95, 0x70, 0x1c, + 0x96, 0xb0, 0xd9, 0x94, 0x73, 0xa5, 0x0a, 0x84, 0xe4, 0x72, 0x5c, 0x15, 0x82, 0x6b, 0x08, 0x4b, + 0x15, 0x87, 0xa1, 0x35, 0xf3, 0x22, 0x0d, 0x9e, 0x8d, 0xee, 0x96, 0x30, 0xdf, 0x03, 0xaa, 0xf8, + 0x18, 0x6c, 0x1f, 0x22, 0x07, 0x96, 0x00, 0x5f, 0x00, 0xcc, 0x85, 0x3b, 0xdc, 0xb8, 0xa4, 0x7a, + 0x99, 0x9e, 0x19, 0xa9, 0xe5, 0xdb, 0xe8, 0xff, 0xfe, 0xef, 0xf7, 0xde, 0x74, 0xbf, 0x1e, 0x35, + 0xda, 0x64, 0xf4, 0x91, 0xf0, 0xa3, 0x54, 0x00, 0x4b, 0x69, 0xbc, 0x97, 0xb3, 0x4c, 0x64, 0x78, + 0x15, 0x44, 0x10, 0x72, 0x60, 0x53, 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e7, 0x82, + 0xbf, 0xab, 0xb4, 0x9e, 0x10, 0xac, 0xc2, 0xdf, 0x0a, 0x1c, 0xc1, 0xdd, 0x6b, 0x68, 0xed, 0x30, + 0xc9, 0xc5, 0x97, 0x1e, 0xf0, 0x3c, 0x4b, 0x39, 0xec, 0xe6, 0x68, 0xfb, 0x82, 0x8f, 0x28, 0xc6, + 0x68, 0x49, 0x5d, 0x75, 0x1a, 0xea, 0xaa, 0xa3, 0x9e, 0xe5, 0x15, 0xc8, 0x7e, 0x5b, 0xcc, 0x15, + 0xa8, 0xf8, 0x8d, 0x6f, 0xa1, 0x55, 0x1e, 0x25, 0x79, 0x0c, 0xbe, 0xc8, 0x4e, 0x41, 0xdf, 0x80, + 0x5a, 0x5e, 0x5b, 0x6b, 0x0f, 0xa5, 0xf4, 0xce, 0xd6, 0xe3, 0xbf, 0xba, 0x97, 0x1e, 0x9f, 0x77, + 0x1b, 0x4f, 0xce, 0xbb, 0x8d, 0x3f, 0xcf, 0xbb, 0x8d, 0x6f, 0xfe, 0xee, 0x5e, 0x1a, 0x2e, 0xab, + 0xfb, 0xd7, 0xdd, 0xa7, 0x01, 0x00, 0x00, 0xff, 0xff, 0x39, 0xbf, 0x15, 0x6f, 0x15, 0x0a, 0x00, + 0x00, } diff --git a/etcdserver/etcdserverpb/raft_internal.proto b/etcdserver/etcdserverpb/raft_internal.proto index 7111f4572b2..341426b2e6e 100644 --- a/etcdserver/etcdserverpb/raft_internal.proto +++ b/etcdserver/etcdserverpb/raft_internal.proto @@ -4,6 +4,7 @@ package etcdserverpb; import "gogoproto/gogo.proto"; import "etcdserver.proto"; import "rpc.proto"; +import "etcd/etcdserver/api/membership/membershippb/membership.proto"; option (gogoproto.marshaler_all) = true; option (gogoproto.sizer_all) = true; @@ -58,6 +59,9 @@ message InternalRaftRequest { AuthRoleGetRequest auth_role_get = 1202; AuthRoleGrantPermissionRequest auth_role_grant_permission = 1203; AuthRoleRevokePermissionRequest auth_role_revoke_permission = 1204; + + membershippb.ClusterVersionSetRequest cluster_version_set = 1300; + membershippb.ClusterMemberAttrSetRequest cluster_member_attr_set = 1301; } message EmptyResponse { diff --git a/scripts/genproto.sh b/scripts/genproto.sh index 1dcdd992711..1e62c0fcd1e 100755 --- a/scripts/genproto.sh +++ b/scripts/genproto.sh @@ -16,7 +16,7 @@ if [[ $(protoc --version | cut -f2 -d' ') != "3.7.1" ]]; then fi # directories containing protos to be built -DIRS="./wal/walpb ./etcdserver/etcdserverpb ./etcdserver/api/snap/snappb ./raft/raftpb ./mvcc/mvccpb ./lease/leasepb ./auth/authpb ./etcdserver/api/v3lock/v3lockpb ./etcdserver/api/v3election/v3electionpb" +DIRS="./wal/walpb ./etcdserver/etcdserverpb ./etcdserver/api/snap/snappb ./raft/raftpb ./mvcc/mvccpb ./lease/leasepb ./auth/authpb ./etcdserver/api/v3lock/v3lockpb ./etcdserver/api/v3election/v3electionpb ./etcdserver/api/membership/membershippb" # disable go mod export GO111MODULE=off From 0c3401fa769eee1b8156713159b682527d52efe5 Mon Sep 17 00:00:00 2001 From: yoyinzyc Date: Tue, 26 Nov 2019 15:42:47 -0800 Subject: [PATCH 2/5] etcdserver: use V3 to update cluster version --- etcdserver/apply.go | 19 ++++++++++++++++ etcdserver/server.go | 14 ++++++------ etcdserver/server_test.go | 48 --------------------------------------- 3 files changed, 26 insertions(+), 55 deletions(-) diff --git a/etcdserver/apply.go b/etcdserver/apply.go index 822b5e32204..22e0e8543d0 100644 --- a/etcdserver/apply.go +++ b/etcdserver/apply.go @@ -21,7 +21,10 @@ import ( "sort" "time" + "github.com/coreos/go-semver/semver" "go.etcd.io/etcd/auth" + "go.etcd.io/etcd/etcdserver/api" + "go.etcd.io/etcd/etcdserver/api/membership/membershippb" pb "go.etcd.io/etcd/etcdserver/etcdserverpb" "go.etcd.io/etcd/lease" "go.etcd.io/etcd/mvcc" @@ -47,6 +50,11 @@ type applyResult struct { trace *traceutil.Trace } +// applierV3Internal is the interface for processing internal V3 raft request +type applierV3Internal interface { + ClusterVersionSet(r *membershippb.ClusterVersionSetRequest) +} + // applierV3 is the interface for processing V3 raft messages type applierV3 interface { Apply(r *pb.InternalRaftRequest) *applyResult @@ -104,6 +112,11 @@ func (s *EtcdServer) newApplierV3Backend() applierV3 { return base } +func (s *EtcdServer) newApplierV3Internal() applierV3Internal { + base := &applierV3backend{s: s} + return base +} + func (s *EtcdServer) newApplierV3() applierV3 { return newAuthApplierV3( s.AuthStore(), @@ -170,6 +183,8 @@ func (a *applierV3backend) Apply(r *pb.InternalRaftRequest) *applyResult { ar.resp, ar.err = a.s.applyV3.UserList(r.AuthUserList) case r.AuthRoleList != nil: ar.resp, ar.err = a.s.applyV3.RoleList(r.AuthRoleList) + case r.ClusterVersionSet != nil: + a.s.applyV3Internal.ClusterVersionSet(r.ClusterVersionSet) default: panic("not implemented") } @@ -833,6 +848,10 @@ func (a *applierV3backend) RoleList(r *pb.AuthRoleListRequest) (*pb.AuthRoleList return resp, err } +func (a *applierV3backend) ClusterVersionSet(r *membershippb.ClusterVersionSetRequest) { + a.s.cluster.SetVersion(semver.Must(semver.NewVersion(r.Ver)), api.UpdateCapability) +} + type quotaApplierV3 struct { applierV3 q Quota diff --git a/etcdserver/server.go b/etcdserver/server.go index 4db1998d6fc..dbcf058ee1d 100644 --- a/etcdserver/server.go +++ b/etcdserver/server.go @@ -32,6 +32,7 @@ import ( "go.etcd.io/etcd/auth" "go.etcd.io/etcd/etcdserver/api" "go.etcd.io/etcd/etcdserver/api/membership" + "go.etcd.io/etcd/etcdserver/api/membership/membershippb" "go.etcd.io/etcd/etcdserver/api/rafthttp" "go.etcd.io/etcd/etcdserver/api/snap" "go.etcd.io/etcd/etcdserver/api/v2discovery" @@ -239,7 +240,9 @@ type EtcdServer struct { applyV3 applierV3 // applyV3Base is the core applier without auth or quotas applyV3Base applierV3 - applyWait wait.WaitTime + // applyV3Internal is the applier for internal request + applyV3Internal applierV3Internal + applyWait wait.WaitTime kv mvcc.ConsistentWatchableKV lessor lease.Lessor @@ -592,6 +595,7 @@ func NewServer(cfg ServerConfig) (srv *EtcdServer, err error) { } srv.applyV3Base = srv.newApplierV3Backend() + srv.applyV3Internal = srv.newApplierV3Internal() if err = srv.restoreAlarms(); err != nil { return nil, err } @@ -2527,14 +2531,10 @@ func (s *EtcdServer) updateClusterVersion(ver string) { } } - req := pb.Request{ - Method: "PUT", - Path: membership.StoreClusterVersionKey(), - Val: ver, - } + req := membershippb.ClusterVersionSetRequest{Ver: ver} ctx, cancel := context.WithTimeout(s.ctx, s.Cfg.ReqTimeout()) - _, err := s.Do(ctx, req) + _, err := s.raftRequest(ctx, pb.InternalRaftRequest{ClusterVersionSet: &req}) cancel() switch err { diff --git a/etcdserver/server_test.go b/etcdserver/server_test.go index c6447102212..4c5d5883f0d 100644 --- a/etcdserver/server_test.go +++ b/etcdserver/server_test.go @@ -21,7 +21,6 @@ import ( "io/ioutil" "net/http" "os" - "path" "path/filepath" "reflect" "sync" @@ -1505,53 +1504,6 @@ func TestPublishRetry(t *testing.T) { <-ch } -func TestUpdateVersion(t *testing.T) { - n := newNodeRecorder() - ch := make(chan interface{}, 1) - // simulate that request has gone through consensus - ch <- Response{} - w := wait.NewWithResponse(ch) - ctx, cancel := context.WithCancel(context.TODO()) - srv := &EtcdServer{ - lgMu: new(sync.RWMutex), - lg: zap.NewExample(), - id: 1, - Cfg: ServerConfig{Logger: zap.NewExample(), TickMs: 1, SnapshotCatchUpEntries: DefaultSnapshotCatchUpEntries}, - r: *newRaftNode(raftNodeConfig{lg: zap.NewExample(), Node: n}), - attributes: membership.Attributes{Name: "node1", ClientURLs: []string{"http://node1.com"}}, - cluster: &membership.RaftCluster{}, - w: w, - reqIDGen: idutil.NewGenerator(0, time.Time{}), - SyncTicker: &time.Ticker{}, - - ctx: ctx, - cancel: cancel, - } - srv.updateClusterVersion("2.0.0") - - action := n.Action() - if len(action) != 1 { - t.Fatalf("len(action) = %d, want 1", len(action)) - } - if action[0].Name != "Propose" { - t.Fatalf("action = %s, want Propose", action[0].Name) - } - data := action[0].Params[0].([]byte) - var r pb.Request - if err := r.Unmarshal(data); err != nil { - t.Fatalf("unmarshal request error: %v", err) - } - if r.Method != "PUT" { - t.Errorf("method = %s, want PUT", r.Method) - } - if wpath := path.Join(StoreClusterPrefix, "version"); r.Path != wpath { - t.Errorf("path = %s, want %s", r.Path, wpath) - } - if r.Val != "2.0.0" { - t.Errorf("val = %s, want %s", r.Val, "2.0.0") - } -} - func TestStopNotify(t *testing.T) { s := &EtcdServer{ lgMu: new(sync.RWMutex), From 5cd2502ab15302064fc53b71a8d8174ba4f05c6f Mon Sep 17 00:00:00 2001 From: Jingyi Hu Date: Tue, 26 Nov 2019 17:44:34 -0800 Subject: [PATCH 3/5] etcdserver: use v3 to publish member attr --- etcdserver/apply.go | 14 ++++++++++ etcdserver/server.go | 63 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 76 insertions(+), 1 deletion(-) diff --git a/etcdserver/apply.go b/etcdserver/apply.go index 22e0e8543d0..006df9bc753 100644 --- a/etcdserver/apply.go +++ b/etcdserver/apply.go @@ -24,6 +24,7 @@ import ( "github.com/coreos/go-semver/semver" "go.etcd.io/etcd/auth" "go.etcd.io/etcd/etcdserver/api" + "go.etcd.io/etcd/etcdserver/api/membership" "go.etcd.io/etcd/etcdserver/api/membership/membershippb" pb "go.etcd.io/etcd/etcdserver/etcdserverpb" "go.etcd.io/etcd/lease" @@ -53,6 +54,7 @@ type applyResult struct { // applierV3Internal is the interface for processing internal V3 raft request type applierV3Internal interface { ClusterVersionSet(r *membershippb.ClusterVersionSetRequest) + ClusterMemberAttrSet(r *membershippb.ClusterMemberAttrSetRequest) } // applierV3 is the interface for processing V3 raft messages @@ -185,6 +187,8 @@ func (a *applierV3backend) Apply(r *pb.InternalRaftRequest) *applyResult { ar.resp, ar.err = a.s.applyV3.RoleList(r.AuthRoleList) case r.ClusterVersionSet != nil: a.s.applyV3Internal.ClusterVersionSet(r.ClusterVersionSet) + case r.ClusterMemberAttrSet != nil: + a.s.applyV3Internal.ClusterMemberAttrSet(r.ClusterMemberAttrSet) default: panic("not implemented") } @@ -852,6 +856,16 @@ func (a *applierV3backend) ClusterVersionSet(r *membershippb.ClusterVersionSetRe a.s.cluster.SetVersion(semver.Must(semver.NewVersion(r.Ver)), api.UpdateCapability) } +func (a *applierV3backend) ClusterMemberAttrSet(r *membershippb.ClusterMemberAttrSetRequest) { + a.s.cluster.UpdateAttributes( + types.ID(r.Member_ID), + membership.Attributes{ + Name: r.MemberAttributes.Name, + ClientURLs: r.MemberAttributes.ClientUrls, + }, + ) +} + type quotaApplierV3 struct { applierV3 q Quota diff --git a/etcdserver/server.go b/etcdserver/server.go index dbcf058ee1d..b434ea2d566 100644 --- a/etcdserver/server.go +++ b/etcdserver/server.go @@ -732,7 +732,7 @@ func (s *EtcdServer) adjustTicks() { func (s *EtcdServer) Start() { s.start() s.goAttach(func() { s.adjustTicks() }) - s.goAttach(func() { s.publish(s.Cfg.ReqTimeout()) }) + s.goAttach(func() { s.publishV3(s.Cfg.ReqTimeout()) }) s.goAttach(s.purgeFile) s.goAttach(func() { monitorFileDescriptor(s.getLogger(), s.stopping) }) s.goAttach(s.monitorVersions) @@ -1992,6 +1992,67 @@ func (s *EtcdServer) sync(timeout time.Duration) { }) } +// publishV3 registers server information into the cluster using v3 request. The +// information is the JSON representation of this server's member struct, updated +// with the static clientURLs of the server. +// The function keeps attempting to register until it succeeds, +// or its server is stopped. +func (s *EtcdServer) publishV3(timeout time.Duration) { + req := &membershippb.ClusterMemberAttrSetRequest{ + Member_ID: uint64(s.id), + MemberAttributes: &membershippb.Attributes{ + Name: s.attributes.Name, + ClientUrls: s.attributes.ClientURLs, + }, + } + + for { + select { + case <-s.stopping: + if lg := s.getLogger(); lg != nil { + lg.Warn( + "stopped publish because server is stopping", + zap.String("local-member-id", s.ID().String()), + zap.String("local-member-attributes", fmt.Sprintf("%+v", s.attributes)), + zap.Duration("publish-timeout", timeout), + ) + } + return + + default: + } + + ctx, cancel := context.WithTimeout(s.ctx, timeout) + _, err := s.raftRequest(ctx, pb.InternalRaftRequest{ClusterMemberAttrSet: req}) + cancel() + switch err { + case nil: + close(s.readych) + if lg := s.getLogger(); lg != nil { + lg.Info( + "published local member to cluster through raft", + zap.String("local-member-id", s.ID().String()), + zap.String("local-member-attributes", fmt.Sprintf("%+v", s.attributes)), + zap.String("cluster-id", s.cluster.ID().String()), + zap.Duration("publish-timeout", timeout), + ) + } + return + + default: + if lg := s.getLogger(); lg != nil { + lg.Warn( + "failed to publish local member to cluster through raft", + zap.String("local-member-id", s.ID().String()), + zap.String("local-member-attributes", fmt.Sprintf("%+v", s.attributes)), + zap.Duration("publish-timeout", timeout), + zap.Error(err), + ) + } + } + } +} + // publish registers server information into the cluster. The information // is the JSON representation of this server's member struct, updated with the // static clientURLs of the server. From ed5a01a48d4c2ae2cad071896952a0eea7c9ec8c Mon Sep 17 00:00:00 2001 From: Jingyi Hu Date: Tue, 3 Dec 2019 10:35:50 -0800 Subject: [PATCH 4/5] etcdserver: recover cluster version from backend --- clientv3/integration/kv_test.go | 2 +- etcdserver/api/membership/cluster.go | 22 +++++++++++++++++++++- integration/v3_grpc_test.go | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/clientv3/integration/kv_test.go b/clientv3/integration/kv_test.go index f4c024aed19..8ee28dd962f 100644 --- a/clientv3/integration/kv_test.go +++ b/clientv3/integration/kv_test.go @@ -893,7 +893,7 @@ func TestKVLargeRequests(t *testing.T) { expectError error }{ { - maxRequestBytesServer: 1, + maxRequestBytesServer: 256, maxCallSendBytesClient: 0, maxCallRecvBytesClient: 0, valueSize: 1024, diff --git a/etcdserver/api/membership/cluster.go b/etcdserver/api/membership/cluster.go index 137ff303895..5ca44794537 100644 --- a/etcdserver/api/membership/cluster.go +++ b/etcdserver/api/membership/cluster.go @@ -247,7 +247,7 @@ func (c *RaftCluster) Recover(onSet func(*zap.Logger, *semver.Version)) { defer c.Unlock() c.members, c.removed = membersFromStore(c.lg, c.v2store) - c.version = clusterVersionFromStore(c.lg, c.v2store) + c.version = clusterVersionFromBackend(c.lg, c.be) mustDetectDowngrade(c.lg, c.version) onSet(c.lg, c.version) @@ -753,6 +753,26 @@ func clusterVersionFromStore(lg *zap.Logger, st v2store.Store) *semver.Version { return semver.Must(semver.NewVersion(*e.Node.Value)) } +func clusterVersionFromBackend(lg *zap.Logger, be backend.Backend) *semver.Version { + ckey := backendClusterVersionKey() + tx := be.ReadTx() + tx.RLock() + defer tx.RUnlock() + keys, vals := tx.UnsafeRange(clusterBucketName, ckey, nil, 0) + if len(keys) == 0 { + return nil + } + if len(keys) != 1 { + if lg != nil { + lg.Panic( + "unexpected number of keys when getting cluster version from backend", + zap.Int("number fo keys", len(keys)), + ) + } + } + return semver.Must(semver.NewVersion(string(vals[0]))) +} + // ValidateClusterAndAssignIDs validates the local cluster by matching the PeerURLs // with the existing cluster. If the validation succeeds, it assigns the IDs // from the existing cluster to the local cluster. diff --git a/integration/v3_grpc_test.go b/integration/v3_grpc_test.go index 331f2bc6054..64b94d490ae 100644 --- a/integration/v3_grpc_test.go +++ b/integration/v3_grpc_test.go @@ -1898,7 +1898,7 @@ func TestV3LargeRequests(t *testing.T) { expectError error }{ // don't set to 0. use 0 as the default. - {1, 1024, rpctypes.ErrGRPCRequestTooLarge}, + {256, 1024, rpctypes.ErrGRPCRequestTooLarge}, {10 * 1024 * 1024, 9 * 1024 * 1024, nil}, {10 * 1024 * 1024, 10 * 1024 * 1024, rpctypes.ErrGRPCRequestTooLarge}, {10 * 1024 * 1024, 10*1024*1024 + 5, rpctypes.ErrGRPCRequestTooLarge}, From 7784ca8997b01bb39fdc9e5bbf91aa6fea81eace Mon Sep 17 00:00:00 2001 From: yoyinzyc Date: Wed, 4 Dec 2019 16:45:29 -0800 Subject: [PATCH 5/5] etcdserver: remove v2 version set; e2e: fix tests. --- etcdserver/api/membership/cluster.go | 9 +++-- etcdserver/apply_v2.go | 6 +--- etcdserver/server.go | 53 +++++++++++++--------------- tests/e2e/ctl_v3_migrate_test.go | 23 ++++++++---- 4 files changed, 48 insertions(+), 43 deletions(-) diff --git a/etcdserver/api/membership/cluster.go b/etcdserver/api/membership/cluster.go index 5ca44794537..0938c97221d 100644 --- a/etcdserver/api/membership/cluster.go +++ b/etcdserver/api/membership/cluster.go @@ -247,7 +247,12 @@ func (c *RaftCluster) Recover(onSet func(*zap.Logger, *semver.Version)) { defer c.Unlock() c.members, c.removed = membersFromStore(c.lg, c.v2store) - c.version = clusterVersionFromBackend(c.lg, c.be) + if c.be != nil { + c.version = clusterVersionFromBackend(c.lg, c.be) + } else { + c.version = clusterVersionFromStore(c.lg, c.v2store) + } + mustDetectDowngrade(c.lg, c.version) onSet(c.lg, c.version) @@ -766,7 +771,7 @@ func clusterVersionFromBackend(lg *zap.Logger, be backend.Backend) *semver.Versi if lg != nil { lg.Panic( "unexpected number of keys when getting cluster version from backend", - zap.Int("number fo keys", len(keys)), + zap.Int("number-of-key", len(keys)), ) } } diff --git a/etcdserver/apply_v2.go b/etcdserver/apply_v2.go index c77df197061..796e3806f02 100644 --- a/etcdserver/apply_v2.go +++ b/etcdserver/apply_v2.go @@ -19,12 +19,10 @@ import ( "path" "time" - "go.etcd.io/etcd/etcdserver/api" "go.etcd.io/etcd/etcdserver/api/membership" "go.etcd.io/etcd/etcdserver/api/v2store" "go.etcd.io/etcd/pkg/pbutil" - "github.com/coreos/go-semver/semver" "go.uber.org/zap" ) @@ -91,10 +89,8 @@ func (a *applierV2store) Put(r *RequestV2) Response { // return an empty response since there is no consumer. return Response{} } + // remove v2 version set to avoid the conflict between v2 and v3. if r.Path == membership.StoreClusterVersionKey() { - if a.cluster != nil { - a.cluster.SetVersion(semver.Must(semver.NewVersion(r.Val)), api.UpdateCapability) - } // return an empty response since there is no consumer. return Response{} } diff --git a/etcdserver/server.go b/etcdserver/server.go index b434ea2d566..f37a401b742 100644 --- a/etcdserver/server.go +++ b/etcdserver/server.go @@ -732,7 +732,7 @@ func (s *EtcdServer) adjustTicks() { func (s *EtcdServer) Start() { s.start() s.goAttach(func() { s.adjustTicks() }) - s.goAttach(func() { s.publishV3(s.Cfg.ReqTimeout()) }) + s.goAttach(func() { s.publish(s.Cfg.ReqTimeout()) }) s.goAttach(s.purgeFile) s.goAttach(func() { monitorFileDescriptor(s.getLogger(), s.stopping) }) s.goAttach(s.monitorVersions) @@ -1997,6 +1997,7 @@ func (s *EtcdServer) sync(timeout time.Duration) { // with the static clientURLs of the server. // The function keeps attempting to register until it succeeds, // or its server is stopped. +// TODO: replace publish() in 3.6 func (s *EtcdServer) publishV3(timeout time.Duration) { req := &membershippb.ClusterMemberAttrSetRequest{ Member_ID: uint64(s.id), @@ -2005,18 +2006,16 @@ func (s *EtcdServer) publishV3(timeout time.Duration) { ClientUrls: s.attributes.ClientURLs, }, } - + lg := s.getLogger() for { select { case <-s.stopping: - if lg := s.getLogger(); lg != nil { - lg.Warn( - "stopped publish because server is stopping", - zap.String("local-member-id", s.ID().String()), - zap.String("local-member-attributes", fmt.Sprintf("%+v", s.attributes)), - zap.Duration("publish-timeout", timeout), - ) - } + lg.Warn( + "stopped publish because server is stopping", + zap.String("local-member-id", s.ID().String()), + zap.String("local-member-attributes", fmt.Sprintf("%+v", s.attributes)), + zap.Duration("publish-timeout", timeout), + ) return default: @@ -2028,27 +2027,23 @@ func (s *EtcdServer) publishV3(timeout time.Duration) { switch err { case nil: close(s.readych) - if lg := s.getLogger(); lg != nil { - lg.Info( - "published local member to cluster through raft", - zap.String("local-member-id", s.ID().String()), - zap.String("local-member-attributes", fmt.Sprintf("%+v", s.attributes)), - zap.String("cluster-id", s.cluster.ID().String()), - zap.Duration("publish-timeout", timeout), - ) - } + lg.Info( + "published local member to cluster through raft", + zap.String("local-member-id", s.ID().String()), + zap.String("local-member-attributes", fmt.Sprintf("%+v", s.attributes)), + zap.String("cluster-id", s.cluster.ID().String()), + zap.Duration("publish-timeout", timeout), + ) return default: - if lg := s.getLogger(); lg != nil { - lg.Warn( - "failed to publish local member to cluster through raft", - zap.String("local-member-id", s.ID().String()), - zap.String("local-member-attributes", fmt.Sprintf("%+v", s.attributes)), - zap.Duration("publish-timeout", timeout), - zap.Error(err), - ) - } + lg.Warn( + "failed to publish local member to cluster through raft", + zap.String("local-member-id", s.ID().String()), + zap.String("local-member-attributes", fmt.Sprintf("%+v", s.attributes)), + zap.Duration("publish-timeout", timeout), + zap.Error(err), + ) } } } @@ -2063,7 +2058,7 @@ func (s *EtcdServer) publishV3(timeout time.Duration) { // but does not go through v2 API endpoint, which means even with v2 // client handler disabled (e.g. --enable-v2=false), cluster can still // process publish requests through rafthttp -// TODO: Deprecate v2 store +// TODO: Deprecate v2 store in 3.6 func (s *EtcdServer) publish(timeout time.Duration) { b, err := json.Marshal(s.attributes) if err != nil { diff --git a/tests/e2e/ctl_v3_migrate_test.go b/tests/e2e/ctl_v3_migrate_test.go index 1ecffe58934..6b57e94df9b 100644 --- a/tests/e2e/ctl_v3_migrate_test.go +++ b/tests/e2e/ctl_v3_migrate_test.go @@ -28,7 +28,9 @@ import ( func TestCtlV3Migrate(t *testing.T) { defer testutil.AfterTest(t) - epc := setupEtcdctlTest(t, &configNoTLS, false) + cfg := configNoTLS + cfg.enableV2 = true + epc := setupEtcdctlTest(t, &cfg, false) defer func() { if errC := epc.Close(); errC != nil { t.Fatalf("error closing etcd processes (%v)", errC) @@ -69,10 +71,6 @@ func TestCtlV3Migrate(t *testing.T) { t.Fatal(err) } - // to ensure revision increment is continuous from migrated v2 data - if err := ctlV3Put(cx, "test", "value", ""); err != nil { - t.Fatal(err) - } cli, err := clientv3.New(clientv3.Config{ Endpoints: epc.EndpointsV3(), DialTimeout: 3 * time.Second, @@ -85,11 +83,22 @@ func TestCtlV3Migrate(t *testing.T) { if err != nil { t.Fatal(err) } + revAfterMigrate := resp.Header.Revision + // to ensure revision increment is continuous from migrated v2 data + if err := ctlV3Put(cx, "test", "value", ""); err != nil { + t.Fatal(err) + } + + resp, err = cli.Get(context.TODO(), "test") + if err != nil { + t.Fatal(err) + } if len(resp.Kvs) != 1 { t.Fatalf("len(resp.Kvs) expected 1, got %+v", resp.Kvs) } - if resp.Kvs[0].CreateRevision != 7 { - t.Fatalf("resp.Kvs[0].CreateRevision expected 7, got %d", resp.Kvs[0].CreateRevision) + + if resp.Kvs[0].CreateRevision != revAfterMigrate+1 { + t.Fatalf("expected revision increment is continuous from migrated v2, got %d", resp.Kvs[0].CreateRevision) } }