Skip to content

Commit

Permalink
VReplication: Handle large binlog compressed transactions more effici…
Browse files Browse the repository at this point in the history
…ently (#16328)

Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord authored Jul 10, 2024
1 parent d4e6a97 commit 979c1e6
Show file tree
Hide file tree
Showing 7 changed files with 309 additions and 139 deletions.
9 changes: 6 additions & 3 deletions go/mysql/binlog_event.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,12 @@ type BinlogEvent interface {
// IsWriteRows(), IsUpdateRows(), or IsDeleteRows() returns
// true.
Rows(BinlogFormat, *TableMap) (Rows, error)
// TransactionPayload returns a list of BinlogEvents contained
// within the compressed transaction.
TransactionPayload(BinlogFormat) ([]BinlogEvent, error)
// TransactionPayload returns a TransactionPayload type which provides
// a GetNextEvent() method to iterate over the events contained within
// the uncompressed payload. You must call Close() when you are done
// with the TransactionPayload to ensure that the underlying resources
// used are cleaned up.
TransactionPayload(BinlogFormat) (*TransactionPayload, error)
// NextLogFile returns the name of the next binary log file & pos.
// This is only valid if IsRotate() returns true
NextLogFile(BinlogFormat) (string, uint64, error)
Expand Down
2 changes: 0 additions & 2 deletions go/mysql/binlog_event_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ const (
BinlogFixedHeaderLen = 19
// The offset from 0 where the type is stored as 1 byte.
BinlogEventTypeOffset = 4
// Offset from 0 where the 4 byte length is stored.
BinlogEventLenOffset = 9
// Byte length of the checksum suffix when the CRC32 algorithm is used.
BinlogCRC32ChecksumLen = 4
)
Expand Down
Loading

0 comments on commit 979c1e6

Please sign in to comment.