mirror of https://github.com/apache/kafka.git
KAFKA-18263; Group lock must be acquired when reverting static membership rejoin (#18207)
When a static member rejoins the group, the group state is rewritten to the partition in order to persist the change. If the write fails, the change is reverted. However, this is done without acquiring the group lock. This is only try in the old group coordinator. The new one does not suffer from this issue. Reviewers: Jeff Kim <jeff.kim@confluent.io>
This commit is contained in:
parent
4aee33d6ab
commit
a12152f028
|
@ -1384,6 +1384,7 @@ private[group] class GroupCoordinator(
|
|||
info(s"Static member which joins during Stable stage and doesn't affect selectProtocol will not trigger rebalance.")
|
||||
val groupAssignment: Map[String, Array[Byte]] = group.allMemberMetadata.map(member => member.memberId -> member.assignment).toMap
|
||||
groupManager.storeGroup(group, groupAssignment, error => {
|
||||
group.inLock {
|
||||
if (error != Errors.NONE) {
|
||||
warn(s"Failed to persist metadata for group ${group.groupId}: ${error.message}")
|
||||
|
||||
|
@ -1447,6 +1448,7 @@ private[group] class GroupCoordinator(
|
|||
error = Errors.NONE
|
||||
))
|
||||
}
|
||||
}
|
||||
}, requestLocal)
|
||||
} else {
|
||||
maybePrepareRebalance(group, s"Group's selectedProtocol will change because static member ${member.memberId} with instance id $groupInstanceId joined with change of protocol; client reason: $reason")
|
||||
|
|
Loading…
Reference in New Issue