fix: always sync level zero segments as flushed (#29569)

See also #27675

For now, Level zero segments shall always be synced as `Flushed` ones.
This PR fixes when level zero segments selected by policies other than
flush ts policy will be synced as growing state.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2023-12-29 10:34:47 +08:00 committed by GitHub
parent a3cb8e2625
commit 55af8f611f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -403,7 +403,8 @@ func (wb *writeBufferBase) getSyncTask(ctx context.Context, segmentID int64) (sy
WithCheckpoint(wb.checkpoint).
WithBatchSize(batchSize)
if segmentInfo.State() == commonpb.SegmentState_Flushing {
if segmentInfo.State() == commonpb.SegmentState_Flushing ||
segmentInfo.Level() == datapb.SegmentLevel_L0 { // Level zero segment will always be sync as flushed
pack.WithFlush()
}