wqliang commented on a change in pull request #1536: [ISSUE #1535] Fix ha sync
transfer timeout
URL: https://github.com/apache/rocketmq/pull/1536#discussion_r336332173
##########
File path: store/src/main/java/org/apache/rocketmq/store/ha/HAService.java
##########
@@ -280,9 +280,14 @@ private void doWaitTransfer() {
if (!this.requestsRead.isEmpty()) {
for (CommitLog.GroupCommitRequest req : this.requestsRead)
{
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) {
Review comment:
Got it. It may be better and more clear to check transferOk in the condition
of while.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services