Copilot commented on code in PR #946:
URL:
https://github.com/apache/skywalking-banyandb/pull/946#discussion_r2698987488
##########
banyand/internal/storage/segment.go:
##########
@@ -708,7 +708,7 @@ func loadSegments[T TSTable, O any](root, prefix string,
parser *segmentControll
}); err != nil {
return err
}
- sort.Slice(startTimeLst, func(i, j int) bool { return i < j })
+ sort.Slice(startTimeLst, func(i, j int) bool { return
startTimeLst[i].Before(startTimeLst[j]) })
Review Comment:
The fix to use proper time comparison is correct, but this critical sorting
logic lacks test coverage. Consider adding a unit test that verifies segment
start times are sorted correctly, especially with multiple segments that could
have their order swapped.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]