Francois Visconte created KAFKA-16895:
-----------------------------------------

             Summary: 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


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)

Reply via email to