IBMStreams / streamsx.kafka

Repository for integration with Apache Kafka
https://ibmstreams.github.io/streamsx.kafka/
Apache License 2.0
13 stars 9 forks source link

CrKafkaConsumerGroupClient goes into wrong state and can lose tuples after reset of CR #155

Closed ghost closed 5 years ago

ghost commented 5 years ago

After upgrading kafka-clients to 2.1.1 following trace records are observed:

25 Mar 2019 03:37:02.417-0700 [14708] WARN #splapptrc,J[13],P[95],KafkaStream0 M[CrKafkaConsumerGroupClient.java:com.ibm.streamsx.kafka.clients.consumer.CrKafkaConsumerGroupClient.onPartitionsAssigned:736]  - onPartitionsAssigned() [POLLING_THROTTLED]: unexpected state for onPartitionsAssigned()
25 Mar 2019 03:38:56.949-0700 [16692] WARN #splapptrc,J[13],P[95],KafkaStream0 M[CrKafkaConsumerGroupClient.java:com.ibm.streamsx.kafka.clients.consumer.CrKafkaConsumerGroupClient.onPartitionsAssigned:736]  - onPartitionsAssigned() [POLLING_STOPPED]: unexpected state for onPartitionsAssigned()

The effect of this is that the consumer is not seeked to the offset from the checkpoint after reset of the consistent region. The tuples are not replayed.

The reason is a different behavior of the KafkaConsumer (part of the client) compared with the old kafka client. Group rebalancing is not blocking any more. The callbacks onPartitionsRevoked and onPartitionsAssigned can now be called back during different user invocations of consumer.poll().

ghost commented 5 years ago

Note: This bug has been observed only on RHEL6 and only sometimes.

ghost commented 5 years ago

resolved in v1.9.3