Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No error on identical instance ID in static consumer group mode #479

Closed
Iadgarov opened this issue Jun 24, 2023 · 2 comments · Fixed by #480
Closed

No error on identical instance ID in static consumer group mode #479

Iadgarov opened this issue Jun 24, 2023 · 2 comments · Fixed by #480

Comments

@Iadgarov
Copy link

Hi,

Perhaps I'm missing the way to check for such an error, but I cant seem to cause a failure when creating two client, in the same consumer group, with the same instance ID.
According to the Kafka spec we should be getting a FencedInstanceID error, as defined in kerr. (KIP-345)

I have run this against Kafka 2.5.1 and can confirm that the broker logs do in fact mentioned returning this error

[2023-06-24 15:09:33,711] ERROR given member.id myistance-dac57156-ae34-4b3c-8f90-98d6f4b0aa6d is identified as a known static member myistance, but not matching the expected member.id myistance-02a09bac-1a4a-453d-b5f9-6e124ea65b77 during join-group, will respond with instance fenced error (kafka.coordinator.group.GroupMetadata)

The way I tested it was simply creating two client like so:

opts := []kgo.Opt{
		kgo.SeedBrokers(container.Address(kafka.BrokerPort)),
		kgo.ConsumerGroup("mygroup"),
		kgo.InstanceID("myistance"),
		kgo.ConsumeTopics("topic-1"),
		kgo.DisableAutoCommit(),
	}

	_, err = kgo.NewClient(opts...)
	if err != nil {
		die("unable to create client: %v", err)
	}

	_, err = kgo.NewClient(opts...)
	if err != nil {
		die("unable to create client: %v", err)
	}

When trying with confluent kafka go I seem to get an error, although it appears to be in the form of a panic admittedly..

Any assistance is much appreciated.

twmb added a commit that referenced this issue Jun 27, 2023
Poll previously would not return if only a fake fetch existed. For
example, if a user joined a group with an instance ID twice, the fenced
group member would never exit polling. We now check both the actual
ready sources and the fake sources in our poll condition loop.

Closes #479.
@twmb twmb closed this as completed in #480 Jun 27, 2023
@twmb
Copy link
Owner

twmb commented Jun 27, 2023

This was a bug, good find. This is fixed in v1.13.6.

@twmb
Copy link
Owner

twmb commented Jun 27, 2023

Notably: you should have been seeing this error from polling, and you will now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants