Skip to content

Commit

Permalink
sink(ticdc): remove usless ReplicaID field (#6197)
Browse files Browse the repository at this point in the history
ref #5928
  • Loading branch information
hi-rustin committed Jul 6, 2022
1 parent 3054bfa commit 13264dd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 43 deletions.
1 change: 0 additions & 1 deletion cdc/model/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ type RowChangedEvent struct {

TableInfoVersion uint64 `json:"table-info-version,omitempty" msg:"table-info-version"`

ReplicaID uint64 `json:"replica-id" msg:"replica-id"`
Columns []*Column `json:"columns" msg:"-"`
PreColumns []*Column `json:"pre-columns" msg:"-"`
IndexColumns [][]int `json:"-" msg:"index-columns"`
Expand Down
35 changes: 5 additions & 30 deletions cdc/model/sink_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 3 additions & 4 deletions cdc/sink/mysql/txn_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ func (t *txnsWithTheSameCommitTs) Append(row *model.RowChangedEvent) {
var txn *model.SingleTableTxn
if len(t.txns) == 0 || row.SplitTxn || t.txns[len(t.txns)-1].StartTs < row.StartTs {
txn = &model.SingleTableTxn{
StartTs: row.StartTs,
CommitTs: row.CommitTs,
Table: row.Table,
ReplicaID: row.ReplicaID,
StartTs: row.StartTs,
CommitTs: row.CommitTs,
Table: row.Table,
}
t.txns = append(t.txns, txn)
} else if t.txns[len(t.txns)-1].StartTs == row.StartTs {
Expand Down
14 changes: 6 additions & 8 deletions cdc/sinkv2/eventsink/event_appender.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,9 @@ func (t *TxnEventAppender) Append(
// This means no txn is in the buffer.
if len(buffer) == 0 {
txn := &model.SingleTableTxn{
StartTs: row.StartTs,
CommitTs: row.CommitTs,
Table: row.Table,
ReplicaID: row.ReplicaID,
StartTs: row.StartTs,
CommitTs: row.CommitTs,
Table: row.Table,
}
txn.Append(row)
buffer = append(buffer, txn)
Expand Down Expand Up @@ -91,10 +90,9 @@ func (t *TxnEventAppender) Append(
}

buffer = append(buffer, &model.SingleTableTxn{
StartTs: row.StartTs,
CommitTs: row.CommitTs,
Table: row.Table,
ReplicaID: row.ReplicaID,
StartTs: row.StartTs,
CommitTs: row.CommitTs,
Table: row.Table,
})
}

Expand Down

0 comments on commit 13264dd

Please sign in to comment.