From a10b7c1d9c23160068fa2799d22f41e8405a7ca4 Mon Sep 17 00:00:00 2001 From: yangxuan Date: Wed, 30 Oct 2024 17:26:00 +0800 Subject: [PATCH] fix: [cp24]l0RowCount metrics value always empty See also: #36953 pr: #37306 Signed-off-by: yangxuan --- internal/datacoord/segment_info.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/datacoord/segment_info.go b/internal/datacoord/segment_info.go index a9ac2dc671a7c..8d9f6d08bdd13 100644 --- a/internal/datacoord/segment_info.go +++ b/internal/datacoord/segment_info.go @@ -508,9 +508,10 @@ func (s *SegmentInfo) getSegmentSize() int64 { return s.size.Load() } -// getDeltaCount use cached value when segment is immutable +// L1 segment deltaCount changes in any state +// L0 segment deltaCount won't change func (s *SegmentInfo) getDeltaCount() int64 { - if s.deltaRowcount.Load() < 0 || s.State != commonpb.SegmentState_Flushed { + if s.deltaRowcount.Load() <= 0 || s.GetLevel() != datapb.SegmentLevel_L0 { var rc int64 for _, deltaLogs := range s.GetDeltalogs() { for _, l := range deltaLogs.GetBinlogs() {