Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: qupeng <qupeng@pingcap.com>
  • Loading branch information
hicqu committed Jun 11, 2024
1 parent 664e17a commit 955a5aa
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cdc/sinkv2/eventsink/txn/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (

"github.com/pingcap/log"
"github.com/pingcap/tiflow/cdc/contextutil"
"github.com/pingcap/tiflow/cdc/model"
"github.com/pingcap/tiflow/cdc/sinkv2/metrics/txn"
"github.com/pingcap/tiflow/cdc/sinkv2/tablesink/state"
"github.com/pingcap/tiflow/pkg/causality"
Expand Down Expand Up @@ -173,13 +174,13 @@ func (w *worker) onEvent(txn *txnEvent, postTxnExecuted func()) bool {
if conflictDetectTime > float64(60) {
now := time.Now()
// Log slow conflict detect tables every minute.
if lastLog, ok := w.lastSlowConflictDetectLog[txn.Event.PhysicalTableID]; !ok || now.Sub(lastLog) > time.Minute {
if lastLog, ok := w.lastSlowConflictDetectLog[txn.Event.TableInfo.ID]; !ok || now.Sub(lastLog) > time.Minute {
log.Warn("Transaction dmlSink finds a slow transaction in conflict detector",
zap.String("changefeedID", w.changefeed),
zap.Int("workerID", w.ID),
zap.Int64("TableID", txn.Event.PhysicalTableID),
zap.Int64("TableID", txn.Event.TableInfo.ID),
zap.Float64("seconds", conflictDetectTime))
w.lastSlowConflictDetectLog[txn.Event.PhysicalTableID] = now
w.lastSlowConflictDetectLog[txn.Event.Table.TableID] = now
}
}

Expand Down

0 comments on commit 955a5aa

Please sign in to comment.