Hey Jason,

Thanks for the explanation.

Please correct me if this is wrong. The "unknown truncation offset"
scenario happens when consumer does not have the full leaderEpoch -> offset
mapping. In this case we can still use the KIP-101-based approach to
truncate offset to "start offset of the first Leader Epoch larger than last
epoch of the consumer" but it may be inaccurate. So the KIP chooses to use
the timestamp-based approach which is also best-effort.

If this understanding is correct, for "closest" offset reset policy and
"unknown truncation offset" scenario, I am wondering whether it maybe
better to replace timestamp-based approach with KIP-101 based approach. In
comparison to timestamp-based approach, the KIP-101-based approach seems to
simplify the API a bit since user does not need to understand timestamp.
Similar to the timestamp-based approach, both approaches are best-effort
and do not guarantee that consumer can consume all messages. It is not like
KIP-279 which guarantees that follower broker can consume all messages from
the leader.

Then it seems that the remaining difference is mostly about accuracy, i.e.
how much message will be duplicated or missed in the "unknown truncation
offset" scenario. Not sure either one is clearly better than the other.
Note that there are two scenarios mentioned in KIP-279 which are not
addressed by KIP-101. Both scenarios require quick leadership change
between brokers, which seems to suggest that the offset based obtained
by "start
offset of the first Leader Epoch larger than last epoch of the consumer"
under these two scenarios may be very close to the offset obtained by the
message timestamp. Does this sound reasonable?

Good point that users on v1 format can get benefit with timestamp based
approach. On the other hand it seems like a short term benefit for users
who have not migrated. I am just not sure whether it is more important than
designing a better API.

Also, for both "latest" and "earliest" reset policy, do you think it would
make sense to also use the KIP-101 based approach to truncate offset for
the "unknown truncation offset" scenario?


Thanks,
Dong

Reply via email to