Skip to content

Commit

Permalink
Fix flush failure caused by empty stale segments (#18097)
Browse files Browse the repository at this point in the history
/bug

issue: #18096
Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com>
  • Loading branch information
soothing-rain authored Jul 6, 2022
1 parent 79523ff commit d4a1e94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion internal/datacoord/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
}

Expand Down
3 changes: 1 addition & 2 deletions internal/datanode/data_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit d4a1e94

Please sign in to comment.