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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]