jolshan commented on code in PR #15155:
URL: https://github.com/apache/kafka/pull/15155#discussion_r1448140837
##########
group-coordinator/src/test/java/org/apache/kafka/coordinator/group/OffsetMetadataManagerTest.java:
##########
@@ -1963,6 +2080,75 @@ public void
testFetchAllOffsetsAtDifferentCommittedOffset() {
), context.fetchAllOffsets("group", Long.MAX_VALUE));
}
+ @Test
+ public void testFetchAllOffsetsWithPendingTransactionalOffsets() {
+ OffsetMetadataManagerTestContext context = new
OffsetMetadataManagerTestContext.Builder().build();
+
+ context.groupMetadataManager.getOrMaybeCreateConsumerGroup("group",
true);
+
+ context.commitOffset("group", "foo", 0, 100L, 1);
+ context.commitOffset("group", "foo", 1, 110L, 1);
+ context.commitOffset("group", "bar", 0, 200L, 1);
+
+ context.commit();
+
+ assertEquals(3, context.lastWrittenOffset);
+ assertEquals(3, context.lastCommittedOffset);
+
+ context.commitOffset(10L, "group", "foo", 1, 111L, 1,
context.time.milliseconds());
+ context.commitOffset(10L, "group", "bar", 0, 201L, 1,
context.time.milliseconds());
+
+ // Fetching offsets with "require stable" (Long.MAX_VALUE) should
return the UNSTABLE_OFFSET_COMMIT
+ // errors for foo-1 and bar-0.
Review Comment:
ditto with the comments for expectations for foo-0
--
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]