From 7a98cecb34ca38cbd5ed41823355a26abd198718 Mon Sep 17 00:00:00 2001 From: Neil Shen Date: Thu, 12 May 2022 21:38:02 +0800 Subject: [PATCH] cdc: rename TableId to TableID and add Absent state Signed-off-by: Neil Shen --- cdc/scheduler/internal/tp/replication_set.go | 52 +++- .../tp/schedulepb/TableSchedule.pb.go | 272 +++++++++--------- proto/TableSchedule.proto | 52 ++-- 3 files changed, 211 insertions(+), 165 deletions(-) diff --git a/cdc/scheduler/internal/tp/replication_set.go b/cdc/scheduler/internal/tp/replication_set.go index 49a3f2bacdc..f47c8e14aae 100644 --- a/cdc/scheduler/internal/tp/replication_set.go +++ b/cdc/scheduler/internal/tp/replication_set.go @@ -14,18 +14,18 @@ package tp import ( + "fmt" + "github.com/pingcap/tiflow/cdc/model" "github.com/pingcap/tiflow/cdc/scheduler/internal/tp/schedulepb" ) // ReplicationSetState is the state of ReplicationSet in owner. // -// Absent -// │ -// v -// ┌───────────┐ -// │ Preparing │<──────┐ -// └────┬──────┘ │ +// ┌────────┐ ┌─────────┐ +// │ Absent ├─> │ Prepare │ +// └────────┘ └──┬──────┘ +// ┌──────────┘ ^ // v │ // ┌────────┐ ┌──────┴──────┐ // │ Commit ├──>│ Replicating │<── Move table @@ -33,19 +33,49 @@ import ( type ReplicationSetState int const ( - Prepare ReplicationSetState = 1 - Commit ReplicationSetState = 2 - Replicating ReplicationSetState = 3 + // Unknown means the replication state is unknown, it should not happen. + Unknown ReplicationSetState = 0 + // Absent means there is no one replicates or prepares it. + Absent ReplicationSetState = 1 + Prepare ReplicationSetState = 2 + Commit ReplicationSetState = 3 + Replicating ReplicationSetState = 4 ) +func (r ReplicationSetState) String() string { + switch r { + case Absent: + return "Absent" + case Prepare: + return "Prepare" + case Commit: + return "Commit" + case Replicating: + return "Replicating" + default: + return fmt.Sprintf("Unknown %d", r) + } +} + type ReplicationSet struct { + TableID model.TableID State ReplicationSetState Primary model.CaptureID - Secondary []model.CaptureID + Captures map[model.CaptureID]schedulepb.TableState Checkpoint model.Ts } -func newReplicationSet(tableStatus *schedulepb.TableStatus) *ReplicationSet { +func newReplicationSet( + tableStatus map[model.CaptureID]*schedulepb.TableStatus, +) *ReplicationSet { + return nil +} + +// poll transit replication state based on input and the current state. +// See ReplicationSetState's comment for the state transition. +func (r *ReplicationSet) poll( + input schedulepb.TableState, captureID model.CaptureID, +) []*schedulepb.Message { return nil } diff --git a/cdc/scheduler/internal/tp/schedulepb/TableSchedule.pb.go b/cdc/scheduler/internal/tp/schedulepb/TableSchedule.pb.go index 0bffd15c382..1d48b7fe7d8 100644 --- a/cdc/scheduler/internal/tp/schedulepb/TableSchedule.pb.go +++ b/cdc/scheduler/internal/tp/schedulepb/TableSchedule.pb.go @@ -26,42 +26,43 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package // TableState is the state of table repliction in processor. // -// ┌───────────┐ ┌──────────┐ -// │ Preparing ├─> │ Prepared ├───────┐ -// └───────────┘ └──────────┘ v -// ┌─────────────┐ -// │ Replicating │ -// └──────┬──────┘ -// ┌───────────┐ ┌──────────┐ │ -// │ Stopped │ <─┤ Stopping │ <─────┘ -// └───────────┘ └──────────┘ +// ┌────────┐ ┌───────────┐ ┌──────────┐ +// │ Absent ├─> │ Preparing ├─> │ Prepared │ +// └────────┘ └───────────┘ └─────┬────┘ +// v +// ┌─────────┐ ┌──────────┐ ┌─────────────┐ +// │ Stopped │ <─┤ Stopping │ <─┤ Replicating │ +// └─────────┘ └──────────┘ └─────────────┘ type TableState int32 const ( TableState_Unknown TableState = 0 - TableState_Preparing TableState = 1 - TableState_Prepared TableState = 2 - TableState_Replicating TableState = 3 - TableState_Stopping TableState = 4 - TableState_Stopped TableState = 5 + TableState_Absent TableState = 1 + TableState_Preparing TableState = 2 + TableState_Prepared TableState = 3 + TableState_Replicating TableState = 4 + TableState_Stopping TableState = 5 + TableState_Stopped TableState = 6 ) var TableState_name = map[int32]string{ 0: "Unknown", - 1: "Preparing", - 2: "Prepared", - 3: "Replicating", - 4: "Stopping", - 5: "Stopped", + 1: "Absent", + 2: "Preparing", + 3: "Prepared", + 4: "Replicating", + 5: "Stopping", + 6: "Stopped", } var TableState_value = map[string]int32{ "Unknown": 0, - "Preparing": 1, - "Prepared": 2, - "Replicating": 3, - "Stopping": 4, - "Stopped": 5, + "Absent": 1, + "Preparing": 2, + "Prepared": 3, + "Replicating": 4, + "Stopping": 5, + "Stopped": 6, } func (x TableState) String() string { @@ -250,7 +251,7 @@ func (m *Checkpoint) GetResolvedTs() github_com_pingcap_tiflow_cdc_model.Ts { } type AddTableRequest struct { - TableId github_com_pingcap_tiflow_cdc_model.TableID `protobuf:"varint,1,opt,name=table_id,json=tableId,proto3,casttype=github.com/pingcap/tiflow/cdc/model.TableID" json:"table_id,omitempty"` + TableID github_com_pingcap_tiflow_cdc_model.TableID `protobuf:"varint,1,opt,name=table_id,json=tableId,proto3,casttype=github.com/pingcap/tiflow/cdc/model.TableID" json:"table_id,omitempty"` IsSecondary bool `protobuf:"varint,2,opt,name=is_secondary,json=isSecondary,proto3" json:"is_secondary,omitempty"` Checkpoint *Checkpoint `protobuf:"bytes,3,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"` } @@ -288,9 +289,9 @@ func (m *AddTableRequest) XXX_DiscardUnknown() { var xxx_messageInfo_AddTableRequest proto.InternalMessageInfo -func (m *AddTableRequest) GetTableId() github_com_pingcap_tiflow_cdc_model.TableID { +func (m *AddTableRequest) GetTableID() github_com_pingcap_tiflow_cdc_model.TableID { if m != nil { - return m.TableId + return m.TableID } return 0 } @@ -310,7 +311,7 @@ func (m *AddTableRequest) GetCheckpoint() *Checkpoint { } type RemoveTableRequest struct { - TableId github_com_pingcap_tiflow_cdc_model.TableID `protobuf:"varint,1,opt,name=table_id,json=tableId,proto3,casttype=github.com/pingcap/tiflow/cdc/model.TableID" json:"table_id,omitempty"` + TableID github_com_pingcap_tiflow_cdc_model.TableID `protobuf:"varint,1,opt,name=table_id,json=tableId,proto3,casttype=github.com/pingcap/tiflow/cdc/model.TableID" json:"table_id,omitempty"` } func (m *RemoveTableRequest) Reset() { *m = RemoveTableRequest{} } @@ -346,9 +347,9 @@ func (m *RemoveTableRequest) XXX_DiscardUnknown() { var xxx_messageInfo_RemoveTableRequest proto.InternalMessageInfo -func (m *RemoveTableRequest) GetTableId() github_com_pingcap_tiflow_cdc_model.TableID { +func (m *RemoveTableRequest) GetTableID() github_com_pingcap_tiflow_cdc_model.TableID { if m != nil { - return m.TableId + return m.TableID } return 0 } @@ -414,7 +415,7 @@ func (m *DispatchTableRequest) GetRemoveTable() *RemoveTableRequest { } type AddTableResponse struct { - TableId github_com_pingcap_tiflow_cdc_model.TableID `protobuf:"varint,1,opt,name=table_id,json=tableId,proto3,casttype=github.com/pingcap/tiflow/cdc/model.TableID" json:"table_id,omitempty"` + TableID github_com_pingcap_tiflow_cdc_model.TableID `protobuf:"varint,1,opt,name=table_id,json=tableId,proto3,casttype=github.com/pingcap/tiflow/cdc/model.TableID" json:"table_id,omitempty"` IsSecondary bool `protobuf:"varint,2,opt,name=is_secondary,json=isSecondary,proto3" json:"is_secondary,omitempty"` Checkpoint *Checkpoint `protobuf:"bytes,3,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"` Reject bool `protobuf:"varint,4,opt,name=reject,proto3" json:"reject,omitempty"` @@ -453,9 +454,9 @@ func (m *AddTableResponse) XXX_DiscardUnknown() { var xxx_messageInfo_AddTableResponse proto.InternalMessageInfo -func (m *AddTableResponse) GetTableId() github_com_pingcap_tiflow_cdc_model.TableID { +func (m *AddTableResponse) GetTableID() github_com_pingcap_tiflow_cdc_model.TableID { if m != nil { - return m.TableId + return m.TableID } return 0 } @@ -482,7 +483,7 @@ func (m *AddTableResponse) GetReject() bool { } type RemoveTableResponse struct { - TableId github_com_pingcap_tiflow_cdc_model.TableID `protobuf:"varint,1,opt,name=table_id,json=tableId,proto3,casttype=github.com/pingcap/tiflow/cdc/model.TableID" json:"table_id,omitempty"` + TableID github_com_pingcap_tiflow_cdc_model.TableID `protobuf:"varint,1,opt,name=table_id,json=tableId,proto3,casttype=github.com/pingcap/tiflow/cdc/model.TableID" json:"table_id,omitempty"` Checkpoint *Checkpoint `protobuf:"bytes,2,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"` } @@ -519,9 +520,9 @@ func (m *RemoveTableResponse) XXX_DiscardUnknown() { var xxx_messageInfo_RemoveTableResponse proto.InternalMessageInfo -func (m *RemoveTableResponse) GetTableId() github_com_pingcap_tiflow_cdc_model.TableID { +func (m *RemoveTableResponse) GetTableID() github_com_pingcap_tiflow_cdc_model.TableID { if m != nil { - return m.TableId + return m.TableID } return 0 } @@ -638,7 +639,7 @@ func (m *Announce) GetOwnerRevision() *OwnerRevision { } type TableStatus struct { - TableId github_com_pingcap_tiflow_cdc_model.TableID `protobuf:"varint,1,opt,name=table_id,json=tableId,proto3,casttype=github.com/pingcap/tiflow/cdc/model.TableID" json:"table_id,omitempty"` + TableID github_com_pingcap_tiflow_cdc_model.TableID `protobuf:"varint,1,opt,name=table_id,json=tableId,proto3,casttype=github.com/pingcap/tiflow/cdc/model.TableID" json:"table_id,omitempty"` State TableState `protobuf:"varint,2,opt,name=state,proto3,enum=pingcap.tiflow.cdc.schedulepb.TableState" json:"state,omitempty"` Checkpoint *Checkpoint `protobuf:"bytes,3,opt,name=checkpoint,proto3" json:"checkpoint,omitempty"` } @@ -676,9 +677,9 @@ func (m *TableStatus) XXX_DiscardUnknown() { var xxx_messageInfo_TableStatus proto.InternalMessageInfo -func (m *TableStatus) GetTableId() github_com_pingcap_tiflow_cdc_model.TableID { +func (m *TableStatus) GetTableID() github_com_pingcap_tiflow_cdc_model.TableID { if m != nil { - return m.TableId + return m.TableID } return 0 } @@ -924,67 +925,68 @@ func init() { func init() { proto.RegisterFile("TableSchedule.proto", fileDescriptor_5b343da219629f69) } var fileDescriptor_5b343da219629f69 = []byte{ - // 955 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xfa, 0xbf, 0xdf, 0xc6, 0xce, 0x32, 0x4d, 0x5b, 0x2b, 0x80, 0x53, 0x16, 0x54, 0x82, - 0x4b, 0xd7, 0xaa, 0x8b, 0xc4, 0x11, 0xc5, 0x69, 0x24, 0x42, 0xb1, 0x5a, 0x8d, 0x5d, 0x0e, 0x5c, - 0xcc, 0x7a, 0x66, 0xba, 0x5e, 0x6a, 0xef, 0x2c, 0x3b, 0xe3, 0x44, 0xfe, 0x08, 0x5c, 0x10, 0x07, - 0x3e, 0x01, 0x47, 0xc4, 0x07, 0x41, 0xe2, 0xd2, 0x23, 0xa7, 0x08, 0x25, 0x20, 0xbe, 0x43, 0x4e, - 0x68, 0x67, 0xd7, 0xde, 0x6c, 0x63, 0x61, 0x87, 0x26, 0x87, 0xde, 0xe6, 0xed, 0xcc, 0xfb, 0xbd, - 0xf7, 0x7e, 0xf3, 0x7b, 0x6f, 0x16, 0x6e, 0xf4, 0xec, 0xc1, 0x88, 0x75, 0xc9, 0x90, 0xd1, 0xc9, - 0x88, 0x59, 0x7e, 0xc0, 0x25, 0x47, 0xef, 0xfa, 0xae, 0xe7, 0x10, 0xdb, 0xb7, 0xa4, 0xfb, 0x7c, - 0xc4, 0x8f, 0x2c, 0x42, 0x89, 0x25, 0xe2, 0x23, 0xfe, 0x60, 0x6b, 0xd3, 0xe1, 0x0e, 0x57, 0x27, - 0x9b, 0xe1, 0x2a, 0x72, 0x32, 0xef, 0x41, 0xe5, 0xc9, 0x91, 0xc7, 0x02, 0xcc, 0x0e, 0x5d, 0xe1, - 0x72, 0x0f, 0x6d, 0x41, 0x29, 0x88, 0xd7, 0x35, 0xed, 0x8e, 0xb6, 0x93, 0xc5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4e, 0xc8, 0x8b, 0x91, 0x6f, 0x7f, 0xf0, 0xdb, 0x49, 0x5d, 0x7b, - 0x79, 0x52, 0xd7, 0xfe, 0x3c, 0xa9, 0x6b, 0x3f, 0x9e, 0xd6, 0xd7, 0x5e, 0x9e, 0xd6, 0xd7, 0xfe, - 0x38, 0xad, 0xaf, 0x7d, 0x0d, 0x09, 0x89, 0x83, 0x82, 0xfa, 0xc9, 0x7f, 0xf8, 0x6f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xd8, 0x95, 0x3a, 0xce, 0x30, 0x0c, 0x00, 0x00, + // 973 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x57, 0x4f, 0x6f, 0x1b, 0x45, + 0x14, 0xcf, 0x3a, 0xfe, 0xfb, 0x36, 0x71, 0x96, 0x69, 0xda, 0x5a, 0x01, 0x9c, 0xb2, 0xa0, 0x12, + 0x5c, 0xba, 0x56, 0x5d, 0x24, 0x24, 0x2e, 0x28, 0x4e, 0x23, 0x11, 0x15, 0xab, 0xd5, 0xd8, 0xe1, + 0xc0, 0x65, 0xb5, 0x9e, 0x99, 0xae, 0x97, 0xd8, 0x3b, 0xcb, 0xce, 0x38, 0x91, 0x3f, 0x02, 0x17, + 0xc4, 0x81, 0x4f, 0xc0, 0x91, 0x2f, 0xc0, 0x57, 0xe0, 0xd8, 0x13, 0xe2, 0x14, 0xa1, 0xe4, 0xc0, + 0x11, 0xce, 0x39, 0xa1, 0x9d, 0x5d, 0x7b, 0xb3, 0x8d, 0x85, 0x1d, 0x4a, 0x38, 0x70, 0x9b, 0xe7, + 0x7d, 0xef, 0xf7, 0xde, 0xfb, 0xcd, 0xef, 0xbd, 0x91, 0xe1, 0x56, 0xcf, 0xe9, 0x0f, 0x59, 0x97, + 0x0c, 0x18, 0x1d, 0x0f, 0x99, 0x15, 0x84, 0x5c, 0x72, 0xf4, 0x76, 0xe0, 0xf9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xb8, 0xfd, 0x8a, 0x78, 0x93, 0xda, 0xbf, 0x80, 0x8d, + 0x60, 0xba, 0xf1, 0xec, 0x74, 0xd3, 0xe9, 0xad, 0x87, 0x0b, 0x32, 0x65, 0xf7, 0x24, 0xae, 0x06, + 0xd9, 0xbd, 0xf9, 0xf9, 0x55, 0x01, 0x37, 0x97, 0x16, 0x70, 0x5c, 0xdb, 0x25, 0x05, 0x1f, 0xce, + 0x55, 0x70, 0xeb, 0x3a, 0x0a, 0x4e, 0x30, 0x33, 0x12, 0xb6, 0xa1, 0xbc, 0xeb, 0xfb, 0x7c, 0xec, + 0x13, 0x76, 0x23, 0x63, 0x6c, 0xfe, 0xa9, 0x81, 0x1e, 0xbf, 0x64, 0xd2, 0x91, 0x63, 0x71, 0x53, + 0x4a, 0xf9, 0x14, 0x0a, 0x42, 0x3a, 0x32, 0x26, 0xba, 0xba, 0x50, 0x24, 0xb3, 0x8a, 0x18, 0x8e, + 0xe3, 0xfe, 0xcd, 0xa5, 0xfc, 0x83, 0x06, 0xf9, 0xee, 0xc4, 0x27, 0x37, 0xa6, 0xac, 0x36, 0x14, + 0x55, 0xdf, 0xd1, 0xb3, 0xb8, 0xba, 0xa3, 0xb7, 0x1a, 0xcb, 0x76, 0x3b, 0x16, 0x38, 0x89, 0x34, + 0x7f, 0x2f, 0x40, 0xa9, 0xc3, 0x84, 0x70, 0x5c, 0x86, 0xf6, 0xa1, 0x38, 0x60, 0x0e, 0x65, 0xe1, + 0x92, 0xe5, 0x25, 0x71, 0xd6, 0x67, 0x2a, 0x08, 0x27, 0xc1, 0x68, 0x1f, 0xca, 0x23, 0xe1, 0xda, + 0x72, 0x12, 0x4c, 0xaf, 0xa1, 0xb1, 0x1c, 0x50, 0x6f, 0x12, 0x30, 0x5c, 0x1a, 0x09, 0x37, 0x3a, + 0xa0, 0x7d, 0xc8, 0xbf, 0x08, 0xf9, 0x48, 0xdd, 0x41, 0xa5, 0xfd, 0xe8, 0xe2, 0x74, 0xfb, 0x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73, 0x3e, 0xfa, 0xdc, 0x95, 0x3c, 0x88, 0x0a, 0x35, 0x0a, 0x11, 0xa8, + 0xb2, 0x18, 0x35, 0x8a, 0x8d, 0x6f, 0x34, 0xd0, 0x2f, 0x09, 0x1b, 0x55, 0x01, 0x3a, 0xc2, 0x4d, + 0x93, 0xbe, 0x01, 0xeb, 0x1d, 0xe1, 0xa6, 0x74, 0x1a, 0x1a, 0x7a, 0x13, 0xee, 0x76, 0x84, 0x3b, + 0x4f, 0x2e, 0x46, 0x0e, 0xbd, 0x05, 0xb5, 0xab, 0x1f, 0xe3, 0x8b, 0x8c, 0x2b, 0xeb, 0x08, 0x77, + 0xca, 0xa9, 0x91, 0x8f, 0x6a, 0xe9, 0x08, 0x37, 0xe2, 0xc8, 0x28, 0xb4, 0xdf, 0xfb, 0xf9, 0xac, + 0xae, 0xbd, 0x3c, 0xab, 0x6b, 0xbf, 0x9d, 0xd5, 0xb5, 0xef, 0xce, 0xeb, 0x2b, 0x2f, 0xcf, 0xeb, + 0x2b, 0xbf, 0x9e, 0xd7, 0x57, 0xbe, 0x84, 0x94, 0xd0, 0x7e, 0x51, 0xfd, 0x4f, 0x78, 0xfc, 0x57, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x98, 0x11, 0xda, 0x1d, 0x73, 0x0c, 0x00, 0x00, } func (m *OwnerRevision) Marshal() (dAtA []byte, err error) { @@ -1120,8 +1122,8 @@ func (m *AddTableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } - if m.TableId != 0 { - i = encodeVarintTableSchedule(dAtA, i, uint64(m.TableId)) + if m.TableID != 0 { + i = encodeVarintTableSchedule(dAtA, i, uint64(m.TableID)) i-- dAtA[i] = 0x8 } @@ -1148,8 +1150,8 @@ func (m *RemoveTableRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - if m.TableId != 0 { - i = encodeVarintTableSchedule(dAtA, i, uint64(m.TableId)) + if m.TableID != 0 { + i = encodeVarintTableSchedule(dAtA, i, uint64(m.TableID)) i-- dAtA[i] = 0x8 } @@ -1267,8 +1269,8 @@ func (m *AddTableResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } - if m.TableId != 0 { - i = encodeVarintTableSchedule(dAtA, i, uint64(m.TableId)) + if m.TableID != 0 { + i = encodeVarintTableSchedule(dAtA, i, uint64(m.TableID)) i-- dAtA[i] = 0x8 } @@ -1307,8 +1309,8 @@ func (m *RemoveTableResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if m.TableId != 0 { - i = encodeVarintTableSchedule(dAtA, i, uint64(m.TableId)) + if m.TableID != 0 { + i = encodeVarintTableSchedule(dAtA, i, uint64(m.TableID)) i-- dAtA[i] = 0x8 } @@ -1446,8 +1448,8 @@ func (m *TableStatus) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x10 } - if m.TableId != 0 { - i = encodeVarintTableSchedule(dAtA, i, uint64(m.TableId)) + if m.TableID != 0 { + i = encodeVarintTableSchedule(dAtA, i, uint64(m.TableID)) i-- dAtA[i] = 0x8 } @@ -1704,8 +1706,8 @@ func (m *AddTableRequest) Size() (n int) { } var l int _ = l - if m.TableId != 0 { - n += 1 + sovTableSchedule(uint64(m.TableId)) + if m.TableID != 0 { + n += 1 + sovTableSchedule(uint64(m.TableID)) } if m.IsSecondary { n += 2 @@ -1723,8 +1725,8 @@ func (m *RemoveTableRequest) Size() (n int) { } var l int _ = l - if m.TableId != 0 { - n += 1 + sovTableSchedule(uint64(m.TableId)) + if m.TableID != 0 { + n += 1 + sovTableSchedule(uint64(m.TableID)) } return n } @@ -1756,8 +1758,8 @@ func (m *AddTableResponse) Size() (n int) { } var l int _ = l - if m.TableId != 0 { - n += 1 + sovTableSchedule(uint64(m.TableId)) + if m.TableID != 0 { + n += 1 + sovTableSchedule(uint64(m.TableID)) } if m.IsSecondary { n += 2 @@ -1778,8 +1780,8 @@ func (m *RemoveTableResponse) Size() (n int) { } var l int _ = l - if m.TableId != 0 { - n += 1 + sovTableSchedule(uint64(m.TableId)) + if m.TableID != 0 { + n += 1 + sovTableSchedule(uint64(m.TableID)) } if m.Checkpoint != nil { l = m.Checkpoint.Size() @@ -1828,8 +1830,8 @@ func (m *TableStatus) Size() (n int) { } var l int _ = l - if m.TableId != 0 { - n += 1 + sovTableSchedule(uint64(m.TableId)) + if m.TableID != 0 { + n += 1 + sovTableSchedule(uint64(m.TableID)) } if m.State != 0 { n += 1 + sovTableSchedule(uint64(m.State)) @@ -2193,9 +2195,9 @@ func (m *AddTableRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TableId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TableID", wireType) } - m.TableId = 0 + m.TableID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTableSchedule @@ -2205,7 +2207,7 @@ func (m *AddTableRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TableId |= github_com_pingcap_tiflow_cdc_model.TableID(b&0x7F) << shift + m.TableID |= github_com_pingcap_tiflow_cdc_model.TableID(b&0x7F) << shift if b < 0x80 { break } @@ -2318,9 +2320,9 @@ func (m *RemoveTableRequest) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TableId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TableID", wireType) } - m.TableId = 0 + m.TableID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTableSchedule @@ -2330,7 +2332,7 @@ func (m *RemoveTableRequest) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TableId |= github_com_pingcap_tiflow_cdc_model.TableID(b&0x7F) << shift + m.TableID |= github_com_pingcap_tiflow_cdc_model.TableID(b&0x7F) << shift if b < 0x80 { break } @@ -2545,9 +2547,9 @@ func (m *AddTableResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TableId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TableID", wireType) } - m.TableId = 0 + m.TableID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTableSchedule @@ -2557,7 +2559,7 @@ func (m *AddTableResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TableId |= github_com_pingcap_tiflow_cdc_model.TableID(b&0x7F) << shift + m.TableID |= github_com_pingcap_tiflow_cdc_model.TableID(b&0x7F) << shift if b < 0x80 { break } @@ -2690,9 +2692,9 @@ func (m *RemoveTableResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TableId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TableID", wireType) } - m.TableId = 0 + m.TableID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTableSchedule @@ -2702,7 +2704,7 @@ func (m *RemoveTableResponse) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TableId |= github_com_pingcap_tiflow_cdc_model.TableID(b&0x7F) << shift + m.TableID |= github_com_pingcap_tiflow_cdc_model.TableID(b&0x7F) << shift if b < 0x80 { break } @@ -3039,9 +3041,9 @@ func (m *TableStatus) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TableId", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field TableID", wireType) } - m.TableId = 0 + m.TableID = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTableSchedule @@ -3051,7 +3053,7 @@ func (m *TableStatus) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.TableId |= github_com_pingcap_tiflow_cdc_model.TableID(b&0x7F) << shift + m.TableID |= github_com_pingcap_tiflow_cdc_model.TableID(b&0x7F) << shift if b < 0x80 { break } diff --git a/proto/TableSchedule.proto b/proto/TableSchedule.proto index c49f6f2a620..bb8ac660120 100644 --- a/proto/TableSchedule.proto +++ b/proto/TableSchedule.proto @@ -30,14 +30,20 @@ message Checkpoint { message AddTableRequest { int64 table_id = 1 - [(gogoproto.casttype) = "github.com/pingcap/tiflow/cdc/model.TableID"]; + [ + (gogoproto.casttype) = "github.com/pingcap/tiflow/cdc/model.TableID", + (gogoproto.customname) = "TableID" + ]; bool is_secondary = 2; Checkpoint checkpoint = 3; } message RemoveTableRequest { int64 table_id = 1 - [(gogoproto.casttype) = "github.com/pingcap/tiflow/cdc/model.TableID"]; + [ + (gogoproto.casttype) = "github.com/pingcap/tiflow/cdc/model.TableID", + (gogoproto.customname) = "TableID" + ]; } message DispatchTableRequest { @@ -48,7 +54,10 @@ message DispatchTableRequest { message AddTableResponse { int64 table_id = 1 - [(gogoproto.casttype) = "github.com/pingcap/tiflow/cdc/model.TableID"]; + [ + (gogoproto.casttype) = "github.com/pingcap/tiflow/cdc/model.TableID", + (gogoproto.customname) = "TableID" + ]; bool is_secondary = 2; Checkpoint checkpoint = 3; bool reject = 4; @@ -56,7 +65,10 @@ message AddTableResponse { message RemoveTableResponse { int64 table_id = 1 - [(gogoproto.casttype) = "github.com/pingcap/tiflow/cdc/model.TableID"]; + [ + (gogoproto.casttype) = "github.com/pingcap/tiflow/cdc/model.TableID", + (gogoproto.customname) = "TableID" + ]; Checkpoint checkpoint = 2; } @@ -71,27 +83,29 @@ message Announce { OwnerRevision owner_revision = 1; } // TableState is the state of table repliction in processor. // -// ┌───────────┐ ┌──────────┐ -// │ Preparing ├─> │ Prepared ├───────┐ -// └───────────┘ └──────────┘ v -// ┌─────────────┐ -// │ Replicating │ -// └──────┬──────┘ -// ┌───────────┐ ┌──────────┐ │ -// │ Stopped │ <─┤ Stopping │ <─────┘ -// └───────────┘ └──────────┘ +// ┌────────┐ ┌───────────┐ ┌──────────┐ +// │ Absent ├─> │ Preparing ├─> │ Prepared │ +// └────────┘ └───────────┘ └─────┬────┘ +// v +// ┌─────────┐ ┌──────────┐ ┌─────────────┐ +// │ Stopped │ <─┤ Stopping │ <─┤ Replicating │ +// └─────────┘ └──────────┘ └─────────────┘ enum TableState { Unknown = 0; - Preparing = 1; - Prepared = 2; - Replicating = 3; - Stopping = 4; - Stopped = 5; + Absent = 1; + Preparing = 2; + Prepared = 3; + Replicating = 4; + Stopping = 5; + Stopped = 6; } message TableStatus { int64 table_id = 1 - [(gogoproto.casttype) = "github.com/pingcap/tiflow/cdc/model.TableID"]; + [ + (gogoproto.casttype) = "github.com/pingcap/tiflow/cdc/model.TableID", + (gogoproto.customname) = "TableID" + ]; TableState state = 2; Checkpoint checkpoint = 3; }