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 2019/07/24 11:27:08 UTC

[GitHub] [rocketmq] xiangwangcheng commented on issue #1336: The bug in org.apache.rocketmq.store.DefaultMessageStore#getMessageIds line 1044

xiangwangcheng commented on issue #1336: The bug in org.apache.rocketmq.store.DefaultMessageStore#getMessageIds line 1044
URL: https://github.com/apache/rocketmq/issues/1336#issuecomment-514593362
 
 
   > yeah, we can fix by skip remaining 12 byte
   > 
   > ```java
   >  for (; i < bufferConsumeQueue.getSize(); i += ConsumeQueue.CQ_STORE_UNIT_SIZE) {
   >     long offsetPy = bufferConsumeQueue.getByteBuffer().getLong();
   >     bufferConsumeQueue.getByteBuffer().position(bufferConsumeQueue.getByteBuffer().position() + 12);
   >     final ByteBuffer msgIdMemory = ByteBuffer.allocate(MessageDecoder.MSG_ID_LENGTH);
   >     String msgId =
   >         MessageDecoder.createMessageId(msgIdMemory, MessageExt.socketAddress2ByteBuffer(storeHost), offsetPy);
   >     messageIds.put(msgId, nextOffset++);
   >     if (nextOffset > maxOffset) {
   >         return messageIds;
   >     }
   > }
   > ```
   
   @lazyfighter  position() method means setting the position to the specified value, not skipping. The PR 
   @ChaosYjh did is right.
   
   @zongtanghu Could u please labeled bug to this issue? 

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services