twmb / franz-go

franz-go contains a feature complete, pure Go library for interacting with Kafka from 0.8.0 through 3.6+. Producing, consuming, transacting, administrating, etc.
BSD 3-Clause "New" or "Revised" License
1.61k stars 158 forks source link

fix: clear lastAssigned when revoking eager consumer #720

Closed hamdanjaveed closed 1 month ago

hamdanjaveed commented 2 months ago

If a consumer that can be cooperative but is currently eager revokes its assigned partitions as part of a rebalance it should also clear its tracking state between rebalances as it has revoked all of its partitions.

This was leading to some inconsistent behaviour when migrating from eager consumers to cooperative consumers following the migration instructions in KIP-429.

Fixes #686

hamdanjaveed commented 2 months ago

Tried writing a test for this but wasn't able to write one that properly exercised the code path here :(

Instead we've manually tested this fix by running consumers locally from this minimal repro: https://github.com/hamdanjaveed/kgo-cooperative-bug-reproducer

twmb commented 1 month ago

Sorry for the delay, the last few months were much busier than anticipated. Releasing imminently! (this fixes a somewhat minor bug so I did not rush a patch release for this)