Browse Source

lease: Add and lease checkpoint protobuf types

Joe Betz 7 years ago
parent
commit
75ac18cd2d

+ 26 - 0
Documentation/dev-guide/api_reference_v3.md

@@ -476,6 +476,31 @@ Empty field.
 
 
 
 
 
 
+##### message `LeaseCheckpoint` (etcdserver/etcdserverpb/rpc.proto)
+
+| Field | Description | Type |
+| ----- | ----------- | ---- |
+| ID | ID is the lease ID to checkpoint. | int64 |
+| remaining_TTL | Remaining_TTL is the remaining time until expiry of the lease. | int64 |
+
+
+
+##### message `LeaseCheckpointRequest` (etcdserver/etcdserverpb/rpc.proto)
+
+| Field | Description | Type |
+| ----- | ----------- | ---- |
+| checkpoints |  | (slice of) LeaseCheckpoint |
+
+
+
+##### message `LeaseCheckpointResponse` (etcdserver/etcdserverpb/rpc.proto)
+
+| Field | Description | Type |
+| ----- | ----------- | ---- |
+| header |  | ResponseHeader |
+
+
+
 ##### message `LeaseGrantRequest` (etcdserver/etcdserverpb/rpc.proto)
 ##### message `LeaseGrantRequest` (etcdserver/etcdserverpb/rpc.proto)
 
 
 | Field | Description | Type |
 | Field | Description | Type |
@@ -903,6 +928,7 @@ Empty field.
 | ----- | ----------- | ---- |
 | ----- | ----------- | ---- |
 | ID |  | int64 |
 | ID |  | int64 |
 | TTL |  | int64 |
 | TTL |  | int64 |
+| RemainingTTL |  | int64 |
 
 
 
 
 
 

+ 3 - 0
etcdserver/etcdserverpb/etcdserver.pb.go

@@ -45,6 +45,9 @@
 		LeaseGrantResponse
 		LeaseGrantResponse
 		LeaseRevokeRequest
 		LeaseRevokeRequest
 		LeaseRevokeResponse
 		LeaseRevokeResponse
+		LeaseCheckpoint
+		LeaseCheckpointRequest
+		LeaseCheckpointResponse
 		LeaseKeepAliveRequest
 		LeaseKeepAliveRequest
 		LeaseKeepAliveResponse
 		LeaseKeepAliveResponse
 		LeaseTimeToLiveRequest
 		LeaseTimeToLiveRequest

+ 138 - 88
etcdserver/etcdserverpb/raft_internal.pb.go

@@ -47,6 +47,7 @@ type InternalRaftRequest struct {
 	LeaseGrant               *LeaseGrantRequest               `protobuf:"bytes,8,opt,name=lease_grant,json=leaseGrant" json:"lease_grant,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"`
 	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"`
 	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"`
 	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"`
 	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"`
 	Authenticate             *InternalAuthenticateRequest     `protobuf:"bytes,1012,opt,name=authenticate" json:"authenticate,omitempty"`
@@ -245,17 +246,27 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		}
 		}
 		i += n9
 		i += n9
 	}
 	}
+	if m.LeaseCheckpoint != nil {
+		dAtA[i] = 0x5a
+		i++
+		i = encodeVarintRaftInternal(dAtA, i, uint64(m.LeaseCheckpoint.Size()))
+		n10, err := m.LeaseCheckpoint.MarshalTo(dAtA[i:])
+		if err != nil {
+			return 0, err
+		}
+		i += n10
+	}
 	if m.Header != nil {
 	if m.Header != nil {
 		dAtA[i] = 0xa2
 		dAtA[i] = 0xa2
 		i++
 		i++
 		dAtA[i] = 0x6
 		dAtA[i] = 0x6
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.Header.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.Header.Size()))
-		n10, err := m.Header.MarshalTo(dAtA[i:])
+		n11, err := m.Header.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n10
+		i += n11
 	}
 	}
 	if m.AuthEnable != nil {
 	if m.AuthEnable != nil {
 		dAtA[i] = 0xc2
 		dAtA[i] = 0xc2
@@ -263,11 +274,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x3e
 		dAtA[i] = 0x3e
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthEnable.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthEnable.Size()))
-		n11, err := m.AuthEnable.MarshalTo(dAtA[i:])
+		n12, err := m.AuthEnable.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n11
+		i += n12
 	}
 	}
 	if m.AuthDisable != nil {
 	if m.AuthDisable != nil {
 		dAtA[i] = 0x9a
 		dAtA[i] = 0x9a
@@ -275,11 +286,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x3f
 		dAtA[i] = 0x3f
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthDisable.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthDisable.Size()))
-		n12, err := m.AuthDisable.MarshalTo(dAtA[i:])
+		n13, err := m.AuthDisable.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n12
+		i += n13
 	}
 	}
 	if m.Authenticate != nil {
 	if m.Authenticate != nil {
 		dAtA[i] = 0xa2
 		dAtA[i] = 0xa2
@@ -287,11 +298,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x3f
 		dAtA[i] = 0x3f
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.Authenticate.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.Authenticate.Size()))
-		n13, err := m.Authenticate.MarshalTo(dAtA[i:])
+		n14, err := m.Authenticate.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n13
+		i += n14
 	}
 	}
 	if m.AuthUserAdd != nil {
 	if m.AuthUserAdd != nil {
 		dAtA[i] = 0xe2
 		dAtA[i] = 0xe2
@@ -299,11 +310,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x44
 		dAtA[i] = 0x44
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserAdd.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserAdd.Size()))
-		n14, err := m.AuthUserAdd.MarshalTo(dAtA[i:])
+		n15, err := m.AuthUserAdd.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n14
+		i += n15
 	}
 	}
 	if m.AuthUserDelete != nil {
 	if m.AuthUserDelete != nil {
 		dAtA[i] = 0xea
 		dAtA[i] = 0xea
@@ -311,11 +322,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x44
 		dAtA[i] = 0x44
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserDelete.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserDelete.Size()))
-		n15, err := m.AuthUserDelete.MarshalTo(dAtA[i:])
+		n16, err := m.AuthUserDelete.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n15
+		i += n16
 	}
 	}
 	if m.AuthUserGet != nil {
 	if m.AuthUserGet != nil {
 		dAtA[i] = 0xf2
 		dAtA[i] = 0xf2
@@ -323,11 +334,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x44
 		dAtA[i] = 0x44
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserGet.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserGet.Size()))
-		n16, err := m.AuthUserGet.MarshalTo(dAtA[i:])
+		n17, err := m.AuthUserGet.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n16
+		i += n17
 	}
 	}
 	if m.AuthUserChangePassword != nil {
 	if m.AuthUserChangePassword != nil {
 		dAtA[i] = 0xfa
 		dAtA[i] = 0xfa
@@ -335,11 +346,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x44
 		dAtA[i] = 0x44
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserChangePassword.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserChangePassword.Size()))
-		n17, err := m.AuthUserChangePassword.MarshalTo(dAtA[i:])
+		n18, err := m.AuthUserChangePassword.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n17
+		i += n18
 	}
 	}
 	if m.AuthUserGrantRole != nil {
 	if m.AuthUserGrantRole != nil {
 		dAtA[i] = 0x82
 		dAtA[i] = 0x82
@@ -347,11 +358,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x45
 		dAtA[i] = 0x45
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserGrantRole.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserGrantRole.Size()))
-		n18, err := m.AuthUserGrantRole.MarshalTo(dAtA[i:])
+		n19, err := m.AuthUserGrantRole.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n18
+		i += n19
 	}
 	}
 	if m.AuthUserRevokeRole != nil {
 	if m.AuthUserRevokeRole != nil {
 		dAtA[i] = 0x8a
 		dAtA[i] = 0x8a
@@ -359,11 +370,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x45
 		dAtA[i] = 0x45
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserRevokeRole.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserRevokeRole.Size()))
-		n19, err := m.AuthUserRevokeRole.MarshalTo(dAtA[i:])
+		n20, err := m.AuthUserRevokeRole.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n19
+		i += n20
 	}
 	}
 	if m.AuthUserList != nil {
 	if m.AuthUserList != nil {
 		dAtA[i] = 0x92
 		dAtA[i] = 0x92
@@ -371,11 +382,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x45
 		dAtA[i] = 0x45
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserList.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthUserList.Size()))
-		n20, err := m.AuthUserList.MarshalTo(dAtA[i:])
+		n21, err := m.AuthUserList.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n20
+		i += n21
 	}
 	}
 	if m.AuthRoleList != nil {
 	if m.AuthRoleList != nil {
 		dAtA[i] = 0x9a
 		dAtA[i] = 0x9a
@@ -383,11 +394,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x45
 		dAtA[i] = 0x45
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleList.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleList.Size()))
-		n21, err := m.AuthRoleList.MarshalTo(dAtA[i:])
+		n22, err := m.AuthRoleList.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n21
+		i += n22
 	}
 	}
 	if m.AuthRoleAdd != nil {
 	if m.AuthRoleAdd != nil {
 		dAtA[i] = 0x82
 		dAtA[i] = 0x82
@@ -395,11 +406,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x4b
 		dAtA[i] = 0x4b
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleAdd.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleAdd.Size()))
-		n22, err := m.AuthRoleAdd.MarshalTo(dAtA[i:])
+		n23, err := m.AuthRoleAdd.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n22
+		i += n23
 	}
 	}
 	if m.AuthRoleDelete != nil {
 	if m.AuthRoleDelete != nil {
 		dAtA[i] = 0x8a
 		dAtA[i] = 0x8a
@@ -407,11 +418,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x4b
 		dAtA[i] = 0x4b
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleDelete.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleDelete.Size()))
-		n23, err := m.AuthRoleDelete.MarshalTo(dAtA[i:])
+		n24, err := m.AuthRoleDelete.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n23
+		i += n24
 	}
 	}
 	if m.AuthRoleGet != nil {
 	if m.AuthRoleGet != nil {
 		dAtA[i] = 0x92
 		dAtA[i] = 0x92
@@ -419,11 +430,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x4b
 		dAtA[i] = 0x4b
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleGet.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleGet.Size()))
-		n24, err := m.AuthRoleGet.MarshalTo(dAtA[i:])
+		n25, err := m.AuthRoleGet.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n24
+		i += n25
 	}
 	}
 	if m.AuthRoleGrantPermission != nil {
 	if m.AuthRoleGrantPermission != nil {
 		dAtA[i] = 0x9a
 		dAtA[i] = 0x9a
@@ -431,11 +442,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x4b
 		dAtA[i] = 0x4b
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleGrantPermission.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleGrantPermission.Size()))
-		n25, err := m.AuthRoleGrantPermission.MarshalTo(dAtA[i:])
+		n26, err := m.AuthRoleGrantPermission.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n25
+		i += n26
 	}
 	}
 	if m.AuthRoleRevokePermission != nil {
 	if m.AuthRoleRevokePermission != nil {
 		dAtA[i] = 0xa2
 		dAtA[i] = 0xa2
@@ -443,11 +454,11 @@ func (m *InternalRaftRequest) MarshalTo(dAtA []byte) (int, error) {
 		dAtA[i] = 0x4b
 		dAtA[i] = 0x4b
 		i++
 		i++
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleRevokePermission.Size()))
 		i = encodeVarintRaftInternal(dAtA, i, uint64(m.AuthRoleRevokePermission.Size()))
-		n26, err := m.AuthRoleRevokePermission.MarshalTo(dAtA[i:])
+		n27, err := m.AuthRoleRevokePermission.MarshalTo(dAtA[i:])
 		if err != nil {
 		if err != nil {
 			return 0, err
 			return 0, err
 		}
 		}
-		i += n26
+		i += n27
 	}
 	}
 	return i, nil
 	return i, nil
 }
 }
@@ -573,6 +584,10 @@ func (m *InternalRaftRequest) Size() (n int) {
 		l = m.Alarm.Size()
 		l = m.Alarm.Size()
 		n += 1 + l + sovRaftInternal(uint64(l))
 		n += 1 + l + sovRaftInternal(uint64(l))
 	}
 	}
+	if m.LeaseCheckpoint != nil {
+		l = m.LeaseCheckpoint.Size()
+		n += 1 + l + sovRaftInternal(uint64(l))
+	}
 	if m.Header != nil {
 	if m.Header != nil {
 		l = m.Header.Size()
 		l = m.Header.Size()
 		n += 2 + l + sovRaftInternal(uint64(l))
 		n += 2 + l + sovRaftInternal(uint64(l))
@@ -1143,6 +1158,39 @@ func (m *InternalRaftRequest) Unmarshal(dAtA []byte) error {
 				return err
 				return err
 			}
 			}
 			iNdEx = postIndex
 			iNdEx = postIndex
+		case 11:
+			if wireType != 2 {
+				return fmt.Errorf("proto: wrong wireType = %d for field LeaseCheckpoint", 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.LeaseCheckpoint == nil {
+				m.LeaseCheckpoint = &LeaseCheckpointRequest{}
+			}
+			if err := m.LeaseCheckpoint.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
+				return err
+			}
+			iNdEx = postIndex
 		case 100:
 		case 100:
 			if wireType != 2 {
 			if wireType != 2 {
 				return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
 				return fmt.Errorf("proto: wrong wireType = %d for field Header", wireType)
@@ -2020,58 +2068,60 @@ var (
 func init() { proto.RegisterFile("raft_internal.proto", fileDescriptorRaftInternal) }
 func init() { proto.RegisterFile("raft_internal.proto", fileDescriptorRaftInternal) }
 
 
 var fileDescriptorRaftInternal = []byte{
 var fileDescriptorRaftInternal = []byte{
-	// 837 bytes of a gzipped FileDescriptorProto
-	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x96, 0xdd, 0x52, 0xd3, 0x40,
-	0x14, 0xc7, 0x69, 0xf9, 0xec, 0xb6, 0x54, 0x5c, 0x40, 0xd7, 0x32, 0x53, 0xa1, 0x8c, 0x8a, 0x5f,
-	0xe8, 0x94, 0x07, 0xd0, 0x4a, 0x19, 0x60, 0x86, 0x61, 0x98, 0x0c, 0xce, 0x38, 0xe3, 0x45, 0x5c,
-	0x9a, 0x43, 0x1b, 0x49, 0x93, 0xb8, 0xd9, 0x56, 0x7c, 0x13, 0x1f, 0xc3, 0xaf, 0x87, 0xe0, 0xc2,
-	0x0f, 0xd4, 0x17, 0x50, 0xbc, 0xf1, 0xca, 0x1b, 0x7d, 0x00, 0x67, 0x3f, 0x92, 0x34, 0x6d, 0xca,
-	0x5d, 0x72, 0xce, 0xff, 0xfc, 0xce, 0xd9, 0xec, 0x7f, 0xbb, 0x45, 0xb3, 0x8c, 0x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95,
-	0x47, 0x0e, 0x26, 0xe4, 0x5f, 0x8e, 0xb5, 0xff, 0x01, 0x00, 0x00, 0xff, 0xff, 0xff, 0xc9, 0xfc,
-	0x0e, 0xca, 0x08, 0x00, 0x00,
+	// 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, 0xbe, 0xea, 0xcb, 0xf4, 0x64, 0x92,
+	0x0e, 0xbb, 0xc9, 0x39, 0xff, 0xf3, 0xfb, 0x9f, 0x99, 0x3e, 0x07, 0x1a, 0x6d, 0x32, 0x7a, 0xc3,
+	0xdd, 0x20, 0xe2, 0xc0, 0x22, 0x1a, 0x1e, 0x26, 0x2c, 0xe6, 0x31, 0xae, 0x01, 0xf7, 0xfc, 0x14,
+	0xd8, 0x08, 0x58, 0x72, 0x5d, 0xdf, 0xea, 0xc5, 0xbd, 0x58, 0x26, 0x3e, 0x10, 0x4f, 0x4a, 0x53,
+	0xdf, 0xc8, 0x35, 0x3a, 0x52, 0x61, 0x89, 0xa7, 0x1e, 0x9b, 0x5f, 0xa2, 0x55, 0x07, 0xbe, 0x1e,
+	0x42, 0xca, 0x4f, 0x81, 0xfa, 0xc0, 0xf0, 0x1a, 0x2a, 0x9f, 0x75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x22, 0x45, 0x95, 0x65, 0x22, 0xf3, 0x70, 0xb1, 0x2d,
+	0x31, 0x91, 0x3f, 0x3e, 0xd9, 0xd6, 0xe4, 0x44, 0xea, 0x18, 0xfe, 0x0a, 0xd5, 0xc7, 0x30, 0x72,
+	0x50, 0x12, 0x60, 0x83, 0x20, 0x95, 0xff, 0x18, 0x7f, 0x52, 0xcc, 0xf7, 0x66, 0x30, 0x85, 0xfc,
+	0xd2, 0xa8, 0x33, 0xfe, 0x2b, 0xd4, 0x9e, 0xc7, 0x03, 0xb4, 0x93, 0x7b, 0xe9, 0xd1, 0x19, 0x33,
+	0xfb, 0x59, 0x99, 0xbd, 0x6f, 0x37, 0x53, 0x53, 0x32, 0xed, 0x46, 0xe8, 0x0c, 0x41, 0x73, 0x1d,
+	0xad, 0x1e, 0x0f, 0x12, 0xfe, 0xad, 0x03, 0x69, 0x12, 0x47, 0x29, 0x34, 0x13, 0xb4, 0xf3, 0xc4,
+	0x1f, 0x22, 0x8c, 0xd1, 0x82, 0xbc, 0x2e, 0x94, 0xe4, 0x75, 0x41, 0x3e, 0x8b, 0x6b, 0x84, 0xd9,
+	0x4f, 0x7d, 0x8d, 0xc8, 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,
 }
 }

+ 2 - 1
etcdserver/etcdserverpb/raft_internal.proto

@@ -37,6 +37,8 @@ message InternalRaftRequest {
 
 
   AlarmRequest alarm = 10;
   AlarmRequest alarm = 10;
 
 
+  LeaseCheckpointRequest lease_checkpoint = 11;
+
   AuthEnableRequest auth_enable = 1000;
   AuthEnableRequest auth_enable = 1000;
   AuthDisableRequest auth_disable = 1011;
   AuthDisableRequest auth_disable = 1011;
 
 
@@ -71,4 +73,3 @@ message InternalAuthenticateRequest {
   // simple_token is generated in API layer (etcdserver/v3_server.go)
   // simple_token is generated in API layer (etcdserver/v3_server.go)
   string simple_token = 3;
   string simple_token = 3;
 }
 }
-

File diff suppressed because it is too large
+ 251 - 104
etcdserver/etcdserverpb/rpc.pb.go


+ 16 - 0
etcdserver/etcdserverpb/rpc.proto

@@ -776,6 +776,22 @@ message LeaseRevokeResponse {
   ResponseHeader header = 1;
   ResponseHeader header = 1;
 }
 }
 
 
+message LeaseCheckpoint {
+    // ID is the lease ID to checkpoint.
+  int64 ID = 1;
+
+  // Remaining_TTL is the remaining time until expiry of the lease.
+  int64 remaining_TTL = 2;
+}
+
+message LeaseCheckpointRequest {
+  repeated LeaseCheckpoint checkpoints = 1;
+}
+
+message LeaseCheckpointResponse {
+  ResponseHeader header = 1;
+}
+
 message LeaseKeepAliveRequest {
 message LeaseKeepAliveRequest {
   // ID is the lease ID for the lease to keep alive.
   // ID is the lease ID for the lease to keep alive.
   int64 ID = 1;
   int64 ID = 1;

+ 42 - 13
lease/leasepb/lease.pb.go

@@ -40,8 +40,9 @@ var _ = math.Inf
 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
 const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package
 
 
 type Lease struct {
 type Lease struct {
-	ID  int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
-	TTL int64 `protobuf:"varint,2,opt,name=TTL,proto3" json:"TTL,omitempty"`
+	ID           int64 `protobuf:"varint,1,opt,name=ID,proto3" json:"ID,omitempty"`
+	TTL          int64 `protobuf:"varint,2,opt,name=TTL,proto3" json:"TTL,omitempty"`
+	RemainingTTL int64 `protobuf:"varint,3,opt,name=RemainingTTL,proto3" json:"RemainingTTL,omitempty"`
 }
 }
 
 
 func (m *Lease) Reset()                    { *m = Lease{} }
 func (m *Lease) Reset()                    { *m = Lease{} }
@@ -97,6 +98,11 @@ func (m *Lease) MarshalTo(dAtA []byte) (int, error) {
 		i++
 		i++
 		i = encodeVarintLease(dAtA, i, uint64(m.TTL))
 		i = encodeVarintLease(dAtA, i, uint64(m.TTL))
 	}
 	}
+	if m.RemainingTTL != 0 {
+		dAtA[i] = 0x18
+		i++
+		i = encodeVarintLease(dAtA, i, uint64(m.RemainingTTL))
+	}
 	return i, nil
 	return i, nil
 }
 }
 
 
@@ -174,6 +180,9 @@ func (m *Lease) Size() (n int) {
 	if m.TTL != 0 {
 	if m.TTL != 0 {
 		n += 1 + sovLease(uint64(m.TTL))
 		n += 1 + sovLease(uint64(m.TTL))
 	}
 	}
+	if m.RemainingTTL != 0 {
+		n += 1 + sovLease(uint64(m.RemainingTTL))
+	}
 	return n
 	return n
 }
 }
 
 
@@ -277,6 +286,25 @@ func (m *Lease) Unmarshal(dAtA []byte) error {
 					break
 					break
 				}
 				}
 			}
 			}
+		case 3:
+			if wireType != 0 {
+				return fmt.Errorf("proto: wrong wireType = %d for field RemainingTTL", wireType)
+			}
+			m.RemainingTTL = 0
+			for shift := uint(0); ; shift += 7 {
+				if shift >= 64 {
+					return ErrIntOverflowLease
+				}
+				if iNdEx >= l {
+					return io.ErrUnexpectedEOF
+				}
+				b := dAtA[iNdEx]
+				iNdEx++
+				m.RemainingTTL |= (int64(b) & 0x7F) << shift
+				if b < 0x80 {
+					break
+				}
+			}
 		default:
 		default:
 			iNdEx = preIndex
 			iNdEx = preIndex
 			skippy, err := skipLease(dAtA[iNdEx:])
 			skippy, err := skipLease(dAtA[iNdEx:])
@@ -572,20 +600,21 @@ var (
 func init() { proto.RegisterFile("lease.proto", fileDescriptorLease) }
 func init() { proto.RegisterFile("lease.proto", fileDescriptorLease) }
 
 
 var fileDescriptorLease = []byte{
 var fileDescriptorLease = []byte{
-	// 233 bytes of a gzipped FileDescriptorProto
+	// 253 bytes of a gzipped FileDescriptorProto
 	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xce, 0x49, 0x4d, 0x2c,
 	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0xce, 0x49, 0x4d, 0x2c,
 	0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x07, 0x73, 0x0a, 0x92, 0xa4, 0x44, 0xd2,
 	0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0x07, 0x73, 0x0a, 0x92, 0xa4, 0x44, 0xd2,
 	0xf3, 0xd3, 0xf3, 0xc1, 0x62, 0xfa, 0x20, 0x16, 0x44, 0x5a, 0x4a, 0x2d, 0xb5, 0x24, 0x39, 0x45,
 	0xf3, 0xd3, 0xf3, 0xc1, 0x62, 0xfa, 0x20, 0x16, 0x44, 0x5a, 0x4a, 0x2d, 0xb5, 0x24, 0x39, 0x45,
 	0x1f, 0x44, 0x14, 0xa7, 0x16, 0x95, 0xa5, 0x16, 0x21, 0x31, 0x0b, 0x92, 0xf4, 0x8b, 0x0a, 0x92,
 	0x1f, 0x44, 0x14, 0xa7, 0x16, 0x95, 0xa5, 0x16, 0x21, 0x31, 0x0b, 0x92, 0xf4, 0x8b, 0x0a, 0x92,
-	0x21, 0xea, 0x94, 0x34, 0xb9, 0x58, 0x7d, 0x40, 0x06, 0x09, 0xf1, 0x71, 0x31, 0x79, 0xba, 0x48,
+	0x21, 0xea, 0x94, 0x7c, 0xb9, 0x58, 0x7d, 0x40, 0x06, 0x09, 0xf1, 0x71, 0x31, 0x79, 0xba, 0x48,
 	0x30, 0x2a, 0x30, 0x6a, 0x30, 0x07, 0x31, 0x79, 0xba, 0x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0a, 0x45, 0x4c, 0xa9, 0x84, 0x4b, 0x04, 0x6c, 0x9c,
+	0x67, 0x5e, 0x49, 0x6a, 0x51, 0x5e, 0x62, 0x4e, 0x50, 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x89, 0x50,
+	0x0c, 0x97, 0x18, 0x58, 0x3c, 0x24, 0x33, 0x37, 0x35, 0x24, 0xdf, 0x27, 0xb3, 0x2c, 0x15, 0x2a,
+	0x03, 0xb6, 0x91, 0xdb, 0x48, 0x45, 0x0f, 0xd9, 0x7d, 0x7a, 0xd8, 0xd5, 0x06, 0xe1, 0x30, 0x43,
+	0xa9, 0x82, 0x4b, 0x14, 0xcd, 0xd6, 0xe2, 0x82, 0xfc, 0xbc, 0xe2, 0x54, 0xa1, 0x78, 0x2e, 0x71,
+	0x0c, 0x2d, 0x10, 0x29, 0xa8, 0xbd, 0xaa, 0x04, 0xec, 0x85, 0x28, 0x0e, 0xc2, 0x65, 0x8a, 0x93,
+	0xc4, 0x89, 0x87, 0x72, 0x0c, 0x17, 0x1e, 0xca, 0x31, 0x9c, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91,
+	0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x33, 0x1e, 0xcb, 0x31, 0x24, 0xb1, 0x81, 0xc3, 0xd7, 0x18,
+	0x10, 0x00, 0x00, 0xff, 0xff, 0xa9, 0x9f, 0x8b, 0x6c, 0xb5, 0x01, 0x00, 0x00,
 }
 }

+ 1 - 0
lease/leasepb/lease.proto

@@ -13,6 +13,7 @@ option (gogoproto.goproto_enum_prefix_all) = false;
 message Lease {
 message Lease {
   int64 ID = 1;
   int64 ID = 1;
   int64 TTL = 2;
   int64 TTL = 2;
+  int64 RemainingTTL = 3;
 }
 }
 
 
 message LeaseInternalRequest {
 message LeaseInternalRequest {

Some files were not shown because too many files changed in this diff