rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

slave broker print "ReputMessageService - findMappedFileByOffset failure" error continually in storeerror.log

Open jeffchanjunwei opened this issue 5 years ago • 4 comments

The issue tracker is ONLY used for bug report(feature request need to follow RIP process). Keep in mind, please check whether there is an existing same report before your raise a new one.

Alternately (especially if your communication is not a bug report), you can send mail to our mailing lists. We welcome any friendly suggestions, bug fixes, collaboration and other improvements.

Please ensure that your bug report is clear and that it is complete. Otherwise, we may be unable to understand it or to reproduce it, either of which would prevent us from fixing the bug. We strongly recommend the report(bug report or feature request) could include some hints as the following:

BUG REPORT

  1. Please describe the issue you observed:

one of the slave broker print the the follow error in storeerror.log

ReputMessageService - Offset for /home/rocketmq/data/master/store/commitlog/00000000813896302592 not matched. Request offset: 519462681834, index: -275, mappedFileSize: 1073741824, mappedFiles count: 13
ReputMessageService - findMappedFileByOffset failure. 
java.lang.ArrayIndexOutOfBoundsException: -275
	at java.util.concurrent.CopyOnWriteArrayList.get(CopyOnWriteArrayList.java:387) ~[na:1.8.0_45]
	at java.util.concurrent.CopyOnWriteArrayList.get(CopyOnWriteArrayList.java:396) ~[na:1.8.0_45]
	at org.apache.rocketmq.store.MappedFileQueue.findMappedFileByOffset(MappedFileQueue.java:478) ~[rocketmq-store-4.2.0.jar:4.2.0]
	at org.apache.rocketmq.store.CommitLog.getData(CommitLog.java:148) [rocketmq-store-4.2.0.jar:4.2.0]
	at org.apache.rocketmq.store.CommitLog.getData(CommitLog.java:143) [rocketmq-store-4.2.0.jar:4.2.0]
	at org.apache.rocketmq.store.DefaultMessageStore$ReputMessageService.doReput(DefaultMessageStore.java:1751) [rocketmq-store-4.2.0.jar:4.2.0]
	at org.apache.rocketmq.store.DefaultMessageStore$ReputMessageService.run(DefaultMessageStore.java:1818) [rocketmq-store-4.2.0.jar:4.2.0]
	at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]
  1. Please tell us about your environment:

version: 4.2.0 cluster info: 4 async_master, 4 slave, async flush disk mode

jeffchanjunwei avatar Apr 07 '21 05:04 jeffchanjunwei

This is because reputFromOffset is less than the minimum storage location of the slave broker。You can disable writing to this group of brokers, slave broker, and then clear all stored files on the slave broker,re-restoring synchronization

panzhi33 avatar Apr 07 '21 08:04 panzhi33

This is because reputFromOffset is less than the minimum storage location of the slave broker。You can disable writing to this group of brokers, slave broker, and then clear all stored files on the slave broker,re-restoring synchronization

Is it practicable for clear all stored files in slave broker with large stored data? It is needed to restart the slave broker?

jeffchanjunwei avatar Apr 07 '21 08:04 jeffchanjunwei

This is because reputFromOffset is less than the minimum storage location of the slave broker。You can disable writing to this group of brokers, slave broker, and then clear all stored files on the slave broker,re-restoring synchronization

Is it practicable for clear all stored files in slave broker with large stored data? It is needed to restart the slave broker?

Need to restart。 1,disable writing to this group of brokers 2,stop the slave broker,if the cluster tps not is not high,this step can wait 3 days,wait for all the messages to be consumed and the message is saved for 3 days by default 3,clear all stored files 4,start the slave broker 5,turn on writing

panzhi33 avatar Apr 07 '21 10:04 panzhi33

This is because reputFromOffset is less than the minimum storage location of the slave broker。You can disable writing to this group of brokers, slave broker, and then clear all stored files on the slave broker,re-restoring synchronization

Is it practicable for clear all stored files in slave broker with large stored data? It is needed to restart the slave broker?

Need to restart。 1,disable writing to this group of brokers 2,stop the slave broker,if the cluster tps not is not high,this step can wait 3 days,wait for all the messages to be consumed and the message is saved for 3 days by default 3,clear all stored files 4,start the slave broker 5,turn on writing

thanks. Explaination is very clear.

jeffchanjunwei avatar Apr 07 '21 11:04 jeffchanjunwei