Skip to content

Commit

Permalink
sink: wait prepare before using Row
Browse files Browse the repository at this point in the history
Signed-off-by: Neil Shen <overvenus@gmail.com>
  • Loading branch information
overvenus committed Aug 26, 2021
1 parent ba5b0eb commit bbfda29
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cdc/processor/pipeline/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,14 @@ func (n *sinkNode) flushSink(ctx pipeline.NodeContext, resolvedTs model.Ts) (err
}

func (n *sinkNode) emitEvent(ctx pipeline.NodeContext, event *model.PolymorphicEvent) error {
if event == nil || event.Row == nil {
if event == nil {
log.Warn("skip emit empty rows", zap.Reflect("event", event))
return nil
}
if err := event.WaitPrepare(ctx); err != nil {
return err
}
if event.Row == nil {
log.Warn("skip emit empty rows", zap.Reflect("event", event))
return nil
}
Expand Down

0 comments on commit bbfda29

Please sign in to comment.