Skip to content

KAFKA-20633: Update the default value of remote copy lag bytes#22394

Merged
kamalcph merged 5 commits into
apache:trunkfrom
kamalcph:KAFKA-20633
Jun 30, 2026
Merged

KAFKA-20633: Update the default value of remote copy lag bytes#22394
kamalcph merged 5 commits into
apache:trunkfrom
kamalcph:KAFKA-20633

Conversation

@kamalcph

@kamalcph kamalcph commented May 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Reviewers: Jian fujian1115@gmail.com, Luke Chen showuon@gmail.com,
Satish Duggana satishd@apache.org

@github-actions github-actions Bot added triage PRs from the community storage Pull requests that target the storage module tiered-storage Related to the Tiered Storage feature clients small Small PRs labels May 28, 2026
@github-actions github-actions Bot added core Kafka Broker and removed small Small PRs labels May 28, 2026
@kamalcph

Copy link
Copy Markdown
Contributor Author

@chia7712 @jiafu1115

Ping for review.

@github-actions github-actions Bot removed the triage PRs from the community label Jun 2, 2026
@jiafu1115

Copy link
Copy Markdown
Contributor

@kamalcph LGTM. thanks. help to merge. the test should be flaky

@jiafu1115

Copy link
Copy Markdown
Contributor

@kamalcph already passed the flaky test.

@kamalcph

Copy link
Copy Markdown
Contributor Author

The PR needs one approval from committers.

@chia7712 @satishd @C0urante @showuon

can any of you stamp this PR? Thanks!

@showuon showuon self-requested a review June 25, 2026 07:13
@showuon

showuon commented Jun 25, 2026

Copy link
Copy Markdown
Member

Will review this week or next week. Thanks.

@satishd satishd self-requested a review June 25, 2026 09:07

@satishd satishd left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @kamalcph for the PR, left a minor comment.

@showuon showuon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing the default of log.remote.copy.lag.bytes to -1 will change the existing behavior of tiered storage. If user sets [log.local.retention.ms=-1 and log.local.retention.bytes=100000], after this PR, the remote copy lag will become 100000 bytes, instead of the existing behavior: immediately. I don't think this is expected, right?

@kamalcph

Copy link
Copy Markdown
Contributor Author

Changing the default of log.remote.copy.lag.bytes to -1 will change the existing behavior of tiered storage. If user sets [log.local.retention.ms=-1 and log.local.retention.bytes=100000], after this PR, the remote copy lag will become 100000 bytes, instead of the existing behavior: immediately. I don't think this is expected, right?

Since most users care more about time than size, we could set the default value of the time lag to 0, and the size lag to -1.

This trade-off was discussed in the thread. So, the change in behaviour is expected.

@jiafu1115

jiafu1115 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor
image

Thanks for the discussion.
refer to code and test metric in the KIP for this case. it won't change the existed behavior when user don't change any configure due to the default lag ms is 0. the change for the default size is for user only need to change one configure instead of two configures for most of the cases (only set time as retention. also it is default configure for kafka.)

if (copyLagMs == 0 || copyLagBytes == 0) {
return true;
}

cc @kamalcph @showuon @chia7712 is there any issue for this design we missed? the original design is that two default configure items' default is 0. currently. one is -1 and another is 0 to reduce the configure effort for most of the cases.

@showuon

showuon commented Jun 30, 2026

Copy link
Copy Markdown
Member
image

Thanks for the discussion. refer to code and test metric in the KIP for this case. it won't change the existed behavior when user don't change any configure due to the default lag ms is 0. the change for the default size is for user only need to change one configure instead of two configures for most of the cases (only set time as retention. also it is default configure for kafka.)

if (copyLagMs == 0 || copyLagBytes == 0) { return true; }

cc @kamalcph @showuon @chia7712 is there any issue for this design we missed? the original design is that two default configure items' default is 0. currently. one is -1 and another is 0 to reduce the configure effort for most of the cases.

Thanks for the explanation. I re-read the KIP and previous PR, I have more understanding now. I think the point is that because lag.ms is 0, it'll be uploaded immediately no matter what lag.bytes is set. OK, looks good.

@jiafu1115 , could you please add a short section in tiered storage section to talk about the delay upload feature? It'd be good if you can mention something like what we have in log deletes section:

If both policies are enabled at the same time, a segment that is eligible for deletion due to either policy will be deleted.

This can be a separate PR. Thanks.

@showuon showuon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@kamalcph kamalcph merged commit 3bfcd4c into apache:trunk Jun 30, 2026
23 checks passed
@kamalcph kamalcph deleted the KAFKA-20633 branch June 30, 2026 05:27
@kamalcph

Copy link
Copy Markdown
Contributor Author

Thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clients core Kafka Broker storage Pull requests that target the storage module tiered-storage Related to the Tiered Storage feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants