Fix fake segment is never handled (#20935)

Signed-off-by: yah01 <yang.cen@zilliz.com>

Signed-off-by: yah01 <yang.cen@zilliz.com>
pull/20914/head
yah01 2022-12-01 20:03:16 +08:00 committed by GitHub
parent b238f4ee58
commit 8f449f2996
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -169,7 +169,10 @@ func (kc *Catalog) AlterSegment(ctx context.Context, newSegment *datapb.SegmentI
maps.Copy(kvs, segmentKvs)
if newSegment.State == commonpb.SegmentState_Flushed && oldSegment.State != commonpb.SegmentState_Flushed {
flushSegKey := buildFlushedSegmentPath(newSegment.GetCollectionID(), newSegment.GetPartitionID(), newSegment.GetID())
newSeg := &datapb.SegmentInfo{ID: newSegment.GetID()}
newSeg := &datapb.SegmentInfo{
ID: newSegment.GetID(),
IsFake: newSegment.GetNumOfRows() == 0,
}
segBytes, err := marshalSegmentInfo(newSeg)
if err != nil {
return err