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 2021/07/02 12:00:06 UTC

[GitHub] [rocketmq] odbozhou commented on issue #3099: The jedgment 'writePos - lastCommittedPosition > commitLeastPages' in the method 'commit0' of class 'MappedFile' is meaningless

odbozhou commented on issue #3099:
URL: https://github.com/apache/rocketmq/issues/3099#issuecomment-872943966


   > I think the jedgment '**writePos - lastCommittedPosition > commitLeastPages**' in the method 'commit0' of class 'MappedFile' is meaningless in the version 4.8.0.
   > ![image](https://user-images.githubusercontent.com/12688996/118827344-dd551500-b8ee-11eb-8a71-6772ef8435a0.png)
   > As you can see. 'writePos - lastCommittedPosition' represents the amount of data that has not been committed, it's in byte. but commitLeastPages represents the least pages(OS_PAGE) should be committed. 'commitLeastPages ' has been determined in method ‘isAbleToCommit’ whether it meets the condition. so '**writePos - lastCommittedPosition > commitLeastPages**' is meaningless, although this expression does not cause errors.
   > I think this expression should be 'writePos - lastCommittedPosition > 0', it used to determine whether there is uncommitted data. Do you think so?
   
   I agree with you very much, can you submit a pr to solve this problem? @xiaoyaofawai 


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