qsrg opened a new issue #3408:
URL: https://github.com/apache/rocketmq/issues/3408
version:4.4.0
When nextOffset of groupCommitRequest is in next mappedFile, it will excute
mappedFileQueue.flush(0) 2 times,but flushOK is first flushed
result(false),actually it mybe true after second flush. This cause producer get
a error send result when a new mappedFile created. After 2 times flush loop,
flushOK should be recheck to get real flush result.
show code:
`
org.apache.rocketmq.store.CommitLog.GroupCommitService#doCommit
`
```
for (GroupCommitRequest req : this.requestsRead) {
// There may be a message in the next file, so a
maximum of
// two times the flush
boolean flushOK = false;
for (int i = 0; i < 2 && !flushOK; i++) {
flushOK =
CommitLog.this.mappedFileQueue.getFlushedWhere() >= req.getNextOffset();
if (!flushOK) {
CommitLog.this.mappedFileQueue.flush(0);
}
}
req.wakeupCustomer(flushOK);
}
```
By adding log between flushed over and wakeupCustomer, confirmed flushOK is
false but CommitLog.this.mappedFileQueue.getFlushedWhere() >
req.getNextOffset(), flushOK is warong.
--
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]