I have a consumer C1 in consumer group G1 which is reading from topic T1 (doing a poll) and in between this poll, there joins another consumer C2 in same group G1 but subscribes to a different topic T2.
What I have observed is, the partition of Topic T1 is revoked and re-assigned to same consumer C1,which is expected because there is no other consumer for this topic. But my question is why would a revoke happen in first place when the other consumer had subscribed to a different topic?
These are the log prints from consumer C1. At this same moment there is a consumer C2 joining and subscribing to topic T2 :
Revoking previously assigned partitions [T1-1, T1-0]
20/05/28 03:19:04 INFO internals.AbstractCoordinator: [Consumer clientId=consumer-171, groupId=G1] (Re-)joining group
20/05/28 03:19:04 INFO internals.AbstractCoordinator: [Consumer clientId=consumer-171, groupId=G1] Successfully joined group with generation 1117184
20/05/28 03:19:04 INFO internals.ConsumerCoordinator: [Consumer clientId=consumer-171, groupId=G1] Setting newly assigned partitions [T1-1, T1-0]