Skip to content

Commit

Permalink
polish
Browse files Browse the repository at this point in the history
  • Loading branch information
fujian-zfj committed Nov 1, 2023
1 parent f6984cc commit 2876500
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions store/src/main/java/org/apache/rocketmq/store/CommitLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -1634,13 +1634,15 @@ private void swapRequests() {
private void doCommit() {
if (!this.requestsRead.isEmpty()) {
for (GroupCommitRequest req : this.requestsRead) {
boolean flushOK = false;
for (int i = 0; i < 1000; i++) {
boolean flushOK = CommitLog.this.mappedFileQueue.getFlushedWhere() >= req.getNextOffset();
for (int i = 0; i < 1000 && !flushOK; i++) {
CommitLog.this.mappedFileQueue.flush(0);
flushOK = CommitLog.this.mappedFileQueue.getFlushedWhere() >= req.getNextOffset();
if (flushOK) {
break;
} else {
// When transientStorePoolEnable is true, the messages in writeBuffer may not be committed
// to pageCache very quickly, and flushOk here may almost be false.
try {
Thread.sleep(1);
} catch (InterruptedException ignored) {
Expand Down

0 comments on commit 2876500

Please sign in to comment.