Lianet Magrans created KAFKA-16815:
--------------------------------------

             Summary: Handle FencedInstanceId on heartbeat for new consumer
                 Key: KAFKA-16815
                 URL: https://issues.apache.org/jira/browse/KAFKA-16815
             Project: Kafka
          Issue Type: Task
          Components: clients, consumer
            Reporter: Lianet Magrans


With the new consumer group protocol, a member could receive a 
FencedInstanceIdError in the heartbeat response. This could be the case when an 
active member using a group instance id is removed from the group by an admin 
client. If a second member joins with the same instance id, the first member 
will receive a FencedInstanceId on the next heartbeat response. This should be 
treated as a fatal error (consumer should not attempt to rejoin). 

Currently, the FencedInstanceId is not explicitly handled by the client in the 
HeartbeatRequestManager. It ends up being treated as a fatal error, see 
[here|https://github.com/apache/kafka/blob/5552f5c26df4eb07b2d6ee218e4a29e4ca790d5c/clients/src/main/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManager.java#L417]
 (just because it lands on the "unexpected" error category). We should handle 
it explicitly, just to make sure that we express that it's is an expected 
error: log a proper message for it and fail (handleFatalFailure). We should 
also that the error is included in the tests that cover the HB request error 
handling 
([here|https://github.com/apache/kafka/blob/5552f5c26df4eb07b2d6ee218e4a29e4ca790d5c/clients/src/test/java/org/apache/kafka/clients/consumer/internals/HeartbeatRequestManagerTest.java#L798])

    



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to