Hi Kamal,

Thanks for the review.

I looked into KIP-1241 and its two configs (remote.copy.lag.ms and
remote.copy.lag.bytes) in more detail.

1. With option b, I see we will contradict what was achieved(avoid
redundant storage) already in KIP-1241.

ex: remote.copy.lag.ms=1h, local.retention.ms=2h, records written at 10:00.

Current situation:
- uploaded at 11:00
- deleted locally at 12:00 (because 2h is calculated from 10:00)
- local from 10:00 to 12:00, in both tiers from 11:00 to 12:00

After this KIP:
- uploaded at 11:00
- deleted locally at 13:00 (because 2hrs is calculated after uploaded,
which is 1hr delay + 2hr)
- local from 10:00 to 13:00, in both tiers from 11:00 to 13:00

So it looks like overlap doubles, unless users lower local.retention.ms by
the copy lag. Pls correct me if am wrong.

2. I checked few cases. For normal traffic, including when it goes idle,
rolling of segments looks unchanged.

Only backfills change: today they can be rolled at every retention check
(every 5 minutes by default), and with the new condition about once per
local.retention.ms (or at segment.bytes).

One edge case: the segment creation time is kept in memory, so after a
restart a pending roll can be delayed by up to local.retention.ms once. I
shall add these cases to the KIP.

3. Thanks.

4. Agree with your point on reassignment and default of
log.message.timestamp.after.max.ms as 1 hr. But for timestamps older than
local.retention.ms, that data will be deleted right after upload, because
min will pick up record timestamp.
So thinking if we should add min(...) to rejected alternatives or do you
see any other case where it helps?

Pls let me know.

Thanks,
Murali

On Tue, Nov 24, 2026 at 2:31 AM Kamal Chandraprakash <
[email protected]> wrote:

> Hi Muralidhar,
>
> Thanks for the follow up!
>
> 1. Option-B looks clearer to me. Using the same behaviour everywhere will
> make it easier for users to understand and tune the configs.
> 2. Before we finalise this, we should check the other scenarios too, such
> as rolling the active segment when traffic goes idle.
> 3. Keeping the upload timestamp per partition in memory, the same way we
> handle highestOffsetInRemoteStorage, LGTM.
> 4. log.message.timestamp.after.max.ms defaults to 1 hour. If partitions
> are
> expected to be rebalanced continuously, either messages will get rejected
> or local log deletion could be delayed by up to an hour (or whatever max
> timestamp is configured).
>
> Thanks,
> Kamal
>
> On Tue, Nov 24, 2026 at 1:20 AM Muralidhar Basani via dev <
> [email protected]> wrote:
>
> > Hi Kamal,
> >
> > Thanks for the review!
> >
> > 1. With delayed upload (remote.copy.lag.ms / remote.copy.lag.bytes),
> > counting from upload time adds the copy lag on top of local.retention.ms
> .
> >
> > For ex, with local.retention.ms=3d and remote.copy.lag.ms=-1, a segment
> > is uploaded at day 3 and would then stay local until day 6, instead of
> > being
> > deleted at day 3 as today. Two options:
> >
> > a) use upload time only when uploads are eager, i.e. remote.copy.lag.ms
> =0
> > (the default) or remote.copy.lag.bytes=0, the same check the upload path
> > uses to skip the lag - when copy lag is configured which keeps current
> > behavior.
> >
> > b) use upload time everywhere, and document that local data is kept for
> > copy lag + local.retention.ms.
> >
> > Option a looks better ?
> >
> > 2. Yes. With old timestamps, the active segment is rolled every 5
> minutes,
> > and with this KIP those small segments would stay local longer,
> increasing
> > the number of open file descriptors.
> > I'll add a condition for tiered topics: the active segment is only rolled
> > if it has also been the active segment for at least local.retention.ms.
> A
> > backfill then rolls about once per local.retention.ms (or at
> > segment.bytes)
> > instead of every 5 minutes. So normal traffic is unchanged.
> >
> > 3. Currently the local deletion does not call the RLMM. I see it is only
> > reading the in-memory highestOffsetInRemoteStorage, which the RLM tasks
> > update.
> > This KIP keeps that model: upload times are kept in memory and updated by
> > the same RLM tasks (the leader on upload, followers in RLMFollowerTask
> > together with highestOffsetInRemoteStorage). So during an RLMM or remote
> > storage outage, already-uploaded expired segments are still deleted.
> After
> > a restart, deletion waits until the RLMM is ready, same as today.
> >
> > 4. With future timestamps, min(recordTimestamp, lastModified) picks
> > lastModified, which changes after a reassignment, the same problem as
> > KAFKA-20609. I shall add it to Rejected Alternatives.
> >
> > Pls let me know.
> >
> > Thanks,
> > Murali
> >
> > On Fri, Nov 20, 2026 at 10:35 AM Kamal Chandraprakash <
> > [email protected]> wrote:
> >
> > > Hi Muralidhar,
> > >
> > > Thanks for the KIP!
> > >
> > > 1. Could you describe the new local log deletion behaviour when
> > > remote.copy.lag.ms and remote.copy.lag.bytes are configured?
> > > 2. For records with older timestamps, the segments get rotated once in
> 5
> > > mins (log.retention.check.interval.ms). Does the change in behaviour
> to
> > > retain those segments locally increase the file descriptor count?
> > > 3. By default, segments are uploaded eagerly to remote storage unless
> > copy
> > > lag is configured. When there is an outage in the remote storage /
> RLMM,
> > > does it stop deleting the local-log segments that were already uploaded
> > to
> > > remote storage and expired? We should allow deleting the expired local
> > log
> > > segments even when RLMM is unavailable.
> > > 3a. Tying the core broker tasks of deleting the local-log with the RLMM
> > > plugin seems risky to me. Currently, we block deleting the local-log
> > > segments until it gets uploaded to remote storage to maintain lineage.
> > > 4. In KAFKA-20609, we were using the lastModifiedTime when the
> timestamp
> > is
> > > set to the future. The concern was after the reassignment, the file
> > > lastModifiedTime gets updated. Did we also think about taking a
> > > min(recordTimestamp, lastModifiedTime) to delete the local log.
> > >
> > > Thanks,
> > > Kamal
> > >
> > >
> > > On Fri, Nov 20, 2026 at 1:53 AM Muralidhar Basani via dev <
> > > [email protected]> wrote:
> > >
> > > > Hi Chia,
> > > >
> > > > Thanks for the review.
> > > >
> > > > As only leader uploads files, a follower's file can cover several of
> > the
> > > > leader's uploaded files. The follower uses the upload time of the
> last
> > > one,
> > > > since that is when its whole file was available remotely.
> > > > In your example, the follower's 0-100 file uses the upload time of
> the
> > > > leader's 50-100 file. If it's the other way round (one leader file,
> two
> > > > follower files), both follower files use the same upload time.
> > > >
> > > > I have updated the KIP based on this.
> > > > If there are no further comments, I shall start a vote thread soon.
> > > >
> > > > Thanks,
> > > > Murali
> > > >
> > > > On Thu, Nov 19, 2026 at 9:44 AM Chia-Ping Tsai <[email protected]>
> > > wrote:
> > > >
> > > > > Hi Murali,
> > > > >
> > > > > Overall LGTM. It would be my honor to give +1 on the vote thread :)
> > > > >
> > > > > One nit: what happens if the follower's segments don't match the
> > > > leader's?
> > > > > For example, offsets 0-100 are in two segments on the leader but
> in a
> > > > > single segment on the follower. Which upload time should the
> follower
> > > > pick?
> > > > >
> > > > > Best,
> > > > > Chia-Ping
> > > > >
> > > > > On Wed, Nov 18, 2026 03:14 AM, Muralidhar Basani via dev <
> > > > > [email protected]> wrote:
> > > > >
> > > > > > Hi all,
> > > > > >
> > > > > > I have updated the KIP based on the feedback so far:
> > > > > >
> > > > > > - Compatibility: added a "Disk sizing" section. For backfill
> data,
> > > > local
> > > > > > disk grows by about local.retention.ms * write rate per
> partition
> > > > > replica,
> > > > > > with local.retention.bytes as the way to cap it.
> > > > > > - Proposed Changes: clarified where the upload time comes from,
> and
> > > > that
> > > > > > local time-based deletion pauses while the remote log metadata
> > cache
> > > is
> > > > > > initializing, with no fallback to record timestamps.
> > > > > > - Rejected Alternatives: added min(record timestamp, upload
> time).
> > > > > >
> > > > > > Please take a look and let me know if there are further comments.
> > > > > >
> > > > > > Thanks,
> > > > > > Murali
> > > > > >
> > > > > > On Fri, Nov 13, 2026 at 10:29 PM Muralidhar Basani <
> > > > > > [email protected]> wrote:
> > > > > >
> > > > > > > Hi Viktor,
> > > > > > >
> > > > > > > Thanks for the review, and nice point on disk sizing.
> > > > > > >
> > > > > > > Unless there are objections, I shall keep the uploadTime as
> base,
> > > add
> > > > > the
> > > > > > > sizing note to compatibility, and move min(..) to rejected
> > > > > alternatives.
> > > > > > >
> > > > > > > I will update KIP.
> > > > > > >
> > > > > > > Chia, pls let me know if this addresses the concern you raised
> on
> > > > Case
> > > > > C.
> > > > > > >
> > > > > > > Thanks,
> > > > > > > Murali
> > > > > > >
> > > > > > > On Thu, Nov 12, 2026 at 11:32 AM Viktor Somogyi-Vass <
> > > > > > > [email protected]> wrote:
> > > > > > >
> > > > > > >> Hi Murali,
> > > > > > >>
> > > > > > >> I also agree with Chia-Ping, taking uploadTime as the new base
> > for
> > > > > > >> local.retention.ms would generally increase local disk usage
> > > which
> > > > > > might
> > > > > > >> be surprising and might have disk sizing consequences as well.
> > So
> > > > the
> > > > > > >> extra local disk required would be local.retention.ms *
> upload
> > > > rate,
> > > > > I
> > > > > > >> think we can add this to the KIP. I don't think that changing
> > > > behavior
> > > > > > is a
> > > > > > >> blocker if it results in a more predictable behavior.
> > > > > > >> I was also considering min(maxTimestamp, uploadTime), but I
> > think
> > > > that
> > > > > > >> overall it would complicate the config itself, which I would
> not
> > > > take
> > > > > > >> compared to uploadTime only as that would create a common,
> > > > > broker-bound
> > > > > > and
> > > > > > >> predictable interpretation for local.retention.ms.
> > > > > > >>
> > > > > > >> Best,
> > > > > > >> Viktor
> > > > > > >>
> > > > > > >> On Thu, Nov 5, 2026 at 10:03 PM Muralidhar Basani via dev <
> > > > > > >> [email protected]> wrote:
> > > > > > >>
> > > > > > >>> Thanks Chia for the review.
> > > > > > >>>
> > > > > > >>> 1. Case C: Yes, this is a behavior change. It only affects
> > topics
> > > > > that
> > > > > > >>> set
> > > > > > >>> local.retention.ms lower than the age of the backfilled
> data.
> > > > > > >>> With the default (-2 for local.retention.ms, means use the
> > same
> > > > > value
> > > > > > as
> > > > > > >>> retention.ms), backfilled data isn't deleted right after
> > upload
> > > > > today
> > > > > > >>> either.
> > > > > > >>> For example, with retention.ms = 7 days and
> local.retention.ms
> > > > left
> > > > > at
> > > > > > >>> its
> > > > > > >>> default of -2, local retention is also 7 days. Data stays on
> > > local
> > > > > disk
> > > > > > >>> as
> > > > > > >>> long as it's kept at all.
> > > > > > >>>
> > > > > > >>> I see 2 options.
> > > > > > >>>
> > > > > > >>> a. Keep upload-time semantics and document the change in the
> > > > upgrade
> > > > > > >>> notes.
> > > > > > >>> Operators who want to bound local disk can set
> > > > local.retention.bytes:
> > > > > > it
> > > > > > >>> is
> > > > > > >>> per partition, ignores timestamps, and deletes the oldest
> > > uploaded
> > > > > > >>> segments
> > > > > > >>> once the limit is exceeded. For a one-off backfill, they can
> > also
> > > > > lower
> > > > > > >>> local.retention.ms on the topic temporarily.
> > > > > > >>>
> > > > > > >>> Ex for bytes : As the limit applies to each partition
> > separately,
> > > > > with
> > > > > > >>> 5gb
> > > > > > >>> per partition, and with 10 partitions, broker can hold upto
> > 50gb
> > > > > > locally.
> > > > > > >>> As it only looks at size, it will ignore the timestamps then.
> > > > > > >>>
> > > > > > >>> b. What do you think of an alternative which is to measure
> from
> > > > > > >>> min(record
> > > > > > >>> timestamp, upload time). That keeps today's backfill behavior
> > and
> > > > > still
> > > > > > >>> fixes future timestamps, but local.retention.ms would no
> > longer
> > > > mean
> > > > > > the
> > > > > > >>> same thing for all data.
> > > > > > >>>
> > > > > > >>> Which one do you think fits operators better?
> > > > > > >>>
> > > > > > >>> 2. Metadata cache initializing: No, we won't fall back. RLM
> > tasks
> > > > > skip
> > > > > > >>> their run until RemoteLogMetadataManager#isReady is true, so
> > > > > > >>> highestOffsetInRemoteStorage stays -1 and the
> > > upload-before-delete
> > > > > > guard
> > > > > > >>> blocks time-based local deletion.
> > > > > > >>> Basically deletion is paused until cache is ready. So the
> > > fallback
> > > > > > isn't
> > > > > > >>> triggered.
> > > > > > >>>
> > > > > > >>> Pls let me know your thoughts.
> > > > > > >>>
> > > > > > >>> Thanks,
> > > > > > >>> Murali
> > > > > > >>>
> > > > > > >>> On Thu, Nov 5, 2026 at 7:06 PM Chia-Ping Tsai via dev <
> > > > > > >>> [email protected]>
> > > > > > >>> wrote:
> > > > > > >>>
> > > > > > >>> > Hi Murali,
> > > > > > >>> >
> > > > > > >>> > I'm worried about Case C: "the local copy is deleted around
> > > > 11:05,
> > > > > 1
> > > > > > >>> hour
> > > > > > >>> > after the upload."
> > > > > > >>> >
> > > > > > >>> > Would this surprise operators who assume backfilled data is
> > > > removed
> > > > > > >>> right
> > > > > > >>> > after upload? I guess the suitable approach for them is to
> > use
> > > > > > >>> > local.retention.bytes?
> > > > > > >>> >
> > > > > > >>> > Also, what happens if the RemoteLogMetadataCache is still
> > > > > > initializing
> > > > > > >>> > when the broker has just started? Will we always take the
> > > > fallback?
> > > > > > >>> >
> > > > > > >>> > Best,
> > > > > > >>> > Chia-Ping
> > > > > > >>> >
> > > > > > >>> >
> > > > > > >>> >
> > > > > > >>> > On 2026-10-23 18:30 UTC Muralidhar Basani via dev wrote:
> > > > > > >>> > > Hi all,
> > > > > > >>> > >
> > > > > > >>> > > I would like to start a discussion about tiered storage
> > > topics
> > > > > and
> > > > > > >>> how
> > > > > > >>> > > local segments are deleted by time, once they are
> uploaded
> > to
> > > > > > remote
> > > > > > >>> > > storage.
> > > > > > >>> > >
> > > > > > >>> > >
> > > > > > >>> >
> > > > > > >>> https://cwiki.apache.org/confluence/spaces/KAFKA/pages/45197
> > > > > > 9130/KIP-1385+Measure+local.retention.ms+from+remote+
> > > > > > upload+time+instead+of+record+timestamps
> > > > > > >>> > >
> > > > > > >>> > > Looking forward to your thoughts on this approach.
> > > > > > >>> > >
> > > > > > >>> > > Thanks,
> > > > > > >>> > > Murali
> > > > > > >>> > >
> > > > > > >>> >
> > > > > > >>>
> > > > > > >>
> > > > > >
> > > > >
> > > >
> > >
> >
>

Reply via email to