You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
然后在Recovery时:
for (HmilyParticipant hmilyParticipant : hmilyParticipantList) {
....
这里判断是PRE_TRY,直接continue
if (hmilyParticipant.getStatus() == HmilyActionEnum.PRE_TRY.getCode()) {
//try not complete
continue;
}
final boolean successful = hmilyRepository.lockHmilyParticipant(hmilyParticipant);
// determine that rows > 0 is executed to prevent concurrency when the business side is in cluster mode
if (successful) {
LOGGER.info("hmily tcc transaction begin self recovery: {}", hmilyParticipant.toString());
HmilyTransaction globalHmilyTransaction = hmilyRepository.findByTransId(hmilyParticipant.getTransId());
if (Objects.isNull(globalHmilyTransaction)) {
tccRecovery(hmilyParticipant.getStatus(), hmilyParticipant);
} else {
//这里transaction状态也是PRE_TRY?
tccRecovery(globalHmilyTransaction.getStatus(), hmilyParticipant);
}
}
}
最后没cancel,也没commit,悬挂了?
不知道理解对不对。可能还有其他地方没看到。
The text was updated successfully, but these errors were encountered:
HmilyTransaction hmilyTransaction = executor.preTry(point);
try {
//execute try
returnValue = point.proceed();
hmilyTransaction.setStatus(HmilyActionEnum.TRYING.getCode());
//假设执行到此处宕机,此时Transaction 和 Participant status应该还是PRE_TRY?
executor.updateStartStatus(hmilyTransaction);
然后在Recovery时:
for (HmilyParticipant hmilyParticipant : hmilyParticipantList) {
....
这里判断是PRE_TRY,直接continue
if (hmilyParticipant.getStatus() == HmilyActionEnum.PRE_TRY.getCode()) {
//try not complete
continue;
}
final boolean successful = hmilyRepository.lockHmilyParticipant(hmilyParticipant);
// determine that rows > 0 is executed to prevent concurrency when the business side is in cluster mode
if (successful) {
LOGGER.info("hmily tcc transaction begin self recovery: {}", hmilyParticipant.toString());
HmilyTransaction globalHmilyTransaction = hmilyRepository.findByTransId(hmilyParticipant.getTransId());
if (Objects.isNull(globalHmilyTransaction)) {
tccRecovery(hmilyParticipant.getStatus(), hmilyParticipant);
} else {
//这里transaction状态也是PRE_TRY?
tccRecovery(globalHmilyTransaction.getStatus(), hmilyParticipant);
}
}
}
The text was updated successfully, but these errors were encountered: