fix: the split command will not be controlled by idleTime

This commit is contained in:
guoaomen
2021-12-13 10:55:44 +08:00
parent 6e57dc11cf
commit fc4c1d8de5
2 changed files with 7 additions and 1 deletions
@@ -90,7 +90,10 @@ public class FrontendConnection extends AbstractConnection {
public boolean isIdleTimeout() {
if (!(getService() instanceof AuthService)) {
if (isSkipCheck() && (lastReadTime > lastWriteTime)) {
if (isManager && skipCheck) {
//split
return false;
} else if (isSkipCheck() && (lastReadTime > lastWriteTime)) {
return false;
}
return TimeUtil.currentTimeMillis() > Math.max(lastWriteTime, lastReadTime) + idleTimeout;
@@ -126,6 +126,7 @@ public class ManagerQueryHandler {
DbGroupHAHandler.handle(sql, service, rs >> SHIFT);
break;
case ManagerParse.SPLIT:
service.getConnection().setSkipCheck(true);
service.getClusterDelayService().markDoingOrDelay(true);
SplitDumpHandler.handle(sql, service, rs >>> SHIFT);
break;
@@ -173,6 +174,8 @@ public class ManagerQueryHandler {
} catch (Exception e) {
service.writeErrMessage(ErrorCode.ER_YES, "get error call manager command: " + e.getMessage());
LOGGER.warn("unknown error:", e);
} finally {
service.getConnection().setSkipCheck(false);
}
}