From a937e4c232c4b329c87ebad17820f5a212501b87 Mon Sep 17 00:00:00 2001 From: congqixia Date: Sat, 23 Dec 2023 21:32:43 +0800 Subject: [PATCH] fix: segment may never get flushed if sealed before watch (#29436) See also #29092 `FlushSegments` transfer only `Growing` segment to flushing, if the segment is in `Sealed` state before Datanode watch channel, the state will never got satisfied for a segment be selected to be flushed. Signed-off-by: Congqi Xia --- internal/datanode/metacache/meta_cache.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/internal/datanode/metacache/meta_cache.go b/internal/datanode/metacache/meta_cache.go index 15e7ff5346..48bea64b1f 100644 --- a/internal/datanode/metacache/meta_cache.go +++ b/internal/datanode/metacache/meta_cache.go @@ -84,6 +84,8 @@ func (c *metaCacheImpl) init(vchannel *datapb.VchannelInfo, factory PkStatsFacto } for _, seg := range vchannel.UnflushedSegments { + // segment state could be sealed for growing segment if flush request processed before datanode watch + seg.State = commonpb.SegmentState_Growing c.segmentInfos[seg.GetID()] = NewSegmentInfo(seg, factory(seg)) } }