Skip to content

Commit

Permalink
enhance: Make sure every segment only trigger flush task once by chan…
Browse files Browse the repository at this point in the history
…nel.flushTs. (#33034)

Signed-off-by: aoiasd <[email protected]>
  • Loading branch information
aoiasd committed May 17, 2024
1 parent bbf3a27 commit 62848d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/datanode/segment_sync_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func syncSegmentsAtTs() segmentSyncPolicy {
flushTs := c.getFlushTs()
if flushTs != 0 && ts >= flushTs {
segmentsWithBuffer := lo.Filter(segments, func(segment *Segment, _ int) bool {
return !segment.isBufferEmpty()
return !segment.isBufferEmpty() && segment.minBufferTs() <= flushTs
})
segmentIDs := lo.Map(segmentsWithBuffer, func(segment *Segment, _ int) UniqueID {
return segment.segmentID
Expand Down

0 comments on commit 62848d3

Please sign in to comment.