Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request vitessio#5966 from planetscale/skip_rds_special_ev…
Browse files Browse the repository at this point in the history
…ents

Skip any binlog events with DML related to the "mysql.rds_*" special
  • Loading branch information
sougou authored Apr 1, 2020
2 parents f2ce6ce + c656157 commit 9271419
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions go/vt/vttablet/tabletmanager/vreplication/vplayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"fmt"
"io"
"math"
"strings"
"time"

"golang.org/x/net/context"
Expand Down Expand Up @@ -419,15 +420,18 @@ func (vp *vplayer) applyEvent(ctx context.Context, event *binlogdatapb.VEvent, m
stats.Send(fmt.Sprintf("%v", event.FieldEvent))

case binlogdatapb.VEventType_INSERT, binlogdatapb.VEventType_DELETE, binlogdatapb.VEventType_UPDATE, binlogdatapb.VEventType_REPLACE:
// This is a player using stament based replication
if err := vp.vr.dbClient.Begin(); err != nil {
return err
}
// If the event is for one of the AWS RDS "special" tables, we skip
if !strings.Contains(event.Dml, " mysql.rds_") {
// This is a player using stament based replication
if err := vp.vr.dbClient.Begin(); err != nil {
return err
}

if err := vp.applyStmtEvent(ctx, event); err != nil {
return err
if err := vp.applyStmtEvent(ctx, event); err != nil {
return err
}
stats.Send(fmt.Sprintf(event.Dml))
}
stats.Send(fmt.Sprintf(event.Dml))
case binlogdatapb.VEventType_ROW:
// This player is configured for row based replication
if err := vp.vr.dbClient.Begin(); err != nil {
Expand Down

0 comments on commit 9271419

Please sign in to comment.