File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
storage/src/test/java/org/apache/kafka/storage/internals/log Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -465,7 +465,7 @@ public void testDeleteOldSegments() throws IOException {
465
465
.withRetentionMs (999 )
466
466
.build ();
467
467
log = createLog (logDir , logConfig );
468
- // avoid close after test because it is closed in this test
468
+ // Avoid close after test because it is deleted in this test. See line 517.
469
469
logsToClose .remove (log );
470
470
471
471
// append some messages to create some segments
@@ -513,6 +513,9 @@ public void testDeleteOldSegments() throws IOException {
513
513
log .appendAsLeader (records .get (), 0 );
514
514
}
515
515
516
+ // bug? Due to log.delete() we can't close the unifiedLog
517
+ // because we delete log and at that moment, and then the memory map is closed.
518
+ // So it will throw KafkaStorageException when closing.
516
519
log .delete ();
517
520
assertEquals (0 , log .numberOfSegments (), "The number of segments should be 0" );
518
521
assertEquals (0 , log .deleteOldSegments (), "The number of deleted segments should be zero." );
You can’t perform that action at this time.
0 commit comments