suzhiking commented on code in PR #23530:
URL: https://github.com/apache/kafka/pull/23530#discussion_r4074914429


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupMetadataManager.java:
##########
@@ -5927,14 +5927,19 @@ public void replay(
                 return;
             }
 
-            if (oldMember.memberEpoch() != LEAVE_GROUP_MEMBER_EPOCH) {
-                throw new IllegalStateException("Received a tombstone record 
to delete member " + memberId
-                    + " but did not receive 
ConsumerGroupCurrentMemberAssignmentValue tombstone.");
-            }
-            if (consumerGroup.targetAssignment().containsKey(memberId)) {
-                throw new IllegalStateException("Received a tombstone record 
to delete member " + memberId
-                    + " but did not receive 
ConsumerGroupTargetAssignmentMetadataValue tombstone.");
+            if (oldMember.memberEpoch() != LEAVE_GROUP_MEMBER_EPOCH || 
consumerGroup.targetAssignment().containsKey(memberId)) {
+                List<String> reasons = new ArrayList<>();
+                if (oldMember.memberEpoch() != LEAVE_GROUP_MEMBER_EPOCH) {
+                    reasons.add("has invalid leave group epoch");
+                }
+                if (consumerGroup.targetAssignment().containsKey(memberId)) {
+                    reasons.add("member exists in target assignment");
+                }
+                log.warn("Received a tombstone record to delete consumer group 
member {} but member {};" +
+                        " the sibling tombstones were likely removed by 
compaction.",
+                    memberId, String.join(" and ", reasons));
             }
+
             consumerGroup.removeMember(memberId);

Review Comment:
   updated PR with cleanup



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to