未验证 提交 5091a7f3 编写于 作者: S SimFG 提交者: GitHub

Add the `TotalRows` value for the DescribeIndex (#19759)

Signed-off-by: NSimFG <bang.fu@zilliz.com>
Signed-off-by: NSimFG <bang.fu@zilliz.com>
上级 857bd1fd
...@@ -616,6 +616,12 @@ func (i *IndexCoord) completeIndexInfo(ctx context.Context, indexInfo *indexpb.I ...@@ -616,6 +616,12 @@ func (i *IndexCoord) completeIndexInfo(ctx context.Context, indexInfo *indexpb.I
break break
} }
totalRow, err := calculateTotalRow()
if err != nil {
return err
}
indexInfo.TotalRows = totalRow
indexStates, indexStateCnt := i.metaTable.GetIndexStates(indexID, createTs) indexStates, indexStateCnt := i.metaTable.GetIndexStates(indexID, createTs)
allCnt := len(indexStates) allCnt := len(indexStates)
switch { switch {
...@@ -624,14 +630,11 @@ func (i *IndexCoord) completeIndexInfo(ctx context.Context, indexInfo *indexpb.I ...@@ -624,14 +630,11 @@ func (i *IndexCoord) completeIndexInfo(ctx context.Context, indexInfo *indexpb.I
indexInfo.IndexStateFailReason = indexStateCnt.FailReason indexInfo.IndexStateFailReason = indexStateCnt.FailReason
case indexStateCnt.Finished == allCnt: case indexStateCnt.Finished == allCnt:
indexInfo.State = commonpb.IndexState_Finished indexInfo.State = commonpb.IndexState_Finished
indexInfo.IndexedRows = totalRow
default: default:
indexInfo.State = commonpb.IndexState_InProgress indexInfo.State = commonpb.IndexState_InProgress
indexInfo.IndexedRows = i.metaTable.GetIndexBuildProgress(indexID, createTs) indexInfo.IndexedRows = i.metaTable.GetIndexBuildProgress(indexID, createTs)
totalRow, err := calculateTotalRow()
if err != nil {
return err
}
indexInfo.TotalRows = totalRow
} }
log.Debug("IndexCoord completeIndexInfo success", zap.Int64("collID", collectionID), log.Debug("IndexCoord completeIndexInfo success", zap.Int64("collID", collectionID),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册