Dovelol opened a new issue #2489: URL: https://github.com/apache/rocketmq/issues/2489
1. Please describe the issue you observed: Why the initial value of the `indexCount` field of the `IndexHeader` class is 1 instead of 0? In the `putKey` method of IndexFile class, constant `IndexHeader.INDEX_HEADER_SIZE`=40-byte, constant `this.hashSlotNum * hashSlotSize`=20000000-byte, then Index data should start writing data from 20000040 position, but in the source code, data is written starting from 20000060 position. This will result in a 20-byte gap. I think if the meaning of the `indexCount` field is the number of index data currently written, then the initial value of `indexCount` should be 0, so that the `indexCount` field is increased by 1 after the `putkey` method. And the `indexNum` field 2000w also represents the largest number of index data, instead of actually only storing 19999999 index data. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: [email protected]
