Browse Source

etcdserverpb: make alarm memberId uint64

To be consistent with Cluster API
Anthony Romano 9 years ago
parent
commit
96ee00a322

+ 1 - 1
etcdserver/api/v3rpc/quota.go

@@ -40,7 +40,7 @@ func (qa *quotaAlarmer) check(ctx context.Context, r interface{}) error {
 		return nil
 	}
 	req := &pb.AlarmRequest{
-		MemberID: int64(qa.id),
+		MemberID: uint64(qa.id),
 		Action:   pb.AlarmRequest_ACTIVATE,
 		Alarm:    pb.AlarmType_NOSPACE,
 	}

+ 2 - 2
etcdserver/etcdserverpb/rpc.pb.go

@@ -1205,7 +1205,7 @@ func (m *DefragmentResponse) GetHeader() *ResponseHeader {
 type AlarmRequest struct {
 	Action AlarmRequest_AlarmAction `protobuf:"varint,1,opt,name=action,proto3,enum=etcdserverpb.AlarmRequest_AlarmAction" json:"action,omitempty"`
 	// MemberID is the member raising the alarm request
-	MemberID int64     `protobuf:"varint,2,opt,name=memberID,proto3" json:"memberID,omitempty"`
+	MemberID uint64    `protobuf:"varint,2,opt,name=memberID,proto3" json:"memberID,omitempty"`
 	Alarm    AlarmType `protobuf:"varint,3,opt,name=alarm,proto3,enum=etcdserverpb.AlarmType" json:"alarm,omitempty"`
 }
 
@@ -10085,7 +10085,7 @@ func (m *AlarmRequest) Unmarshal(data []byte) error {
 				}
 				b := data[iNdEx]
 				iNdEx++
-				m.MemberID |= (int64(b) & 0x7F) << shift
+				m.MemberID |= (uint64(b) & 0x7F) << shift
 				if b < 0x80 {
 					break
 				}

+ 1 - 1
etcdserver/etcdserverpb/rpc.proto

@@ -453,7 +453,7 @@ message AlarmRequest {
   }
   AlarmAction action = 1;
   // MemberID is the member raising the alarm request
-  int64 memberID = 2;
+  uint64 memberID = 2;
   AlarmType alarm = 3;
 }
 

+ 1 - 1
etcdserver/server.go

@@ -1028,7 +1028,7 @@ func (s *EtcdServer) apply(es []raftpb.Entry, confState *raftpb.ConfState) (uint
 				plog.Errorf("applying raft message exceeded backend quota")
 				go func() {
 					a := &pb.AlarmRequest{
-						MemberID: int64(s.ID()),
+						MemberID: uint64(s.ID()),
 						Action:   pb.AlarmRequest_ACTIVATE,
 						Alarm:    pb.AlarmType_NOSPACE,
 					}