You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by ji...@apache.org on 2022/05/14 03:33:51 UTC

[rocketmq] branch develop updated: [ISSUE #3962] Fix variable name in MappedFile#isAbleToCommit() (#4312)

This is an automated email from the ASF dual-hosted git repository.

jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new b79859778 [ISSUE #3962] Fix variable name in MappedFile#isAbleToCommit() (#4312)
b79859778 is described below

commit b79859778e7fdc34e742a8b0ae107da4da061de3
Author: Jack Tsai <ja...@outlook.com>
AuthorDate: Sat May 14 11:33:46 2022 +0800

    [ISSUE #3962] Fix variable name in MappedFile#isAbleToCommit() (#4312)
    
    Co-authored-by: tsunghanjacktsai <ts...@apache.com>
---
 store/src/main/java/org/apache/rocketmq/store/MappedFile.java | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/store/src/main/java/org/apache/rocketmq/store/MappedFile.java b/store/src/main/java/org/apache/rocketmq/store/MappedFile.java
index f07031499..eb59fbb7c 100644
--- a/store/src/main/java/org/apache/rocketmq/store/MappedFile.java
+++ b/store/src/main/java/org/apache/rocketmq/store/MappedFile.java
@@ -371,7 +371,7 @@ public class MappedFile extends ReferenceResource {
     }
 
     protected boolean isAbleToCommit(final int commitLeastPages) {
-        int flush = this.committedPosition.get();
+        int commit = this.committedPosition.get();
         int write = this.wrotePosition.get();
 
         if (this.isFull()) {
@@ -379,10 +379,10 @@ public class MappedFile extends ReferenceResource {
         }
 
         if (commitLeastPages > 0) {
-            return ((write / OS_PAGE_SIZE) - (flush / OS_PAGE_SIZE)) >= commitLeastPages;
+            return ((write / OS_PAGE_SIZE) - (commit / OS_PAGE_SIZE)) >= commitLeastPages;
         }
 
-        return write > flush;
+        return write > commit;
     }
 
     public int getFlushedPosition() {