Closed Max-Cheng closed 6 months ago
The main issue is that method kgo.Client.loadEpochsForBrokerLoad()
return the broker end-offset to 0,thus client reset offset into the FAKE end-offset, cause re-consume message from kafka
The main issue is that method
kgo.Client.loadEpochsForBrokerLoad()
return the broker end-offset to 0,thus client reset offset into the FAKE end-offset, cause re-consume message from kafka
Update: using param to force supportsOffsetForLeaderEpoch
return false
to skip endoffset check.
Why is the provider returning the ApiKey for OffsetsForLeaderEpoch in the ApiVersions response? There shouldn't need to be an escape hatch here.
Why is the provider returning the ApiKey for OffsetsForLeaderEpoch in the ApiVersions response? There shouldn't need to be an escape hatch here.
Yes, I am also extremely puzzled as to why Alibaba would construct an ApiVersions response with a fake value. However, from the logs, I found that the reason for resetting was because the endoffset was 0, which led to the consumer consuming repeatedly (auto.reset.offset). At the same time, I also confirmed with their technical support to understand whether this interface was working correctly internally. But the response I received was that they do not support this interface.
Can you file a ticket with Alibaba with evidence they are supporting the API?
Also, I think we can avoid your feature for now -- what do you think about using a kversions.Versions
that specifically pins OffsetForLeaderEpoch to a max version of -1?
This ticket was communicated through Alibaba Cloud's DingTalk, involving our client. I am unable to show you the complete content of the ticket.
Meeting Content: The issue arises from the fact that the "cloud storage type" topic in Kafka does not support the relevant API calls.
Solution: You can utilize the "local storage type" topic, which is entirely consistent with the open-source version.
My idea is that alibaba cloud shouldn't make such a ridiculous implementation here, and shouldn't just modify the kversions.Versions
to avoid this behavior, idk other cloud provider "implement" such as alibaba, it doesn't make sense.
Why using another flag to avoid this behavior: because they claim customer can spefic version to install, thus this won't a version issue
Sorry for the delayed reply, I meant to post this much sooner.
What I mean is, rather than introducing a whole new config option to disable OffsetForLeaderEpoch, why don't you do something like this?
func main() {
v := kversion.Stable()
v.SetMaxKeyVersion(kmsg.OffsetForLeaderEpoch.Int16(), -1)
cl, err := kgo.NewClient(
kgo.MaxVersions(v),
This will opt out of the offset for leader epoch key (I think)
Sorry for the delayed reply, I meant to post this much sooner.
What I mean is, rather than introducing a whole new config option to disable OffsetForLeaderEpoch, why don't you do something like this?
func main() { v := kversion.Stable() v.SetMaxKeyVersion(kmsg.OffsetForLeaderEpoch.Int16(), -1) cl, err := kgo.NewClient( kgo.MaxVersions(v),
This will opt out of the offset for leader epoch key (I think)
Yep. I think this option will help correct the wrong behavior. But after rethinking, what if those Cloud-Providers implement a "fake" Kafka protocol based on their claimed specific version? Rolling back the version may not be a good idea.
But Thanks you reply.
what if those Cloud-Providers implement a "fake" Kafka protocol based on their claimed specific version
They can't -- request versions are negotiated purely on numbers, not names. If a cloud provider starts using different numbers for different requests, it will completely break all clients that negotiate api versions.
In this case, OffsetForLeaderEpoch is request 23, which has version ranges 0 through 4. When the client talks to the broker, the broker returns a response saying: "ApiKey 23, MinVersion 0, MaxVersion 4" (or some other max version). By using kversions.SetMaxKeyVersion(kmsg.OffsetForLeaderEpoch.Int16(), -1)
, you are telling the client itself to disable support for key 23.
Why have this proposal
Some cloud service providers (such as alibabacloud) haven't implemented OffsetsForLeaderEpoch.
What happened
Franz-go uses
OffsetsForLeaderEpoch
to fetch leader epoch/End Offset and compare consumer offset between leader. After restart, will trigger reset offset behaviour.Log