Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ public void putMessagePositionInfoWrapper(DispatchRequest request) {
this.messageStore.getMessageStoreConfig().isEnableDLegerCommitLog()) {
this.messageStore.getStoreCheckpoint().setPhysicMsgTimestamp(request.getStoreTimestamp());
}
this.messageStore.getStoreCheckpoint().setLogicsMsgTimestamp(request.getStoreTimestamp());
this.messageStore.getStoreCheckpoint().setTmpLogicsMsgTimestamp(request.getStoreTimestamp());
if (MultiDispatchUtils.checkMultiDispatchQueue(this.messageStore.getMessageStoreConfig(), request)) {
multiDispatchLmqQueue(request, maxRetries);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public class StoreCheckpoint {
private final RandomAccessFile randomAccessFile;
private final FileChannel fileChannel;
private final MappedByteBuffer mappedByteBuffer;
private volatile long tmpLogicsMsgTimestamp = 0;
private volatile long physicMsgTimestamp = 0;
private volatile long logicsMsgTimestamp = 0;
private volatile long indexMsgTimestamp = 0;
Expand Down Expand Up @@ -112,6 +113,14 @@ public void setLogicsMsgTimestamp(long logicsMsgTimestamp) {
this.logicsMsgTimestamp = logicsMsgTimestamp;
}

public long getTmpLogicsMsgTimestamp() {
return tmpLogicsMsgTimestamp;
}

public void setTmpLogicsMsgTimestamp(long tmpLogicsMsgTimestamp) {
this.tmpLogicsMsgTimestamp = tmpLogicsMsgTimestamp;
}

public long getConfirmPhyOffset() {
return confirmPhyOffset;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ public void putMessagePositionInfoWrapper(DispatchRequest request) {
if (BrokerRole.SLAVE == this.messageStore.getMessageStoreConfig().getBrokerRole()) {
this.messageStore.getStoreCheckpoint().setPhysicMsgTimestamp(request.getStoreTimestamp());
}
this.messageStore.getStoreCheckpoint().setLogicsMsgTimestamp(request.getStoreTimestamp());
this.messageStore.getStoreCheckpoint().setTmpLogicsMsgTimestamp(request.getStoreTimestamp());
return;
} else {
// XXX: warn and notify me
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,23 +648,25 @@ private void doFlush(int retryTimes) {
if (currentTimeMillis >= (this.lastFlushTimestamp + flushConsumeQueueThoroughInterval)) {
this.lastFlushTimestamp = currentTimeMillis;
flushConsumeQueueLeastPages = 0;
logicsMsgTimestamp = messageStore.getStoreCheckpoint().getLogicsMsgTimestamp();
logicsMsgTimestamp = messageStore.getStoreCheckpoint().getTmpLogicsMsgTimestamp();
}

boolean flushOK = true;
for (ConcurrentMap<Integer, ConsumeQueueInterface> maps : consumeQueueTable.values()) {
for (ConsumeQueueInterface cq : maps.values()) {
boolean result = false;
for (int i = 0; i < retryTimes && !result; i++) {
result = flush(cq, flushConsumeQueueLeastPages);
}
flushOK &= result;
}
}

if (messageStoreConfig.isEnableCompaction()) {
messageStore.getCompactionStore().flush(flushConsumeQueueLeastPages);
}

if (0 == flushConsumeQueueLeastPages) {
if (flushOK && 0 == flushConsumeQueueLeastPages) {
if (logicsMsgTimestamp > 0) {
messageStore.getStoreCheckpoint().setLogicsMsgTimestamp(logicsMsgTimestamp);
}
Expand Down
Loading