From 65a76b9bb5b9ac9447e087b50f38ca43b5a94e7b Mon Sep 17 00:00:00 2001 From: XuanYang-cn Date: Wed, 6 Oct 2021 22:20:05 +0800 Subject: [PATCH] [skip ci]Add comment in insertbuffernode (#9354) Signed-off-by: Yang Xuan --- internal/datanode/flow_graph_insert_buffer_node.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/datanode/flow_graph_insert_buffer_node.go b/internal/datanode/flow_graph_insert_buffer_node.go index 26b1b1d1d1..d7d2478bc4 100644 --- a/internal/datanode/flow_graph_insert_buffer_node.go +++ b/internal/datanode/flow_graph_insert_buffer_node.go @@ -204,6 +204,7 @@ func (ibNode *insertBufferNode) Operate(in []Msg) []Msg { displaySize := min(10, len(seg2Upload)) + // Log the segment statistics in mem for k, segID := range seg2Upload[:displaySize] { bd, ok := ibNode.insertBuffer.Load(segID) if !ok { @@ -349,6 +350,9 @@ func (ibNode *insertBufferNode) Operate(in []Msg) []Msg { return nil } +// updateSegStatesInReplica updates statistics in replica for the segments in insertMsgs. +// If the segment doesn't exist, a new segment will be created. +// The segment number of rows will be updated in mem, waiting to be uploaded to DataCoord. func (ibNode *insertBufferNode) updateSegStatesInReplica(insertMsgs []*msgstream.InsertMsg, startPos, endPos *internalpb.MsgPosition) (seg2Upload []UniqueID, err error) { uniqueSeg := make(map[UniqueID]int64) for _, msg := range insertMsgs {