KAFKA-9701 (fix): Only check protocol name when generation is valid#8324
KAFKA-9701 (fix): Only check protocol name when generation is valid#8324guozhangwang merged 2 commits intoapache:trunkfrom
Conversation
|
Thanks for the patch.. How was this found? Should we add tests? |
There was a problem hiding this comment.
Just side cleanups starting L700
63edf2e to
5fccb32
Compare
|
@abbccdda Would it be valid to call If we consider it not valid, we might rather raise an |
|
@apurvam It was reproduced from the soak test. Will discuss with the team whether we need a stream side test as the case to mock here is a little bit tricky. |
|
@mjsax I think in streams case we are not @abbccdda I think this is not a streams-only issue, as mentioned above, any consumer could call |
|
LGTM! Merging to trunk and 2.5 |
…8324) This bug was incurred by #7994 with a too-strong consistency check. It is because a reset generation operation could be called in between the joinGroupRequest -> joinGroupResponse -> SyncGroupRequest -> SyncGroupResponse sequence of events, if user calls unsubscribe in the middle of consumer#poll(). Proper fix is to avoid the protocol name check when the generation is invalid. Reviewers: Matthias J. Sax <matthias@confluent.io>, Guozhang Wang <wangguoz@gmail.com>
|
Nice find! |
| return protocolName != null && generation() != Generation.NO_GENERATION | ||
| && !protocolName.equals(generation().protocolName); |
There was a problem hiding this comment.
@guozhangwang @abbccdda Shouldn't we synchronise this or use a local reference of the generation to be 100% safe?
|
@guozhangwang @abbccdda While I agree with the fix to unblock the release, I wonder if it wouldn't be better to explicitly handle this case in the |
|
I'm running on version 2.6.1 and I'm having exactly same issue described here. |
This bug was incurred by #7994 with a too-strong consistency check. It is because a reset generation operation could be called in between the
joinGroupRequest->joinGroupResponse->SyncGroupRequest->SyncGroupResponsesequence of events, if user callsunsubscribein the middle of consumer#poll().Proper fix is to avoid the protocol name check when the generation is invalid.
Committer Checklist (excluded from commit message)