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/05/13 07:37:04 UTC

[GitHub] [rocketmq] hzh0425 commented on a diff in pull request #4306: [ISSUE #2706] FIX SEND_OK will still be returned when the storage is abnormal ,which may cause message loss

hzh0425 commented on code in PR #4306:
URL: https://github.com/apache/rocketmq/pull/4306#discussion_r872089791


##########
store/src/main/java/org/apache/rocketmq/store/CommitLog.java:
##########
@@ -1208,7 +1208,12 @@ private void doCommit() {
                         flushOK = CommitLog.this.mappedFileQueue.getFlushedWhere() >= req.getNextOffset();
                     }
 
-                    req.wakeupCustomer(flushOK ? PutMessageStatus.PUT_OK : PutMessageStatus.FLUSH_DISK_TIMEOUT);
+                    if (CommitLog.this.mappedFileQueue.isFlushError()) {
+                        req.wakeupCustomer(PutMessageStatus.FLUSH_DISK_FAILED);
+                    }
+                    else {
+                        req.wakeupCustomer(flushOK ? PutMessageStatus.PUT_OK : PutMessageStatus.FLUSH_DISK_TIMEOUT);
+                    }
                 }

Review Comment:
   May be it's better to format:
   if () {
     xxx
   } else {
     xxx
   }



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