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


##########
core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala:
##########
@@ -2703,6 +2711,26 @@ class ReplicaManagerTest {
       assertEquals(HostedPartition.None, replicaManager.getPartition(tp0))
       assertFalse(readRecoveryPointCheckpoint().contains(tp0))
       assertFalse(readLogStartOffsetCheckpoint().contains(tp0))
+
+      // verify that there is log to be deleted
+      val logsToBeDeleted = replicaManager.logManager.logsToBeDeleted

Review Comment:
   The call hierarchy for the method deleteLogs is
   LogManager.deleteLogs()  (kafka.log)
   LogManager.startupWithConfigOverrides(LogConfig, Map<String, LogConfig>)  
(kafka.log)
   LogManager.startup(Set<String>)  (kafka.log)
   
   Currently, the tests in this file didn't trigger LogManager.startup, and 
therefore the scheduler is effectively not used. I feel the way of testing the 
background deletion in this PR is actually more direct for capturing the 
KafkaStorageException. Please let me know if I'm missing something.



##########
core/src/test/scala/unit/kafka/server/ReplicaManagerTest.scala:
##########
@@ -2703,6 +2711,26 @@ class ReplicaManagerTest {
       assertEquals(HostedPartition.None, replicaManager.getPartition(tp0))
       assertFalse(readRecoveryPointCheckpoint().contains(tp0))
       assertFalse(readLogStartOffsetCheckpoint().contains(tp0))
+
+      // verify that there is log to be deleted
+      val logsToBeDeleted = replicaManager.logManager.logsToBeDeleted

Review Comment:
   The call hierarchy for the method deleteLogs is
   ```
   LogManager.deleteLogs()  (kafka.log)
   LogManager.startupWithConfigOverrides(LogConfig, Map<String, LogConfig>)  
(kafka.log)
   LogManager.startup(Set<String>)  (kafka.log)
   ```
   
   Currently, the tests in this file didn't trigger LogManager.startup, and 
therefore the scheduler is effectively not used. I feel the way of testing the 
background deletion in this PR is actually more direct for capturing the 
KafkaStorageException. Please let me know if I'm missing something.



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