Details
Description
kafka.tools.DumpLogSegments requires sudo for index files but not for log files. It seems inconsistent why `w` access would be required for the index files just to dump the output.
$ sudo kafka-run-class kafka.tools.DumpLogSegments --files 00000000000000000000.index Dumping 00000000000000000000.index offset: 0 position: 0
$ kafka-run-class kafka.tools.DumpLogSegments --files 00000000000000000000.indexDumping 00000000000000000000.index Exception in thread "main" java.io.FileNotFoundException: 00000000000000000000.index (Permission denied) at java.io.RandomAccessFile.open0(Native Method) at java.io.RandomAccessFile.open(RandomAccessFile.java:316) at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243) at kafka.log.AbstractIndex.<init>(AbstractIndex.scala:50) at kafka.log.OffsetIndex.<init>(OffsetIndex.scala:52) at kafka.tools.DumpLogSegments$.kafka$tools$DumpLogSegments$$dumpIndex(DumpLogSegments.scala:137) at kafka.tools.DumpLogSegments$$anonfun$main$1.apply(DumpLogSegments.scala:100) at kafka.tools.DumpLogSegments$$anonfun$main$1.apply(DumpLogSegments.scala:93) at scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:33) at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:186) at kafka.tools.DumpLogSegments$.main(DumpLogSegments.scala:93) at kafka.tools.DumpLogSegments.main(DumpLogSegments.scala)
Attachments
Issue Links
- links to