You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "philipnee (via GitHub)" <gi...@apache.org> on 2023/09/14 18:10:43 UTC
[GitHub] [kafka] philipnee opened a new pull request, #14390: MINOR: Replace GroupState with MembershipManager
philipnee opened a new pull request, #14390:
URL: https://github.com/apache/kafka/pull/14390
We are planning to replace GroupState with MembershipManager as the latter already includes the necessary fields (`groupId`, `groupInstanceId`). This patch is a minor refactor of swapping the two components as the follow up of https://github.com/apache/kafka/pull/14364
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-15592: Allow member to not sending a heartbeat when a group ID is configured [kafka]
Posted by "philipnee (via GitHub)" <gi...@apache.org>.
philipnee commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1361164387
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/MembershipManagerImpl.java:
##########
@@ -142,9 +142,26 @@ public void transitionToFailed() {
transitionTo(MemberState.FAILED);
}
+ @Override
+ public void tryJoin() {
+ resetEpoch();
+ transitionTo(MemberState.UNJOINED);
+ }
+
+ @Override
+ public void leaveGroup() {
+ resetEpoch();
Review Comment:
OK, I remember why I wrote this. I think the epoch should never be -1/-2, it is only used for sending a leave group request. When we need/want to leave the group, then I think we would first send the heartbeat with negative epoch, then transition the state to not_in_group, it should also join with epoch = 0.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-15592: Allow member to not sending a heartbeat when a group ID is configured [kafka]
Posted by "lianetm (via GitHub)" <gi...@apache.org>.
lianetm commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1361391346
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -231,25 +246,23 @@ public NetworkClientDelegate.UnsentRequest toUnsentRequest() {
private class OffsetFetchRequestState extends RequestState {
public final Set<TopicPartition> requestedPartitions;
- public final GroupState.Generation requestedGeneration;
- private final CompletableFuture<Map<TopicPartition, OffsetAndMetadata>> future;
+ public CompletableFuture<Map<TopicPartition, OffsetAndMetadata>> future;
+
public OffsetFetchRequestState(final Set<TopicPartition> partitions,
- final GroupState.Generation generation,
Review Comment:
Yes, agree we don't need to send them if we don't have them (member not using the group management capabilities), but the point is member ID/epoch should be here to be included if the member has them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] philipnee commented on a diff in pull request #14390: MINOR: Replace GroupState with MembershipManager
Posted by "philipnee (via GitHub)" <gi...@apache.org>.
philipnee commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1330421069
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -180,19 +180,19 @@ CompletableFuture<ClientResponse> sendAutoCommit(final Map<TopicPartition, Offse
private class OffsetCommitRequestState {
private final Map<TopicPartition, OffsetAndMetadata> offsets;
private final String groupId;
- private final GroupState.Generation generation;
+ private final int memberEpoch;
Review Comment:
You are right. Stale member epcoh error isn't retriable, so the commit request would fail. since the request state is tight to individual request, so the subsequent request will get a new state.
Though - When we receive such error - It seems like we should also update membershipManager which is not done here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-15592: Allow member to not sending a heartbeat when a group ID is configured [kafka]
Posted by "philipnee (via GitHub)" <gi...@apache.org>.
philipnee commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1361155030
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -231,25 +246,23 @@ public NetworkClientDelegate.UnsentRequest toUnsentRequest() {
private class OffsetFetchRequestState extends RequestState {
public final Set<TopicPartition> requestedPartitions;
- public final GroupState.Generation requestedGeneration;
- private final CompletableFuture<Map<TopicPartition, OffsetAndMetadata>> future;
+ public CompletableFuture<Map<TopicPartition, OffsetAndMetadata>> future;
+
public OffsetFetchRequestState(final Set<TopicPartition> partitions,
- final GroupState.Generation generation,
Review Comment:
For the current impl, it sends a generation of -1 and id of "". I see both fields are "ignorable", not sure if that means we don't need to send them, @dajac - I assume ignorable means we don't need to send them if we don't have one?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Replace GroupState with MembershipManager [kafka]
Posted by "philipnee (via GitHub)" <gi...@apache.org>.
philipnee commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1353232858
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -180,19 +180,19 @@ CompletableFuture<ClientResponse> sendAutoCommit(final Map<TopicPartition, Offse
private class OffsetCommitRequestState {
private final Map<TopicPartition, OffsetAndMetadata> offsets;
private final String groupId;
- private final GroupState.Generation generation;
+ private final int memberEpoch;
Review Comment:
We could do it either way - recreate this RequestState object or resend the same object with the updated epoch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Replace GroupState with MembershipManager [kafka]
Posted by "lianetm (via GitHub)" <gi...@apache.org>.
lianetm commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1355025353
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -209,15 +213,21 @@ public NetworkClientDelegate.UnsentRequest toUnsentRequest() {
requestTopicDataMap.put(topicPartition.topic(), topic);
}
- OffsetCommitRequest.Builder builder = new OffsetCommitRequest.Builder(
- new OffsetCommitRequestData()
- .setGroupId(this.groupId)
- .setGenerationIdOrMemberEpoch(generation.generationId)
- .setMemberId(generation.memberId)
- .setGroupInstanceId(groupInstanceId)
- .setTopics(new ArrayList<>(requestTopicDataMap.values())));
+ OffsetCommitRequestData data = new OffsetCommitRequestData()
+ .setGroupId(groupId)
+ .setGenerationIdOrMemberEpoch(membershipManager.memberEpoch())
Review Comment:
We end up taking the epoch, memberId, and groupInstanceId directly from the `membershipMgr`, even though they are defined as local variables (unused) in this `OffsetCommitRequestState` class. In the case of the groupId though, we do use the local var. Let's review and make it consistent.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-15592: Allow member to not sending a heartbeat when a group ID is configured [kafka]
Posted by "lianetm (via GitHub)" <gi...@apache.org>.
lianetm commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1358318907
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -231,25 +246,23 @@ public NetworkClientDelegate.UnsentRequest toUnsentRequest() {
private class OffsetFetchRequestState extends RequestState {
public final Set<TopicPartition> requestedPartitions;
- public final GroupState.Generation requestedGeneration;
- private final CompletableFuture<Map<TopicPartition, OffsetAndMetadata>> future;
+ public CompletableFuture<Map<TopicPartition, OffsetAndMetadata>> future;
+
public OffsetFetchRequestState(final Set<TopicPartition> partitions,
- final GroupState.Generation generation,
Review Comment:
We do need member epoch (and member ID), to be included in the request if we have them, exactly as it is done for the OffsetCommit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Replace GroupState with MembershipManager [kafka]
Posted by "lianetm (via GitHub)" <gi...@apache.org>.
lianetm commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1355058608
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/DefaultBackgroundThread.java:
##########
@@ -178,31 +176,34 @@ public DefaultBackgroundThread(final Time time,
config);
HeartbeatRequestManager heartbeatRequestManager = null;
- // TODO: consolidate groupState and memberState
- if (groupState.groupId != null) {
+ String groupId = config.getString(ConsumerConfig.GROUP_ID_CONFIG);
+ if (groupId != null) {
+ membershipManager = Optional.of(new MembershipManagerImpl(groupId));
coordinatorRequestManager = new CoordinatorRequestManager(
- this.time,
- logContext,
- retryBackoffMs,
- retryBackoffMaxMs,
- this.errorEventHandler,
- groupState.groupId);
+ this.time,
+ logContext,
+ retryBackoffMs,
+ retryBackoffMaxMs,
+ this.errorEventHandler,
+ membershipManager.get().groupId());
commitRequestManager = new CommitRequestManager(
- this.time,
- logContext,
- subscriptionState,
- config,
- coordinatorRequestManager,
- groupState);
- MembershipManager membershipManager = new MembershipManagerImpl(groupState.groupId);
+ this.time,
+ logContext,
+ subscriptionState,
+ config,
+ coordinatorRequestManager,
+ membershipManager.get());
+ MembershipManager membershipManager = new MembershipManagerImpl(groupId);
Review Comment:
This is redundant here, already created above.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] philipnee commented on a diff in pull request #14390: MINOR: Replace GroupState with MembershipManager
Posted by "philipnee (via GitHub)" <gi...@apache.org>.
philipnee commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1330421069
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -180,19 +180,19 @@ CompletableFuture<ClientResponse> sendAutoCommit(final Map<TopicPartition, Offse
private class OffsetCommitRequestState {
private final Map<TopicPartition, OffsetAndMetadata> offsets;
private final String groupId;
- private final GroupState.Generation generation;
+ private final int memberEpoch;
Review Comment:
You are right. Stale member epcoh error isn't retriable, so the commit request would fail.
Though - When we receive such error - It seems like we should also update membershipManager which is not done here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-15592: Allow member to not sending a heartbeat when a group ID is configured [kafka]
Posted by "lianetm (via GitHub)" <gi...@apache.org>.
lianetm commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1358313112
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -209,15 +218,21 @@ public NetworkClientDelegate.UnsentRequest toUnsentRequest() {
requestTopicDataMap.put(topicPartition.topic(), topic);
}
- OffsetCommitRequest.Builder builder = new OffsetCommitRequest.Builder(
- new OffsetCommitRequestData()
- .setGroupId(this.groupId)
- .setGenerationIdOrMemberEpoch(generation.generationId)
- .setMemberId(generation.memberId)
- .setGroupInstanceId(groupInstanceId)
- .setTopics(new ArrayList<>(requestTopicDataMap.values())));
+ OffsetCommitRequestData data = new OffsetCommitRequestData()
+ .setGroupId(groupId)
+ .setGenerationIdOrMemberEpoch(memberEpoch)
Review Comment:
Aligned with the idea that memberEpoch may not be present, I expect we should only set this if we have one (like it is done for the memberID)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-15592: Allow member to not sending a heartbeat when a group ID is configured [kafka]
Posted by "lianetm (via GitHub)" <gi...@apache.org>.
lianetm commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1358337681
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/MembershipManagerImpl.java:
##########
@@ -142,9 +142,26 @@ public void transitionToFailed() {
transitionTo(MemberState.FAILED);
}
+ @Override
+ public void tryJoin() {
+ resetEpoch();
+ transitionTo(MemberState.UNJOINED);
+ }
+
+ @Override
+ public void leaveGroup() {
+ resetEpoch();
Review Comment:
I don't get the full idea here. What's the intended usage for this? If the intention is to use the transition as a trigger to send the last HB, then `resetEpoch` is incorrect, because we need epoch -1 (or -2 if static member). If the intention is just to call this after the last HB has been sent, then how are you seeing we'll trigger that last HB? (ex. from the unsubsbcribe)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-15592: Allow member to not sending a heartbeat when a group ID is configured [kafka]
Posted by "lianetm (via GitHub)" <gi...@apache.org>.
lianetm commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1358311725
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -173,19 +179,22 @@ CompletableFuture<Void> sendAutoCommit(final Map<TopicPartition, OffsetAndMetada
private class OffsetCommitRequestState {
private final Map<TopicPartition, OffsetAndMetadata> offsets;
private final String groupId;
- private final GroupState.Generation generation;
- private final String groupInstanceId;
+ private final Optional<String> memberId;
+ private final Optional<String> groupInstanceId;
private final CompletableFuture<Void> future;
+ private int memberEpoch;
Review Comment:
This should be Optional here too, right? Just as the memberId and groupInstanceId (groupId is the only required one to be able to commit offsets)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-15592: Allow member to not sending a heartbeat when a group ID is configured [kafka]
Posted by "lianetm (via GitHub)" <gi...@apache.org>.
lianetm commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1358432414
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -231,25 +246,23 @@ public NetworkClientDelegate.UnsentRequest toUnsentRequest() {
private class OffsetFetchRequestState extends RequestState {
public final Set<TopicPartition> requestedPartitions;
- public final GroupState.Generation requestedGeneration;
- private final CompletableFuture<Map<TopicPartition, OffsetAndMetadata>> future;
+ public CompletableFuture<Map<TopicPartition, OffsetAndMetadata>> future;
+
public OffsetFetchRequestState(final Set<TopicPartition> partitions,
- final GroupState.Generation generation,
Review Comment:
My comment is really only to make sure we are on the same page regarding the need of epoch here. But ok if we don't include the changes in this PR, because I also have them in the changes for OffsetFetch v9 that will follow this. I added id and epoch here not only to send it in the request, but also to differentiate the requests that will be retried.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-15592: Allow member to not sending a heartbeat when a group ID is configured [kafka]
Posted by "philipnee (via GitHub)" <gi...@apache.org>.
philipnee commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1361276961
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -209,15 +218,21 @@ public NetworkClientDelegate.UnsentRequest toUnsentRequest() {
requestTopicDataMap.put(topicPartition.topic(), topic);
}
- OffsetCommitRequest.Builder builder = new OffsetCommitRequest.Builder(
- new OffsetCommitRequestData()
- .setGroupId(this.groupId)
- .setGenerationIdOrMemberEpoch(generation.generationId)
- .setMemberId(generation.memberId)
- .setGroupInstanceId(groupInstanceId)
- .setTopics(new ArrayList<>(requestTopicDataMap.values())));
+ OffsetCommitRequestData data = new OffsetCommitRequestData()
+ .setGroupId(groupId)
+ .setGenerationIdOrMemberEpoch(memberEpoch)
Review Comment:
Agreed. Updated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Replace GroupState with MembershipManager [kafka]
Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1353179173
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -180,19 +180,19 @@ CompletableFuture<ClientResponse> sendAutoCommit(final Map<TopicPartition, Offse
private class OffsetCommitRequestState {
private final Map<TopicPartition, OffsetAndMetadata> offsets;
private final String groupId;
- private final GroupState.Generation generation;
+ private final int memberEpoch;
Review Comment:
> Stale member epcoh error isn't retriable
A stale member epoch error is retriable... but it should be retried with the new epoch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-15592: Allow member to not sending a heartbeat when a group ID is configured [kafka]
Posted by "philipnee (via GitHub)" <gi...@apache.org>.
philipnee commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1361155881
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/MembershipManagerImpl.java:
##########
@@ -142,9 +142,26 @@ public void transitionToFailed() {
transitionTo(MemberState.FAILED);
}
+ @Override
+ public void tryJoin() {
+ resetEpoch();
+ transitionTo(MemberState.UNJOINED);
+ }
+
+ @Override
+ public void leaveGroup() {
+ resetEpoch();
Review Comment:
Maybe I leave it as TODO, because I'm not sure how leaveGroup would integrate as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [kafka] dajac commented on a diff in pull request #14390: MINOR: Replace GroupState with MembershipManager
Posted by "dajac (via GitHub)" <gi...@apache.org>.
dajac commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1330306706
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -180,19 +180,19 @@ CompletableFuture<ClientResponse> sendAutoCommit(final Map<TopicPartition, Offse
private class OffsetCommitRequestState {
private final Map<TopicPartition, OffsetAndMetadata> offsets;
private final String groupId;
- private final GroupState.Generation generation;
+ private final int memberEpoch;
Review Comment:
For my understanding, how do we plan to update the member epoch when stale member epoch is received? Are we going to recreate a new OffsetCommitRequestState?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] MINOR: Replace GroupState with MembershipManager [kafka]
Posted by "philipnee (via GitHub)" <gi...@apache.org>.
philipnee commented on PR #14390:
URL: https://github.com/apache/kafka/pull/14390#issuecomment-1758845137
Hello @dajac @lianetm @kirktrue - I think the scope of this PR extended a bit beyond "replacing GroupState" because we've realized the member may join/leave the group anytime during its lifecycle. In particular, when the member hasn't joined/ has already left the group, we should stop sending the heartbeat.
The current implementation assumes the member should always try to join the group if the groupId is provided, due to the fact that the member's initial state is `UNJOINED`. However, as previously mentioned:
1. the user may only want to commit offsets
2. the user may unsubscribe and then assign (so we should keep the consumer alive and allows it to continue to commit offset)
3. the user might leave the group due to lack of polling (At least I believe that's the current behavior)
4. The user can unsubscribe, and then subscribe.
In any of the scenarios above, I think we wouldn't want the member to actively send heartbeats to the GC.
As the original intent of the membershipManager is to manage the state only when the member is in a group. However, due to the fact that the member may join/leave the group any time, I feel it might be sensible to always keep an instance active and introduce an inactive state such as `NOT_IN_GROUP` to indicate the member does not actively try to join a group.
However, it confuses with `UNJOINED` a bit. I wonder if we should rename the states.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-15592: Allow member to not sending a heartbeat when a group ID is configured [kafka]
Posted by "philipnee (via GitHub)" <gi...@apache.org>.
philipnee commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1361278043
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/MembershipManagerImpl.java:
##########
@@ -142,9 +142,26 @@ public void transitionToFailed() {
transitionTo(MemberState.FAILED);
}
+ @Override
+ public void tryJoin() {
+ resetEpoch();
+ transitionTo(MemberState.UNJOINED);
+ }
+
+ @Override
+ public void leaveGroup() {
+ resetEpoch();
Review Comment:
instead of reset the Epoch, which seems confusing, I made the epcoh = OptionalInt.empty() so that when the member tries to send a commit, it won't send the epoch after leaving the group.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] KAFKA-15592: Allow member to not sending a heartbeat when a group ID is configured [kafka]
Posted by "philipnee (via GitHub)" <gi...@apache.org>.
philipnee closed pull request #14390: KAFKA-15592: Allow member to not sending a heartbeat when a group ID is configured
URL: https://github.com/apache/kafka/pull/14390
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org