mirror of https://github.com/milvus-io/milvus.git
Add the `TotalRows` value for the DescribeIndex (#19759)
Signed-off-by: SimFG <bang.fu@zilliz.com> Signed-off-by: SimFG <bang.fu@zilliz.com>pull/19766/head
parent
857bd1fd68
commit
5091a7f362
|
@ -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
|
||||||
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),
|
||||||
|
|
Loading…
Reference in New Issue