Hi Apoorv,

Thanks for the review. I've updated the KIP.


*AM1:* Yes, a broker restart, controlled shutdown or rolling upgrade moves
the leadership of the share partition, and the new leader makes delayed
records available immediately. The delivery count is persisted but the
delay isn't, so a record can be redelivered early and reach
group.share.delivery.count.limit sooner, as you say. Each leadership change
brings forward at most one attempt per delayed record, though, and later
waits still follow the backoff, because they're computed from the persisted
delivery count. I've described the delay as best effort in the KIP. It
isn't persisted to avoid changing the records in __share_group_state and
the RPCs that write them, and a lost delay only makes a redelivery earlier.
I've added these details to the KIP.

*AM2:* I've added a worst case and guidance for operators. With the default
delivery count limit of 5, a record that keeps failing waits about 30
seconds in total with the default exponential configuration, or 4 minutes
with a fixed 60-second delay. During a broad failure the pause is what we
want, because new records would fail too and use up their attempts. I
didn't exempt or weight delayed records, because the limit doesn't count
records in particular states. It bounds the span from the share-partition
start offset to the last acquired offset, which is the state the leader
keeps in memory. A delayed record holds the start offset, so the span grows
behind it whatever we count, and exempting or weighting delayed records
would let that memory grow without bound. I have updated the KIP
accordingly with the example

*AM3:* When a delay expires, the leader completes the share fetch requests
waiting for records from that share partition, as it does when an
acquisition lock times out, so redelivery isn't held back by
fetch.max.wait.ms. The cost is one check of the waiting requests per
expired delay, similar to lock timeouts. I've added a sentence to the KIP.


*AM4: *I'd rather not validate one against the other, to match
retry.backoff.ms and retry.backoff.max.ms in the clients, which aren't
validated either. share.release.backoff.max.ms also only matters in
exponential mode. If share.release.backoff.ms is greater than or equal to
share.release.backoff.max.ms, every wait is share.release.backoff.max.ms,
without jitter, which is how the clients use retry.backoff.max.ms in that
case. I've added this to the KIP.


*AM5: *Agreed. Turning the delay off is meant as a kill switch, so it
should end the wait immediately. I've updated the KIP: setting
share.release.backoff.mode to off for a group, or
group.share.max.release.backoff.ms to 0 for all groups, makes records
already waiting available immediately, without a leadership change. Other
changes, including lowering the delay, still apply only to delays that
start after the change. To recover from a misconfigured backoff, an
operator turns the delay off, which releases the waiting records, and then
sets the corrected values. I've added re-evaluating waiting delays to
Rejected Alternatives. I also considered a finer-grained option: an Admin
API to release the delay of chosen records, by offset. It targets the case
where one long-delayed record holds back the share partition start offset,
without releasing the group's other waiting records. I've rejected it for
the below reasons:

   - It needs new public interfaces. The delay is kept only in the
   share-partition leader's memory, while the existing admin RPCs for share
   groups go to the group coordinator. So it would need a new RPC to the
   share-partition leaders, a new Admin API and tool support.
   - Operators would need a way to see which records are delayed and for
   how long, which is another new API. Today they can see the start offset and
   the RedeliveryDelayedRecordCount gauge, but not the state of individual
   records.
   - It only helps if the record's next delivery attempt succeeds. If the
   downstream is still failing, the record is delayed again, for longer in
   exponential mode, and the start offset still doesn't move.
   - It isn't specific to delays. A record whose lock a consumer keeps
   renewing holds back the start offset in the same way.

The kill switch is coarser, because it releases every waiting record in the
group, but it ends the pause straight away with no new API. Thus, I've
added this option of releasing the delay of chosen records to Rejected
Alternatives.


*AM6: *Yes, it's intended. The delay starts when the lock expires. The lock
duration was spent on the failed attempt, not as a pause between attempts.
A lock timeout often means processing hung (for example, on a slow
downstream service), and a disconnect can mean the record made the consumer
crash. Redelivering the record at once would probably fail the same way.
The broker can't distinguish these cases from unrelated failures, so it
delays every failed attempt; when the failure was unrelated, the cost is
one delay. I've added this to the KIP.

Thanks,
Abhinav


On Wed, Nov 25, 2026 at 6:47 PM Apoorv Mittal <[email protected]>
wrote:

> Hi Abhinav, thanks for the KIP. I have some questions, mostly where I
> think the KIP needs to be more explicit.
>
> *AM1.* The KIP says that on a leadership change the old leader cancels
> its timers and the new leader makes delayed records available immediately.
> It doesn't say what happens on a broker restart, controlled shutdown or
> rolling upgrade, which I assume behave the same way because the share
> partition is re-initialized from persisted state. Could you state that
> explicitly, along with the consequence? The delivery count is persisted but
> the delay is not, correct? After a restart a record can be redelivered
> immediately and use up an attempt. It can then reach
> group.share.delivery.count.limit sooner than the backoff intended. In the
> downstream-outage case from the motivation, a rolling restart could defeat
> the backoff. I'd suggest documenting the delay as a best-effort minimum and
> not a guarantee, and explaining why the deadline isn't persisted.
>
> *AM2.* Delayed records stay in flight, count towards
> share.partition.max.record.locks and block the start offset. With delays
> of up to an hour allowed, a broad failure could fill the lock limit with
> delayed records, so the partition would hand out no new records, even
> healthy ones, until the delays expire. Could the KIP include a worst-case
> example and some guidance for operators? Did you consider exempting delayed
> records from the lock limit, or weighting them differently?
>
> *AM3.* What happens when every available record in a share partition is
> delayed i.e. say all the batches are released consuming max in-flight
> limit. Share fetch waits in purgatory, so should expiry of a delay
> complete the pending DelayedShareFetch (won't suggest that, but writing
> here for discussion)? If it doesn't, redelivery would be delayed by up to
> fetch.max.wait.ms
> <https://urldefense.com/v3/__http://fetch.max.wait.ms__;!!Ayb5sqE7!t-CS_tyUe4UnaYp9jMfGJrUB9AJ6s-JFwKnHZiAnMF86of2iB6BacNZpjeQz8bvHePVXb2bUjNWBcFhwKsnV1mIqbnU$>
> beyond the configured backoff. Maybe we should clarify same in the KIP
> that this could happen or fix it somehow in the implementation. What do you
> suggest?
>
> *AM4.* Should the KIP require that share.release.backoff.ms
> <https://urldefense.com/v3/__http://share.release.backoff.ms__;!!Ayb5sqE7!t-CS_tyUe4UnaYp9jMfGJrUB9AJ6s-JFwKnHZiAnMF86of2iB6BacNZpjeQz8bvHePVXb2bUjNWBcFhwKsnVUpt9EBw$>
> is always less than or equal to share.release.backoff.max.ms
> <https://urldefense.com/v3/__http://share.release.backoff.max.ms__;!!Ayb5sqE7!t-CS_tyUe4UnaYp9jMfGJrUB9AJ6s-JFwKnHZiAnMF86of2iB6BacNZpjeQz8bvHePVXb2bUjNWBcFhwKsnV2Ljggkw$>?
> Both are group configs that can be altered independently, so validation
> would need to check one against the other, for example rejecting an
> incrementalAlterConfigs that lowers share.release.backoff.max.ms
> <https://urldefense.com/v3/__http://share.release.backoff.max.ms__;!!Ayb5sqE7!t-CS_tyUe4UnaYp9jMfGJrUB9AJ6s-JFwKnHZiAnMF86of2iB6BacNZpjeQz8bvHePVXb2bUjNWBcFhwKsnV2Ljggkw$>
> below the current share.release.backoff.ms
> <https://urldefense.com/v3/__http://share.release.backoff.ms__;!!Ayb5sqE7!t-CS_tyUe4UnaYp9jMfGJrUB9AJ6s-JFwKnHZiAnMF86of2iB6BacNZpjeQz8bvHePVXb2bUjNWBcFhwKsnVUpt9EBw$>.
> If the KIP chooses not to validate this, please state how exponential
> mode behaves when share.release.backoff.ms
> <https://urldefense.com/v3/__http://share.release.backoff.ms__;!!Ayb5sqE7!t-CS_tyUe4UnaYp9jMfGJrUB9AJ6s-JFwKnHZiAnMF86of2iB6BacNZpjeQz8bvHePVXb2bUjNWBcFhwKsnVUpt9EBw$>
> is higher than share.release.backoff.max.ms
> <https://urldefense.com/v3/__http://share.release.backoff.max.ms__;!!Ayb5sqE7!t-CS_tyUe4UnaYp9jMfGJrUB9AJ6s-JFwKnHZiAnMF86of2iB6BacNZpjeQz8bvHePVXb2bUjNWBcFhwKsnV2Ljggkw$>:
> is the first delay clamped to the max, or is the base value used as-is?
>
> *AM5.* The KIP says a config change applies only to delays that start
> after the change, and records already waiting keep their delay. Is that the
> right behaviour when the change is meant to stop delays? For example, if an
> operator sets group.share.max.release.backoff.ms
> <https://urldefense.com/v3/__http://group.share.max.release.backoff.ms__;!!Ayb5sqE7!t-CS_tyUe4UnaYp9jMfGJrUB9AJ6s-JFwKnHZiAnMF86of2iB6BacNZpjeQz8bvHePVXb2bUjNWBcFhwKsnV54nz1GQ$>
> to 0, or sets share.release.backoff.mode to off for a group, to recover
> from a misconfigured backoff, records already waiting could still be
> withheld for up to the old maximum. Should the leader re-evaluate pending
> timers on a config change, at least when the new effective delay is shorter
> or zero? If not, please state this explicitly and note that the operator's
> only way to release waiting records sooner is a leadership change.
>
> *AM6.* A lock timeout has already waited the full lock duration before
> the record is released. Is it intended that the backoff is added on top of
> that and why?
>
> Regards,
> Apoorv Mittal
>
>
> On Mon, Nov 16, 2026 at 8:58 AM Abhinav Dixit via dev <
> [email protected]> wrote:
>
>> Hi Andrew,
>> Thanks for the feedback. I've updated the KIP.
>>
>> AS1) Fixed.
>>
>> AS2) Yes, setting group.share.max.release.backoff.ms
>> <https://urldefense.com/v3/__http://group.share.max.release.backoff.ms__;!!Ayb5sqE7!t-CS_tyUe4UnaYp9jMfGJrUB9AJ6s-JFwKnHZiAnMF86of2iB6BacNZpjeQz8bvHePVXb2bUjNWBcFhwKsnV54nz1GQ$>
>> to 0 is meant to turn
>> off redelivery delays for all share groups, so I've made it a dynamic
>> broker config with a cluster-wide update mode.
>>
>> AS3) Done.
>>
>> AS4) Agreed, that's simpler to use. I've replaced
>> share.release.backoff.exponential.enable
>> with share.release.backoff.mode, which takes the suggested values.
>>
>> Thanks,
>> Abhinav
>>
>> On Fri, Nov 13, 2026 at 8:10 PM Andrew Schofield via dev <
>> [email protected]> wrote:
>>
>> > Hi Abhinav,
>> > Thanks for the KIP. This is a nice improvement which fits in well. I
>> > see that the way you have done the broker configurations doesn't match
>> > what we've done before (there's no max-max), but I think that what
>> > you've done is fine and less complicated.
>> >
>> > A few comments from an initial review.
>> >
>> > AS1) Typo "ype" instead of "Type" in the group config table.
>> >
>> > AS2) If the broker configuration group.share.max.release.backoff.ms
>> <https://urldefense.com/v3/__http://group.share.max.release.backoff.ms__;!!Ayb5sqE7!t-CS_tyUe4UnaYp9jMfGJrUB9AJ6s-JFwKnHZiAnMF86of2iB6BacNZpjeQz8bvHePVXb2bUjNWBcFhwKsnV54nz1GQ$>
>> > is intended as a way to disable redelivery delays, please call it out as
>> > a dynamic broker config so the code is written accordingly.
>> >
>> > AS3) In the section on lag, you say "so they count as lag". I suggest
>> > that "remain in-flight" would be more elegant.
>> >
>> > AS4) I wonder whether another way to do the configuration might be
>> > to replace share.release.backoff.exponential.enable with
>> > share.release.backoff.mode with three values:
>> >
>> >   off (default)
>> >   fixed - Every wait is share.release.backoff.ms
>> <https://urldefense.com/v3/__http://share.release.backoff.ms__;!!Ayb5sqE7!t-CS_tyUe4UnaYp9jMfGJrUB9AJ6s-JFwKnHZiAnMF86of2iB6BacNZpjeQz8bvHePVXb2bUjNWBcFhwKsnVUpt9EBw$>
>> without jitter
>> >   exponential - what you've written for the exponential case
>> >
>> > The reason I suggest this is that we could have a non-zero
>> > share.release.backoff.ms
>> <https://urldefense.com/v3/__http://share.release.backoff.ms__;!!Ayb5sqE7!t-CS_tyUe4UnaYp9jMfGJrUB9AJ6s-JFwKnHZiAnMF86of2iB6BacNZpjeQz8bvHePVXb2bUjNWBcFhwKsnVUpt9EBw$>
>> value (say 2000ms) which acts as a suggested
>> > starting point for a backoff delay. The default exponential backoff
>> > delay would then be 2000+4000+8000+16000 = 30000ms, and all a user
>> > would have to set is `share.release.backoff.mode=exponential`. Wdyt?
>> >
>> > Thanks,
>> > Andrew
>> >
>> >
>> > On 2026-11-12 06:57 UTC Abhinav Dixit via dev wrote:
>> > > Hi all,
>> > > I'd like to start a discussion on KIP-1395, which allows a share
>> group to
>> > > introduce a delay and optional exponential backoff capability within
>> its
>> > > redelivery model.
>> > >
>> > > Today, a released or expired record becomes available for redelivery
>> as
>> > > soon as its lock clears, there is no way to slow down or space out
>> > retries
>> > > per share group. This KIP adds a per-group config for how long a
>> record
>> > is
>> > > unavailable for fetching after an explicit release or record expiry.
>> It
>> > > also adds an optional exponential-backoff mode that increases this
>> delay
>> > as
>> > > a record's delivery count grows, up to a bounded maximum.
>> > >
>> > >
>> > > Looking forward to your feedback.
>> > >
>> > > KIP link -
>> > >
>> >
>> https://urldefense.com/v3/__https://cwiki.apache.org/confluence/spaces/KAFKA/pages/462817066/KIP-1395*Redelivery*delay*and*backoff*for*share*groups__;KysrKysrKw!!Ayb5sqE7!uwJ22IRxAASfybHWupjoyXq7dWAQE9YNGTBs0W7z6t4sdCBM0JoYpN3OcMha8WD8U0he0RrRkumNJAQ6a3w$
>> > >
>> > >
>> > > JIRA link -
>> >
>> https://urldefense.com/v3/__https://issues.apache.org/jira/browse/KAFKA-21482__;!!Ayb5sqE7!uwJ22IRxAASfybHWupjoyXq7dWAQE9YNGTBs0W7z6t4sdCBM0JoYpN3OcMha8WD8U0he0RrRkumNSpKK6gk$
>> > >
>> > >
>> > > Thanks,
>> > > Abhinav
>> > >
>> >
>>
>

Reply via email to