Closed ocadaruma closed 2 years ago
Minimum supported version of Kafka-client should maybe be documented?
Sorry, overlooked.
After this PR gets merged, Decaton will require kafka-clients at least 2.0.0
because poll(Duration)
is used but I think it's quite long ago so not necessary to be explicitly documented?
Thanks, I'm good. Thanks for the nice feature!
Regarding the minimum version of Kafka client, I think it's better documented than not!
Okay then, I'll followup in separate PR about minimum kafka-clients ver.
Summary
ConsumerConfig.PARTITION_ASSIGNMENT_STRATEGY_CONFIG
propertyProblems of current Decaton implementation to support cooperative rebalancing
Consumer#poll(long)
is usedConsumer#poll(Duration)
Consumer#poll(Duration)
though, ~from cooperative rebalancing-support perspective~, the most notable one ispoll(Duration)
doesn't block for entire rebalancing procedure unlikepoll(long)
onPartitionRevoked
is called,poll()
may return without waitingonPartitionAssigned
invocation in same poll. (It will be eventually invoked in laterpoll()
though)onPartitionRevoked
andonPartitionAssigned
are executed in samepoll()
onPartitionRevoked
returns, revoked partitions are no longer owned by KafkaConsumer so anypause/resume/offset commit
may cause RuntimeException and kills subscription threadPartitionContext
s to atonPartitionAssigned
(this was to minimize context-recreation as much as possible. In short, Decaton itself did similar thing to cooperative-rebalancing from eager-rebalancing era)onPartitionAssigned
onPartitionsRevoked
=> new assignment is added inonPartitionsAssigned
".onPartitionsAssigned
will be called only on newly-added partitionsSummary of changes
revoking
status inPartitionContext
, which is used to prevent callingpause/resume/offset commit
for revoked partitions during rebalanceConsumeManager
to work even if subset of partitions (i.e. not full assignment) are passed inConsumerRebalanceListener
's callbacksSubscriptionStateListener
state transition may changepoll()
may return afteronPartitionsRevoked
beforeonPartitionsAssigned
, the transitionREBALANCING
->SHUTTING_DOWN
is now possible.Appendix
onPartitionsRevoked
andonPartitionsAssigned
may be called in differentpoll()
introduces certain complexity, I wrote smallTLA+
spec to get a confidence about the design