Details
Description
After a log index file lost or be removed when kafka server is running,then some one calls OffsetIndex.resize(newSize: Int) .It will cause a new index file be created but there is no values in it,even though the size is same with old one.
It will do something as below.
val raf = new RandomAccessFile(file, "rw")
This time file does not exit.It will create a new file.
Then at:
mmap = raf.getChannel().map(FileChannel.MapMode.READ_WRITE, 0, roundedNewSize)
The mmap is created from new file which is empty.
and then:
mmap.position(position)
This make the new index file which size is same with old index file,but there is nothing in it.
Attachments
Issue Links
- links to