From e7e40c2328582959430f4b82ca652e954b486eae Mon Sep 17 00:00:00 2001 From: "cai.zhang" Date: Thu, 30 Dec 2021 19:39:21 +0800 Subject: [PATCH] RootCoord should get all binlog paths for vector field (#14621) Signed-off-by: Cai.Zhang --- internal/rootcoord/root_coord.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/rootcoord/root_coord.go b/internal/rootcoord/root_coord.go index 5945315bb3..a99fe96975 100644 --- a/internal/rootcoord/root_coord.go +++ b/internal/rootcoord/root_coord.go @@ -623,12 +623,16 @@ func (c *Core) SetDataCoord(ctx context.Context, s types.DataCoord) error { if binlog.Status.ErrorCode != commonpb.ErrorCode_Success { return nil, fmt.Errorf("getInsertBinlogPaths from data service failed, error = %s", binlog.Status.Reason) } + binlogPaths := make([]string, 0) for i := range binlog.FieldIDs { if binlog.FieldIDs[i] == fieldID { - return binlog.Paths[i].Values, nil + binlogPaths = append(binlogPaths, binlog.Paths[i].Values...) } } - return nil, fmt.Errorf("binlog file does not exist, segment id = %d, field id = %d", segID, fieldID) + if len(binlogPaths) == 0 { + return nil, fmt.Errorf("binlog file does not exist, segment id = %d, field id = %d", segID, fieldID) + } + return binlogPaths, nil } c.CallGetNumRowsService = func(ctx context.Context, segID typeutil.UniqueID, isFromFlushedChan bool) (retRows int64, retErr error) {