[inner-1586] during the period of the XA, front and back side accidentally disconnect does not affect the XA retry mechanism (#3179)

This commit is contained in:
wenyh
2022-03-17 13:22:52 +08:00
committed by GitHub
parent 1ba473ac46
commit 40d9dba990
2 changed files with 3 additions and 11 deletions
@@ -17,7 +17,6 @@ import com.actiontech.dble.net.connection.FrontendConnection;
import com.actiontech.dble.net.connection.PooledConnection;
import com.actiontech.dble.services.mysqlauthenticate.MySQLBackAuthService;
import com.actiontech.dble.services.mysqlsharding.ShardingService;
import com.actiontech.dble.singleton.XASessionCheck;
import com.actiontech.dble.statistic.CommandCount;
import com.actiontech.dble.util.TimeUtil;
import org.slf4j.Logger;
@@ -153,13 +152,8 @@ public final class IOProcessor {
ShardingService s = (ShardingService) c.getService();
String xaStage = s.getSession2().getTransactionManager().getXAStage();
if (xaStage != null) {
if (!xaStage.equals(XAStage.COMMIT_FAIL_STAGE)) {
// Active/IDLE/PREPARED XA FrontendS will be rollbacked
if (!xaStage.equals(XAStage.COMMIT_FAIL_STAGE) && !xaStage.equals(XAStage.ROLLBACK_FAIL_STAGE)) {
s.getConnection().close("Close Timeout");
XASessionCheck.getInstance().addRollbackSession(s.getSession2());
} else {
s.getConnection().close("Close Timeout");
XASessionCheck.getInstance().addCommitSession(s.getSession2());
}
continue;
}
@@ -173,9 +167,7 @@ public final class IOProcessor {
String xaStage = s.getSession2().getTransactionManager().getXAStage();
if (xaStage != null) {
if (!xaStage.equals(XAStage.COMMIT_FAIL_STAGE) && !xaStage.equals(XAStage.ROLLBACK_FAIL_STAGE)) {
// Active/IDLE/PREPARED XA FrontendS will be rollbacked
s.getConnection().close("Idle Timeout");
XASessionCheck.getInstance().addRollbackSession(s.getSession2());
}
continue;
}
@@ -63,7 +63,7 @@ public final class XASessionCheck {
return commitSession;
}
public ConcurrentMap<Long, NonBlockingSession> getRollbackingSession() {
public ConcurrentMap<Long, NonBlockingSession> getRollbackSession() {
return rollbackSession;
}
@@ -71,7 +71,7 @@ public final class XASessionCheck {
return committingSession;
}
public ConcurrentMap<Long, NonBlockingSession> getRollbackSession() {
public ConcurrentMap<Long, NonBlockingSession> getRollbackingSession() {
return rollbackingSession;
}