Fix flush failure caused by empty stale segments (#18097)

/bug

issue: #18096
Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com>
This commit is contained in:
Ten Thousand Leaves 2022-07-06 18:10:21 +08:00 committed by GitHub
parent 79523ff8d4
commit d4a1e94f32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -641,7 +641,8 @@ func (s *Server) getStaleSegmentsInfo(ch string) []*SegmentInfo {
return isSegmentHealthy(info) &&
info.GetInsertChannel() == ch &&
!info.lastFlushTime.IsZero() &&
time.Since(info.lastFlushTime).Minutes() >= segmentTimedFlushDuration
time.Since(info.lastFlushTime).Minutes() >= segmentTimedFlushDuration &&
info.GetNumOfRows() != 0
})
}

View File

@ -621,8 +621,7 @@ func (node *DataNode) FlushSegments(ctx context.Context, req *datapb.FlushSegmen
log.Info("flow graph flushSegment tasks triggered",
zap.Bool("flushed", flushed),
zap.Int64("collection ID", req.GetCollectionID()),
zap.Int64s("segments", segmentIDs),
zap.Int64s("mark segments", req.GetMarkSegmentIDs()))
zap.Int64s("segments", segmentIDs))
return flushedSeg, noErr
}