When you have kafka started up error like
[2019-10-24 15:50:13,057] ERROR Failed to clean up log for __consumer_offsets-45 in dir D:\tmp\kafka-logs due to IOException (kafka.server.LogDirFailureChannel)
java.nio.file.FileSystemException: D:\tmp\kafka-logs\__consumer_offsets-45\00000000000000000000.timeindex.cleaned: The process cannot access the file because it is being used by another process.
at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)
at sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:108)
at java.nio.file.Files.deleteIfExists(Files.java:1165)
at kafka.log.Log$.deleteFileIfExists(Log.scala:2293)
at kafka.log.LogSegment$.deleteIfExists(LogSegment.scala:682)
at kafka.log.LogCleaner$.createNewCleanedSegment(LogCleaner.scala:433)
at kafka.log.Cleaner.cleanSegments(LogCleaner.scala:556)
at kafka.log.Cleaner.$anonfun$doClean$6(LogCleaner.scala:528)
at kafka.log.Cleaner.$anonfun$doClean$6$adapted(LogCleaner.scala:527)
at scala.collection.immutable.List.foreach(List.scala:392)
at kafka.log.Cleaner.doClean(LogCleaner.scala:527)
at kafka.log.Cleaner.clean(LogCleaner.scala:501)
at kafka.log.LogCleaner$CleanerThread.cleanLog(LogCleaner.scala:359)
at kafka.log.LogCleaner$CleanerThread.cleanFilthiestLog(LogCleaner.scala:328)
at kafka.log.LogCleaner$CleanerThread.doWork(LogCleaner.scala:307)
at kafka.utils.ShutdownableThread.run(ShutdownableThread.scala:89)
[2019-10-24 15:50:13,097] INFO [ExpirationReaper-0-Produce]: Starting (kafka.server.DelayedOperationPurgatory$ExpiredOperationReaper)
You need to delete the lock file
D:\tmp\kafka-logs.lock
and delete some other extra file in that particular "offset".
Only keep
00000000000000000000.index
00000000000000000000.log
00000000000000000000.timeindex
leader-epoch-checkpoint
No comments:
Post a Comment