kamalcph commented on code in PR #20913:
URL: https://github.com/apache/kafka/pull/20913#discussion_r3199747635
##########
storage/src/main/java/org/apache/kafka/storage/internals/log/LogConfig.java:
##########
@@ -399,6 +411,15 @@ public Boolean remoteLogCopyDisable() {
return remoteLogConfig.remoteLogCopyDisable;
}
+
+ public long remoteCopyLagMs() {
+ return remoteLogConfig.remoteCopyLagMs == MAX_REMOTE_COPY_LAG_MS ?
localRetentionMs() : remoteLogConfig.remoteCopyLagMs;
Review Comment:
> using -1 or Long.MaxValue to reach the max delay lag
Both usages are fine. From the KIP discussion:
```
3) if set to a value in between: it creates a buffer windows. users can save
costs for a period but still upload data well before it hits the retention
limit, avoiding burst traffic issues
```
Most likely users will configure a positive value to have buffer window.
(eg) Topic-A is configured with
retention.ms = 2 days
local.retention.ms = 3 hrs
remote.copy.lag.ms = 2.5 hrs
Whenever you reduce the `local.rentention.ms`, then you also may have to
reduce the `remote.copy.lag.ms` otherwise the validation might throw an error.
With the internal logic `max(0, min(copy_lag, local_retention))`, it can take
the lower of both config.
When `remote.copy.lag.ms ` is set to -1 and `local.retention.ms` is set to
-2, then the value of copy lag gets derived from `retention.ms`. This is the
concern that the value is derived from two other configs. I think usage of
either -1 or Long.MaxValue is fine.
--
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]