Copilot commented on code in PR #1149:
URL:
https://github.com/apache/skywalking-banyandb/pull/1149#discussion_r3341278024
##########
banyand/internal/storage/segment.go:
##########
@@ -882,6 +882,17 @@ func (sc *segmentController[T, O]) remove(deadline
time.Time) (hasSegment bool,
return hasSegment, err
}
+// getRetentionDeadline returns the earliest timestamp that is still within the
+// retention window. Data points with a timestamp before this deadline are
+// expired by the TTL policy. Retention removes a segment only once its whole
+// time range falls before the deadline (see (*segmentController).remove), so a
+// partially expired segment keeps serving expired data points until its end
+// also passes the deadline; queries must clamp their lower time bound to this
+// value to avoid returning that expired data.
Review Comment:
The comment for getRetentionDeadline says queries must "clamp their lower
time bound" to avoid returning expired data, but the actual fix (and PR
description) is segment-level filtering (skipping fully expired segments). This
mismatch is misleading for future maintainers.
--
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]