Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions go/mysql/binlog_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ type BinlogEvent interface {

// IsPseudo is for custom implementations of GTID.
IsPseudo() bool

// IsCompressed returns true if a compressed event is found (binlog_transaction_compression=ON)
IsCompressed() bool
}

// BinlogFormat contains relevant data from the FORMAT_DESCRIPTION_EVENT.
Expand Down
5 changes: 5 additions & 0 deletions go/mysql/binlog_event_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ func (ev binlogEvent) IsPseudo() bool {
return false
}

// IsCompressed returns true if a compressed event is found (binlog_transaction_compression=ON)
func (ev binlogEvent) IsCompressed() bool {
return ev.Type() == eCompressedEvent
}

// Format implements BinlogEvent.Format().
//
// Expected format (L = total length of event data):
Expand Down
4 changes: 4 additions & 0 deletions go/mysql/binlog_event_filepos.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ func (ev filePosFakeEvent) IsPseudo() bool {
return false
}

func (ev filePosFakeEvent) IsCompressed() bool {
return false
}

//----------------------------------------------------------------------------

// filePosGTIDEvent is a fake GTID event for filePos.
Expand Down
3 changes: 3 additions & 0 deletions go/mysql/replication_constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ const (
//eViewChangeEvent = 37
//eXAPrepareLogEvent = 38

// Transaction_payload_event when binlog compression is turned on
eCompressedEvent = 40

// MariaDB specific values. They start at 160.
//eMariaAnnotateRowsEvent = 160
// Unused
Expand Down
3 changes: 3 additions & 0 deletions go/vt/vttablet/tabletserver/vstreamer/vstreamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,9 @@ func (vs *vstreamer) parseEvent(ev mysql.BinlogEvent) ([]*binlogdatapb.VEvent, e
if err != nil {
return nil, err
}
case ev.IsCompressed():
log.Errorf("VReplication does not handle binlog compression")
return nil, fmt.Errorf("VReplication does not handle binlog compression")
}
for _, vevent := range vevents {
vevent.Timestamp = int64(ev.Timestamp())
Expand Down