squah-confluent commented on code in PR #23538:
URL: https://github.com/apache/kafka/pull/23538#discussion_r4064727868
##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/classic/ClassicGroupTest.java:
##########
@@ -1050,9 +1052,25 @@ public void testValidateOffsetCommit(short version) {
// Replace static member.
group.replaceStaticMember("instance-id", "member-id", "new-member-id");
- // The old instance id should be fenced.
- assertThrows(FencedInstanceIdException.class,
- () -> group.validateOffsetCommit("member-id", "instance-id", 1,
false, version));
+ // The old instance id should be fenced and the operation logged.
+ try (LogCaptureAppender appender =
LogCaptureAppender.createAndRegister(ClassicGroup.class)) {
+ assertThrows(FencedInstanceIdException.class,
+ () -> group.validateOffsetCommit("member-id", "instance-id",
1, false, version));
+
+ assertEquals(1, appender.getMessages(Level.INFO).stream()
+ .filter(msg -> msg.contains("Request memberId=member-id for
static member with groupInstanceId=instance-id is fenced by existing
memberId=new-member-id during operation offset-commit"))
+ .count());
+ }
+
+ // Same fencing check for a transactional offset commit. The log
should name txn-offset-commit.
Review Comment:
```suggestion
// Same fencing check for a transactional offset commit. The
operation should be logged.
```
--
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]