提交 85a6cc1c 编写于 作者: W wqliang

fix ha sync transfer timeout

上级 7c469fe9
...@@ -280,9 +280,14 @@ public class HAService { ...@@ -280,9 +280,14 @@ public class HAService {
if (!this.requestsRead.isEmpty()) { if (!this.requestsRead.isEmpty()) {
for (CommitLog.GroupCommitRequest req : this.requestsRead) { for (CommitLog.GroupCommitRequest req : this.requestsRead) {
boolean transferOK = HAService.this.push2SlaveMaxOffset.get() >= req.getNextOffset(); boolean transferOK = HAService.this.push2SlaveMaxOffset.get() >= req.getNextOffset();
for (int i = 0; !transferOK && i < 5; i++) { long waitUntillWhen = HAService.this.defaultMessageStore.getSystemClock().now()
+ HAService.this.defaultMessageStore.getMessageStoreConfig().getSyncFlushTimeout();
while (HAService.this.defaultMessageStore.getSystemClock().now() < waitUntillWhen) {
this.notifyTransferObject.waitForRunning(1000); this.notifyTransferObject.waitForRunning(1000);
transferOK = HAService.this.push2SlaveMaxOffset.get() >= req.getNextOffset(); transferOK = HAService.this.push2SlaveMaxOffset.get() >= req.getNextOffset();
if (transferOK) {
break;
}
} }
if (!transferOK) { if (!transferOK) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册