You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/02/19 18:33:02 UTC

[GitHub] [rocketmq] HScarb opened a new issue #3868: Load indexfile from abnormal abort may lose index data

HScarb opened a new issue #3868:
URL: https://github.com/apache/rocketmq/issues/3868


   In IndexService#load
   ```java
                       IndexFile f = new IndexFile(file.getPath(), this.hashSlotNum, this.indexNum, 0, 0);
                       f.load();
   
                       if (!lastExitOK) {
                           if (f.getEndTimestamp() > this.defaultMessageStore.getStoreCheckpoint()
                               .getIndexMsgTimestamp()) {
                               f.destroy(0);
                               continue;
                           }
                       }
   
                       log.info("load index file OK, " + f.getFileName());
                       this.indexFileList.add(f);
   
   ```
   
   * `f.getEndTimestamp()` indicates file's last write timestamp
   * `indexMsgTimestamp` in `StoreCheckpoint` indicates  indexfile last flush timestamp
   
   Consider a situation that index file last write timestamp is later than flush timestamp, but first write timestamp is earlier than flush timestamp, what will happen is that the file with some valid data will be destroy and some index data will be lost.
   
   ![image](https://user-images.githubusercontent.com/10664298/154814185-0f415404-379e-4cdf-8bd7-f57b68ae2371.png)
   
   Is this design like so or it is a bug?


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [rocketmq] WJL3333 commented on issue #3868: Load indexfile from abnormal abort may lose index data

Posted by GitBox <gi...@apache.org>.
WJL3333 commented on issue #3868:
URL: https://github.com/apache/rocketmq/issues/3868#issuecomment-1046229261


   i think you are right. the current recover logic only cover consumer queue, the index service recovery is not involved.
   
   


-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org