dajac commented on code in PR #19744:
URL: https://github.com/apache/kafka/pull/19744#discussion_r2093526281


##########
core/src/test/scala/unit/kafka/server/OffsetFetchRequestTest.scala:
##########
@@ -527,4 +527,88 @@ class OffsetFetchRequestTest(cluster: ClusterInstance) 
extends GroupCoordinatorB
       )
     }
   }
+
+  @ClusterTest
+  def testFetchOffsetWithRecreatedTopic(): Unit = {
+    // There are two ways to ensure that committed of recreated topics are not 
returned.
+    // 1) When a topic is deleted, GroupCoordinatorService#onPartitionsDeleted 
is called to
+    //    delete all its committed offsets.
+    // 2) Since version 10 of the OffsetCommit API, the topic id is stored 
alongside the
+    //    committed offset. When it is queried, it is only returned iff the 
topic id of
+    //    committed offset matches the requested one.
+    // The test tests both conditions but not in a deterministic way as they 
race
+    // against each others.

Review Comment:
   I am not happy with this but I don't have a good idea to make it better. I 
was thinking about introducing an internal config/parameter to disable 1) in 
order to test 2) but it feels weird to have this in production code. Thoughts?
   
   I have tested it manually by commenting out 1).



-- 
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