[
https://issues.apache.org/jira/browse/KAFKA-16895?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17852416#comment-17852416
]
Chia-Ping Tsai commented on KAFKA-16895:
----------------------------------------
[~fvisconte] I have set permission for you. You can assign issue which you want
to fix to yourself in the future
> RemoteCopyLagSegments metric taking active segment into account
> ---------------------------------------------------------------
>
> Key: KAFKA-16895
> URL: https://issues.apache.org/jira/browse/KAFKA-16895
> Project: Kafka
> Issue Type: Bug
> Components: Tiered-Storage
> Affects Versions: 3.7.0, 3.7.1
> Reporter: Francois Visconte
> Assignee: Francois Visconte
> Priority: Minor
>
> The RemoteCopyLagSegment is off by 1 because it also includes the active
> segment into account while the RemoteCopyLagBytes does substract the size of
> active segment:
>
> {code:java}
> long bytesLag = log.onlyLocalLogSegmentsSize() - log.activeSegment().size();
> String topic = topicIdPartition.topic();
> int partition = topicIdPartition.partition();
> long segmentsLag = log.onlyLocalLogSegmentsCount();
> brokerTopicStats.recordRemoteCopyLagBytes(topic, partition, bytesLag);
> brokerTopicStats.recordRemoteCopyLagSegments(topic, partition, segmentsLag);
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)