Skip to content
Closed
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 @@ -121,12 +121,12 @@ private boolean needDiscard(MessageExt msgExt, int transactionCheckMax) {
}

private boolean needSkip(MessageExt msgExt) {
long valueOfCurrentMinusBorn = System.currentTimeMillis() - msgExt.getBornTimestamp();
if (valueOfCurrentMinusBorn
long valueOfCurrentMinusStore = System.currentTimeMillis() - msgExt.getStoreTimestamp();
if (valueOfCurrentMinusStore
> transactionalMessageBridge.getBrokerController().getMessageStoreConfig().getFileReservedTime()
* 3600L * 1000) {
log.info("Half message exceed file reserved time ,so skip it.messageId {},bornTime {}",
msgExt.getMsgId(), msgExt.getBornTimestamp());
log.info("Half message exceed file reserved time ,so skip it.messageId {},storeTime {}",
msgExt.getMsgId(), msgExt.getStoreTimestamp());
return true;
}
return false;
Expand Down Expand Up @@ -272,29 +272,29 @@ public void check(long transactionTimeout, int transactionCheckMax,
break;
}

long valueOfCurrentMinusBorn = System.currentTimeMillis() - msgExt.getBornTimestamp();
long valueOfCurrentMinusStore = System.currentTimeMillis() - msgExt.getStoreTimestamp();
long checkImmunityTime = transactionTimeout;
String checkImmunityTimeStr = msgExt.getUserProperty(MessageConst.PROPERTY_CHECK_IMMUNITY_TIME_IN_SECONDS);
if (null != checkImmunityTimeStr) {
checkImmunityTime = getImmunityTime(checkImmunityTimeStr, transactionTimeout);
if (valueOfCurrentMinusBorn <= checkImmunityTime) {
if (valueOfCurrentMinusStore <= checkImmunityTime) {
if (checkPrepareQueueOffset(removeMap, doneOpOffset, msgExt, checkImmunityTimeStr)) {
newOffset = i + 1;
i++;
continue;
}
}
} else {
if (0 <= valueOfCurrentMinusBorn && valueOfCurrentMinusBorn <= checkImmunityTime) {
log.debug("New arrived, the miss offset={}, check it later checkImmunity={}, born={}", i,
checkImmunityTime, new Date(msgExt.getBornTimestamp()));
if (0 <= valueOfCurrentMinusStore && valueOfCurrentMinusStore <= checkImmunityTime) {
log.debug("New arrived, the miss offset={}, check it later checkImmunity={}, store={}", i,
checkImmunityTime, new Date(msgExt.getStoreTimestamp()));
break;
}
}
List<MessageExt> opMsg = pullResult == null ? null : pullResult.getMsgFoundList();
boolean isNeedCheck = opMsg == null && valueOfCurrentMinusBorn > checkImmunityTime
|| opMsg != null && opMsg.get(opMsg.size() - 1).getBornTimestamp() - startTime > transactionTimeout
|| valueOfCurrentMinusBorn <= -1;
boolean isNeedCheck = opMsg == null && valueOfCurrentMinusStore > checkImmunityTime
|| opMsg != null && opMsg.get(opMsg.size() - 1).getStoreTimestamp() - startTime > transactionTimeout
|| valueOfCurrentMinusStore <= -1;

if (isNeedCheck) {

Expand Down
Loading