gitlw commented on code in PR #12029:
URL: https://github.com/apache/kafka/pull/12029#discussion_r851570300


##########
core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala:
##########
@@ -2615,7 +2616,13 @@ class ReplicaManagerTest {
 
   @Test
   def 
testStopReplicaWithDeletePartitionAndExistingPartitionAndNewerLeaderEpochAndIOException():
 Unit = {
-    testStopReplicaWithExistingPartition(2, true, true, 
Errors.KAFKA_STORAGE_ERROR)
+    // 1. Even though we are trying to trigger an IOException by deleting the 
underlying log directory,
+    // the foreground deletion of a replica no longer reads from the 
underlying directory, and thus
+    // should trigger no exceptions. It means the stopReplica operation 
running the foreground
+    // deletion should be able to finish without any errors.
+    // 2. During the background deletion, a FileSystemException will be 
triggered when we try
+    // to delete the log segments, which is then converted to a 
KafkaStorageException.
+    testStopReplicaWithExistingPartition(2, true, true, Errors.NONE, true)

Review Comment:
   There are still tests that expects an error, e.g. 
https://github.com/apache/kafka/blob/f809fccd0246b8263f341634c2e38749b132ef06/core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala#L2630
   
   



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