[ 
https://issues.apache.org/jira/browse/KAFKA-20799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Luke Chen updated KAFKA-20799:
------------------------------
    Description: 
When shared group and classic consumer group has name collision, the error is 
not clear to users.

Scenarios:

*1. Existing classic consumer group: "test_group"*
1.1. When creating a new shared group named "test_group", the clients will get 
this exception:
{code:java}
> bin/kafka-console-share-consumer.sh --topic quickstart-events 
> --bootstrap-server localhost:9092 --group test_group 

ERROR [ShareConsumer clientId=console-share-consumer, groupId=bbb] 
ShareGroupHeartbeatRequest failed due to unexpected error GROUP_ID_NOT_FOUND: 
Group test_group is not a share group. 
(org.apache.kafka.clients.consumer.internals.ShareHeartbeatRequestManager){code}
1.2. When altering the offset for a classic consumer group named "test_group", 
the clients will get this exception:

 
{code:java}
> bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group 
> test_group --reset-offsets --topic quickstart-events --to-offset 0 --execute

org.apache.kafka.common.errors.GroupIdNotFoundException: Failed altering group 
offsets for the following partitions: [quickstart-events-0]{code}
 

*2. Existing share group: "test_share_group"*

2.1. When creating a new classic consumer group via joinGroup request, clients 
will get:
{code:java}
> bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning 
> --bootstrap-server localhost:9092 --group test_share_group

ERROR [Consumer clientId=console-consumer, groupId=test_share_group] JoinGroup 
failed due to fatal error: The group member's supported protocols are 
incompatible with those of existing members or first group member tried to join 
with empty protocol type or empty protocol list. 
(org.apache.kafka.clients.consumer.internals.ConsumerCoordinator)
[2026-07-13 16:42:29,418] ERROR Error processing message, terminating consumer 
process:  (org.apache.kafka.tools.consumer.ConsoleConsumer)
org.apache.kafka.common.errors.InconsistentGroupProtocolException: The group 
member's supported protocols are incompatible with those of existing members or 
first group member tried to join with empty protocol type or empty protocol 
list.{code}
2.2. When altering the offset for a shared group named "test_share_group", the 
clients will get this exception:
{code:java}
> ./bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --group 
> test_share_group --reset-offsets --topic quickstart-events --to-offset 0 
> --execute

org.apache.kafka.common.errors.GroupIdNotFoundException: Group bbb is not a 
share group. Failed altering group offsets for the following partitions: 
[quickstart-events-0]{code}
*Issues:*
 # Inconsistent errors for classic consumer group handling: 
GroupIdNotFoundException VS InconsistentGroupProtocolException
 # Either it's GroupIdNotFoundException or InconsistentGroupProtocolException, 
it is not clear to users that the group id creation failure is because the 
group id is actually taken by another type of group, not "group id not found" 
or "inconsistent group protocol" error. Maybe a new "GroupIdInUseException" is 
better?

  was:
When shared group and classic consumer group has name collision, the error is 
not clear to users.

Scenarios:

*1. Existing classic consumer group: "test_group"*
1.1. When creating a new shared group named "test_group", the clients will get 
this exception:
{code:java}
org.apache.kafka.common.errors.GroupIdNotFoundException: Group test_group is 
not a share group.{code}
1.2. When altering the offset for a classic consumer group named "test_group", 
the clients will get this exception:

 
{code:java}
> bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group 
> test_group --reset-offsets --topic quickstart-events --to-offset 0 --execute

org.apache.kafka.common.errors.GroupIdNotFoundException: Failed altering group 
offsets for the following partitions: [quickstart-events-0]{code}
 


*2. Existing share group: "test_share_group"*

2.1. When creating a new classic consumer group via joinGroup request, clients 
will get:
{code:java}
org.apache.kafka.common.errors.InconsistentGroupProtocolException: The group 
member's supported protocols are incompatible with those of existing members or 
first group member tried to join with empty protocol type or empty protocol 
list.{code}
2.2. When altering the offset for a shared group named "test_share_group", the 
clients will get this exception:
{code:java}
> ./bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --group 
> test_share_group --reset-offsets --topic quickstart-events --to-offset 0 
> --execute

org.apache.kafka.common.errors.GroupIdNotFoundException: Group bbb is not a 
share group. Failed altering group offsets for the following partitions: 
[quickstart-events-0]{code}
*Issues:*
 # Inconsistent errors for classic consumer group handling: 
GroupIdNotFoundException VS InconsistentGroupProtocolException
 # Either it's GroupIdNotFoundException or InconsistentGroupProtocolException, 
it is not clear to users that the group id creation failure is because the 
group id is actually taken by another type of group, not "group id not found" 
or "inconsistent group protocol" error. Maybe a new "GroupIdInUseException" is 
better?


> Introduce new error for consumer/share group name collision
> -----------------------------------------------------------
>
>                 Key: KAFKA-20799
>                 URL: https://issues.apache.org/jira/browse/KAFKA-20799
>             Project: Kafka
>          Issue Type: Improvement
>    Affects Versions: 4.4.0
>            Reporter: Luke Chen
>            Priority: Major
>
> When shared group and classic consumer group has name collision, the error is 
> not clear to users.
> Scenarios:
> *1. Existing classic consumer group: "test_group"*
> 1.1. When creating a new shared group named "test_group", the clients will 
> get this exception:
> {code:java}
> > bin/kafka-console-share-consumer.sh --topic quickstart-events 
> > --bootstrap-server localhost:9092 --group test_group 
> ERROR [ShareConsumer clientId=console-share-consumer, groupId=bbb] 
> ShareGroupHeartbeatRequest failed due to unexpected error GROUP_ID_NOT_FOUND: 
> Group test_group is not a share group. 
> (org.apache.kafka.clients.consumer.internals.ShareHeartbeatRequestManager){code}
> 1.2. When altering the offset for a classic consumer group named 
> "test_group", the clients will get this exception:
>  
> {code:java}
> > bin/kafka-consumer-groups.sh --bootstrap-server localhost:9092 --group 
> > test_group --reset-offsets --topic quickstart-events --to-offset 0 --execute
> org.apache.kafka.common.errors.GroupIdNotFoundException: Failed altering 
> group offsets for the following partitions: [quickstart-events-0]{code}
>  
> *2. Existing share group: "test_share_group"*
> 2.1. When creating a new classic consumer group via joinGroup request, 
> clients will get:
> {code:java}
> > bin/kafka-console-consumer.sh --topic quickstart-events --from-beginning 
> > --bootstrap-server localhost:9092 --group test_share_group
> ERROR [Consumer clientId=console-consumer, groupId=test_share_group] 
> JoinGroup failed due to fatal error: The group member's supported protocols 
> are incompatible with those of existing members or first group member tried 
> to join with empty protocol type or empty protocol list. 
> (org.apache.kafka.clients.consumer.internals.ConsumerCoordinator)
> [2026-07-13 16:42:29,418] ERROR Error processing message, terminating 
> consumer process:  (org.apache.kafka.tools.consumer.ConsoleConsumer)
> org.apache.kafka.common.errors.InconsistentGroupProtocolException: The group 
> member's supported protocols are incompatible with those of existing members 
> or first group member tried to join with empty protocol type or empty 
> protocol list.{code}
> 2.2. When altering the offset for a shared group named "test_share_group", 
> the clients will get this exception:
> {code:java}
> > ./bin/kafka-share-groups.sh --bootstrap-server localhost:9092 --group 
> > test_share_group --reset-offsets --topic quickstart-events --to-offset 0 
> > --execute
> org.apache.kafka.common.errors.GroupIdNotFoundException: Group bbb is not a 
> share group. Failed altering group offsets for the following partitions: 
> [quickstart-events-0]{code}
> *Issues:*
>  # Inconsistent errors for classic consumer group handling: 
> GroupIdNotFoundException VS InconsistentGroupProtocolException
>  # Either it's GroupIdNotFoundException or 
> InconsistentGroupProtocolException, it is not clear to users that the group 
> id creation failure is because the group id is actually taken by another type 
> of group, not "group id not found" or "inconsistent group protocol" error. 
> Maybe a new "GroupIdInUseException" is better?



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

Reply via email to