Skip to content

Commit

Permalink
fix(replica): resolve abnormal slow recover
Browse files Browse the repository at this point in the history
Add PhysicMsgTimestamp update logic when replicas recovering from the abnormal case.

Closes alibaba#1456
  • Loading branch information
vongosling authored Sep 17, 2019
2 parents 90bbda8 + f590bd5 commit 523b60c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import org.apache.rocketmq.common.constant.LoggerName;
import org.apache.rocketmq.logging.InternalLogger;
import org.apache.rocketmq.logging.InternalLoggerFactory;
import org.apache.rocketmq.store.config.BrokerRole;
import org.apache.rocketmq.store.config.StorePathConfigHelper;

public class ConsumeQueue {
Expand Down Expand Up @@ -397,6 +398,10 @@ public void putMessagePositionInfoWrapper(DispatchRequest request) {
boolean result = this.putMessagePositionInfo(request.getCommitLogOffset(),
request.getMsgSize(), tagsCode, request.getConsumeQueueOffset());
if (result) {
if (this.defaultMessageStore.getMessageStoreConfig().getBrokerRole() == BrokerRole.SLAVE ||
this.defaultMessageStore.getMessageStoreConfig().isEnableDLegerCommitLog()) {
this.defaultMessageStore.getStoreCheckpoint().setPhysicMsgTimestamp(request.getStoreTimestamp());
}
this.defaultMessageStore.getStoreCheckpoint().setLogicsMsgTimestamp(request.getStoreTimestamp());
return;
} else {
Expand Down

0 comments on commit 523b60c

Please sign in to comment.