From e40061b864de789657f02593f5aba5f1adb1fa75 Mon Sep 17 00:00:00 2001 From: xige-16 Date: Thu, 11 Aug 2022 14:06:38 +0800 Subject: [PATCH] Update binlog event format (#18347) Signed-off-by: xige-16 Signed-off-by: xige-16 --- docs/developer_guides/chap08_binlog.md | 4 ++-- internal/storage/data_codec.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/developer_guides/chap08_binlog.md b/docs/developer_guides/chap08_binlog.md index 654739a604..04ca8ce593 100644 --- a/docs/developer_guides/chap08_binlog.md +++ b/docs/developer_guides/chap08_binlog.md @@ -54,11 +54,11 @@ Binlog file consists of 4 bytes magic number and a series of events. The first e | +----------------------------+---------------------------------------------------------------------+ | | PayloadDataType 65 : 4 | data type of payload | | +----------------------------+---------------------------------------------------------------------+ +| | PostHeaderLengths n : n | header lengths for all event types | +| +----------------------------+---------------------------------------------------------------------+ | | ExtraLength 69 : 4 | length of extra information | | +----------------------------+---------------------------------------------------------------------+ | | ExtraBytes 73 : n | extra information in json format | -| +----------------------------+---------------------------------------------------------------------+ -| | PostHeaderLengths n : n | header lengths for all event types | +=====================================+=====================================================================| ``` diff --git a/internal/storage/data_codec.go b/internal/storage/data_codec.go index 0794c17a2c..237582a3a5 100644 --- a/internal/storage/data_codec.go +++ b/internal/storage/data_codec.go @@ -286,6 +286,7 @@ func (insertCodec *InsertCodec) Serialize(partitionID UniqueID, segmentID Unique startTs := ts[0] endTs := ts[len(ts)-1] + // sort insert data by rowID dataSorter := &DataSorter{ InsertCodec: insertCodec, InsertData: data,