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/10/13 14:28:58 UTC

[GitHub] [rocketmq] nowinkeyy opened a new issue, #5307: Whether the if statement is redundant?

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

   **In ```org/apache/rocketmq/store/DefaultMessageStore.java```**
   
   **Run twice the ```if (this.getMessageStoreConfig().isDuplicationEnable())```**
   
   ![image](https://user-images.githubusercontent.com/72536832/195623048-11eedda0-feff-4d70-b0a7-a68566a4ca2a.png)
   
   ![image](https://user-images.githubusercontent.com/72536832/195623226-a712c2bb-601f-49e3-8c88-2ba7ed3311a1.png)
   


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

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


[GitHub] [rocketmq] codersfarm commented on issue #5307: Whether the if statement is redundant?

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

   When the broker is recover, `if (this.getMessageStoreConfig().isDuplicationEnable())` maybe is not redundant. The other's sence,  i think it is redundant.


-- 
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] complone commented on issue #5307: Whether the if statement is redundant?

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

   Hello, I think it is necessary to enable the configuration here. The scenario used by this configuration is that when the message is written, the system has a thread that can do some other logic to the message. For example: build indexes, consume queues, notify long pull client requests. The thread will maintain a message index, and compare this index with the maximum offset of the current maximum written message to get whether there is a message that needs to be processed.
   
   When the system restarts, it will be based on duplicationEnable to decide whether to process the message from the beginning or only process the new message. When duplicationEnable is true, you also need to set CommitLog.confirmOffset to process the message from the beginning, because by default, CommitLog.confirmOffset and ReputMessageService.reputFromOffset are equal after the system is started. For details, see the code ReputMessageService.doReput.


-- 
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] nowinkeyy commented on issue #5307: Whether the if statement is redundant?

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

   Hi @complone , thank you for your reply.
   I know what you mean. IMO, it is sufficient to run ```getConfirmOffset()``` directly because it includes ```isDuplicationEnable()``` without running ```isDuplicationEnable()``` before running ```getConfirmOffset()```.


-- 
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] lizhanhui closed issue #5307: Whether the if statement is redundant?

Posted by GitBox <gi...@apache.org>.
lizhanhui closed issue #5307: Whether the if statement is redundant?
URL: https://github.com/apache/rocketmq/issues/5307


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

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