jiafu1115 commented on code in PR #20913:
URL: https://github.com/apache/kafka/pull/20913#discussion_r3205204544
##########
storage/src/main/java/org/apache/kafka/server/log/remote/storage/RemoteLogManager.java:
##########
@@ -936,6 +945,56 @@ List<EnrichedLogSegment> candidateLogSegments(UnifiedLog
log, Long fromOffset, L
return candidateLogSegments;
}
+ private boolean delayCopy(LogConfig logConfig, LogSegment previousSeg,
long currentTimeMs, long totalLogSize, long cumulativeSize) {
+ if (logConfig == null) {
+ return false;
+ }
+
+ long copyLagMs = logConfig.remoteCopyLagMs();
+ long copyLagBytes = logConfig.remoteCopyLagBytes();
+ logger.debug("delayCopy check for segment {}: copyLagMs={},
copyLagBytes={}, currentTimeMs={}, totalLogSize={}, cumulativeSize={},
sizeLagBytes={}",
+ previousSeg, copyLagMs, copyLagBytes, currentTimeMs,
totalLogSize, cumulativeSize, totalLogSize - cumulativeSize);
+
+ if (copyLagMs == 0 || copyLagBytes == 0) {
+ return false;
+ }
+
+ if (copyLagMs == LogConfig.DEFAULT_REMOTE_COPY_LAG_MS &&
copyLagBytes == LogConfig.DEFAULT_REMOTE_COPY_LAG_BYTES) {
Review Comment:
@kamalcph Agree and done with refactor. Duplicated with another thread. so
resolve this one for send pass review.
--
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]