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/04/15 08:01:36 UTC

[GitHub] [rocketmq] iamqq23ue commented on a diff in pull request #3382: FIX ISSUE#2706 the problem of returning SEND_OK after flush failed,The original pull request was #2707.

iamqq23ue commented on code in PR #3382:
URL: https://github.com/apache/rocketmq/pull/3382#discussion_r851130744


##########
store/src/main/java/org/apache/rocketmq/store/MappedFile.java:
##########
@@ -288,6 +289,7 @@ public int flush(final int flushLeastPages) {
                     }
                 } catch (Throwable e) {
                     log.error("Error occurred when force data to disk.", e);
+                    this.flushError = true;

Review Comment:
   > It's ok for some users that data is written on the disk eventually. Changing this default behavior have too much compact on the compatibility. IMHO, maybe adding an optional config to enable this fast failure feature on disk error?
   
   我目前还没有办法模拟偶尔的存储故障,制造故障后一般都需要重启解决。如果增加一行this.flushError = false;,应该可以达到您说的偶尔故障后自动恢复吧
                      **this.flushError = false;**
                       if (writeBuffer != null || this.fileChannel.position() != 0) {
                           this.fileChannel.force(false);
                       } else {
                           this.mappedByteBuffer.force();
                       }
                   } catch (Throwable e) {
                       log.error("Error occurred when force data to disk.", e);
                       this.flushError = true;
                   }



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