kamalcph commented on code in PR #20218:
URL: https://github.com/apache/kafka/pull/20218#discussion_r2225040912
##########
storage/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogManager.java:
##########
@@ -1031,6 +1031,9 @@ private void copyLogSegment(UnifiedLog log, LogSegment
segment, RemoteLogSegment
customMetadata =
remoteStorageManagerPlugin.get().copyLogSegmentData(copySegmentStartedRlsm,
segmentData);
} catch (RemoteStorageException e) {
logger.info("Copy failed, cleaning segment {}",
copySegmentStartedRlsm.remoteLogSegmentId());
+ long bytesLag = log.onlyLocalLogSegmentsSize() -
log.activeSegment().size();
+ long segmentsLag = log.onlyLocalLogSegmentsCount() - 1;
Review Comment:
shall we extract this as a method and reuse it?
```java
private void recordLagStats(UnifiedLog log) {
long bytesLag = log.onlyLocalLogSegmentsSize() -
log.activeSegment().size();
long segmentsLag = log.onlyLocalLogSegmentsCount() - 1;
recordLagStats(bytesLag, segmentsLag);
}
```
--
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]