-
Notifications
You must be signed in to change notification settings - Fork 15.4k
KAFKA-9232: Coordinator new member heartbeat completion does not work for JoinGroup v3 #7753
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
Changes from 7 commits
61a2acf
74a9fe9
8392273
151477f
321fb1c
18d441d
d4d9209
69477f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -313,6 +313,21 @@ class GroupCoordinatorTest { | |
| assertEquals(Errors.INCONSISTENT_GROUP_PROTOCOL, joinGroupResult.error) | ||
| } | ||
|
|
||
| @Test | ||
| def testCompleteNewMemberTimeoutHeartbeat(): Unit = { | ||
| // New member joins the group | ||
| var responseFuture = sendJoinGroup(groupId, JoinGroupRequest.UNKNOWN_MEMBER_ID, protocolType, protocols, None, DefaultSessionTimeout, DefaultRebalanceTimeout, false) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: could be |
||
| timer.advanceClock(GroupInitialRebalanceDelay + 1) | ||
|
|
||
| val joinResult = Await.result(responseFuture, Duration(DefaultRebalanceTimeout + 100, TimeUnit.MILLISECONDS)) | ||
| val group = groupCoordinator.groupManager.getGroup(groupId).get | ||
| assertEquals(Errors.NONE, joinResult.error) | ||
| assertEquals(0, group.allMemberMetadata.count(_.isNew)) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be worth asserting |
||
|
|
||
| // Make sure the delayed heartbeat based on the new member timeout has been completed | ||
| assertEquals(1, groupCoordinator.heartbeatPurgatory.numDelayed) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we wanted to go a tad further, we could advance the clock by the session timeout and assert the member gets kicked out. That ensures that the heartbeat left behind has the right timeout. |
||
| } | ||
|
|
||
| @Test | ||
| def testNewMemberJoinExpiration(): Unit = { | ||
| // This tests new member expiration during a protracted rebalance. We first create a | ||
|
|
@@ -1882,7 +1897,7 @@ class GroupCoordinatorTest { | |
|
|
||
| val nextGenerationId = joinResult.generationId | ||
|
|
||
| // with no leader SyncGroup, the follower's request should failure with an error indicating | ||
| // with no leader SyncGroup, the follower's request should fail with an error indicating | ||
| // that it should rejoin | ||
| EasyMock.reset(replicaManager) | ||
| val followerSyncFuture = sendSyncGroupFollower(groupId, nextGenerationId, otherJoinResult.memberId, None) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced
awaitingSyncCallback != nullwithisAwaitingSync