fix: meta cache in datanode incorrectly tracking row nums (#29817)

... of compacted segments

issue: #29816

Signed-off-by: Buqian Zheng <zhengbuqian@gmail.com>
This commit is contained in:
Buqian Zheng 2024-01-10 13:22:48 +08:00 committed by GitHub
parent cb9d9ec0f0
commit d506d33a8d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -125,6 +125,7 @@ func (c *metaCacheImpl) CompactSegments(newSegmentID, partitionID int64, numOfRo
segmentID: newSegmentID,
partitionID: partitionID,
state: commonpb.SegmentState_Flushed,
flushedRows: numOfRows,
startPosRecorded: true,
bfs: bfs,
}

View File

@ -111,6 +111,7 @@ func (s *MetaCacheSuite) TestCompactSegments() {
for _, seg := range segs {
if seg.SegmentID() == s.newSegments[i] {
s.Equal(commonpb.SegmentState_Flushed, seg.State())
s.Equal(int64(100), seg.NumOfRows())
}
if seg.SegmentID() == s.flushedSegments[i] {
s.Equal(s.newSegments[i], seg.CompactTo())