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 2020/10/08 08:36:16 UTC

[GitHub] [rocketmq] spiritsx opened a new issue #2338: The parameter commitLeastPages is never used

spiritsx opened a new issue #2338:
URL: https://github.com/apache/rocketmq/issues/2338


   The method 'commit0' of class 'MappedFile' have a parameter 'commitLeastPages',but it never used from version 4.5.1(we used) to 4.7.1(the latest)。
   I guess the paramter is used for judge whether to commit that depends on the result 'writePos - this.committedPosition.get()',maybe it looks like ‘writePos - this.committedPosition.get() > commitLeastPages ’。Now the code is 'writePos - this.committedPosition.get() > 0'。
   By the way,I think the local variable lastCommittedPosition can replace 'this.committedPosition.get()' In the above inequality。
   Do you think so?
   ![issue](https://user-images.githubusercontent.com/30772323/95434824-4f8e7000-0984-11eb-9507-800689e1f637.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.

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



[GitHub] [rocketmq] vongosling closed issue #2338: The parameter commitLeastPages is never used

Posted by GitBox <gi...@apache.org>.
vongosling closed issue #2338:
URL: https://github.com/apache/rocketmq/issues/2338


   


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



[GitHub] [rocketmq] spiritsx commented on issue #2338: The parameter commitLeastPages is never used

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


   > I think you are right. You can submit a pr to fix the issue.
   
   Thanks for your affirmation。The pr was created。


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



[GitHub] [rocketmq] CleverZiv commented on issue #2338: The parameter commitLeastPages is never used

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


   Hello, I have a question about this:
   commitLeastPages and writePos - lastCommittedPosition are two-dimensional variables,why this judgment can achieve the purpose that determine whether to commit or not?
   by the way, the method MappedFile#isAbleToCommit has similar logic, the code:
   
           int flush = this.committedPosition.get();
           int write = this.wrotePosition.get();
           ...
           if (commitLeastPages > 0) {
               return ((write / OS_PAGE_SIZE) - (flush / OS_PAGE_SIZE)) >= commitLeastPages;
           }
   I mean write / OS_PAGE_SIZE and commitLeastPages are the same dimensional variables
   Looking forward to your reply, thank you~


-- 
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] RongtongJin commented on issue #2338: The parameter commitLeastPages is never used

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


   I think you are right. You can submit a pr to fix the 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



[GitHub] [rocketmq] CleverZiv commented on issue #2338: The parameter commitLeastPages is never used

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


   Hello, I have a question about this:
   commitLeastPages and writePos - lastCommittedPosition are two-dimensional variables,why this judgment can achieve the purpose that determine whether to commit or not?
   by the way, the method MappedFile#isAbleToCommit has similar logic, the code:
   
           int flush = this.committedPosition.get();
           int write = this.wrotePosition.get();
           ...
           if (commitLeastPages > 0) {
               return ((write / OS_PAGE_SIZE) - (flush / OS_PAGE_SIZE)) >= commitLeastPages;
           }
   I mean write / OS_PAGE_SIZE and commitLeastPages are the same dimensional variables
   Looking forward to your reply, thank you~


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