vamossagar12 commented on code in PR #14666:
URL: https://github.com/apache/kafka/pull/14666#discussion_r1375947390


##########
core/src/test/scala/unit/kafka/coordinator/group/GroupMetadataTest.scala:
##########
@@ -609,7 +609,7 @@ class GroupMetadataTest {
   @Test
   def testReplaceGroupInstanceWithNonExistingMember(): Unit = {
     val newMemberId = "newMemberId"
-    assertThrows(classOf[IllegalArgumentException], () => 
group.replaceStaticMember(groupInstanceId, memberId, newMemberId))
+    assertThrows(classOf[IllegalArgumentException], () => 
group.replaceStaticMember(groupInstanceId, memberId, newMemberId, clientId, 
clientHost))
   }
 
   @Test

Review Comment:
   If you agree to my comment 
[here](https://github.com/apache/kafka/pull/14666/files#diff-1c062c229499ca8f215e0088c8ab0dfee768025cd3b59042132fddf70aef4c0cR1342),
 then can we add a test which validates that the clientId and clientHost gets 
reverted?



##########
core/src/main/scala/kafka/coordinator/group/GroupCoordinator.scala:
##########
@@ -1335,7 +1339,7 @@ private[group] class GroupCoordinator(
 
               // Failed to persist member.id of the given static member, 
revert the update of the static member in the group.
               group.updateMember(knownStaticMember, oldProtocols, 
oldRebalanceTimeoutMs, oldSessionTimeoutMs, null)
-              val oldMember = group.replaceStaticMember(groupInstanceId, 
newMemberId, oldMemberId)
+              val oldMember = group.replaceStaticMember(groupInstanceId, 
newMemberId, oldMemberId, clientId, clientHost)

Review Comment:
   IIUC, `clientId` and `clientHost` are applicable for the replacing member. 
In this case, when the persistence of the new static member failed, we need to 
reset the client id and client host to the older one. WDYT?



-- 
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-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to