Oliverwqcwrw opened a new issue, #4247:
URL: https://github.com/apache/rocketmq/issues/4247

   
   **BUG REPORT**
   
   1. Please describe the issue you observed:
   
   In `org.apache.rocketmq.store.index.IndexFile#putKey`
   
   > if (this.indexHeader.getIndexCount() <= 1) {
                       this.indexHeader.setBeginPhyOffset(phyOffset);
                       this.indexHeader.setBeginTimestamp(storeTimestamp);
                   }
   
   When the second message is added to the IndexFile, beginPhyOffset and 
beginTimestamp will still be updated because it satisfies indexCount less than 
or equal to 1
   
   - What is expected to see?
   
   > if (this.indexHeader.getIndexCount() < 1) {
                       this.indexHeader.setBeginPhyOffset(phyOffset);
                       this.indexHeader.setBeginTimestamp(storeTimestamp);
                   }if (this.indexHeader.getIndexCount() <= 1) {
                       this.indexHeader.setBeginPhyOffset(phyOffset);
                       this.indexHeader.setBeginTimestamp(storeTimestamp);
                   }
   
   
   
   2. Please tell us about your environment:
   
   version:4.9.3
   


-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to