-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: PL debugging error: call dbms_debug.attach_session() failed #280
Labels
Milestone
Comments
smallsheeeep
added
type-bug
Something isn't working
priority-medium
module-PL debugger
labels
Sep 8, 2023
as you can see in ODC 4.2.0 AbstractDebugSession: // AbstractDebugSession#acquireNewConnection
protected void acquireNewConnection(ConnectionSession connectionSession, boolean useCurrentSession)
throws Exception {
...
if (!useCurrentSession) {
this.newDataSource = acquireDirectConnectDataSource();
}
this.jdbcOperations = new JdbcTemplate(this.newDataSource);
this.connection = newDataSource.getConnection();
}
// AbstractDebugSession#acquireDirectConnectDataSource
private SingleConnectionDataSource acquireDirectConnectDataSource() {
List<OdcDBSession> sessions = connectionSession.getSyncJdbcExecutor(ConnectionSessionConstants.CONSOLE_DS_KEY)
.query("show full processlist", new OdcDBSessionRowMapper());
ConnectionConfig connectionConfig =
(ConnectionConfig) ConnectionSessionUtil.getConnectionConfig(connectionSession);
if (sessions.size() == 0) {
throw new UnexpectedException("Empty db session list");
}
String directServerIp = null;
for (OdcDBSession odcDbSession : sessions) {
if (StringUtils.isNotBlank(odcDbSession.getSvrIp())) {
directServerIp = odcDbSession.getSvrIp();
break;
}
}
if (StringUtils.isEmpty(directServerIp)) {
throw new UnexpectedException("Empty direct server ip and port from 'show full processlist'");
}
String host = directServerIp.split(":")[0];
int port = Integer.parseInt(directServerIp.split(":")[1]);
return acquireDataSource(connectionConfig, host, port, connectionSession);
} odc will execute // DebuggeeSession
public DebuggeeSession(ConnectionSession connectionSession, ThreadPoolExecutor debugThreadPoolExecutor,
StartPLDebugReq req) throws Exception {
acquireNewConnection(connectionSession, false);
...
} odc will connect to observer without direct link for // DebuggerSession
public DebuggerSession(DebuggeeSession debuggeeSession, StartPLDebugReq req, boolean syncEnabled)
throws Exception {
debugId = debuggeeSession.getDebugId();
debugType = req.getDebugType();
ddl = req.getAnonymousBlock();
this.syncEnabled = syncEnabled;
acquireNewConnection(debuggeeSession.getConnectionSession(), true);
...
} therefore, |
this pr may fix this issue #254 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ODC version
4.2.0
OB version
4.2
What happened?
ODC debugging PL, a single node is abnormal. After observer upgraded the repair package (4.2.0.0-100020012023090710), the problem of debugging automatically jumping out without reporting an exception has not recurred. However, the above problem will occur when debugging directly connected to one of the nodes (10.xxx.xxx.33). Directly connected to another one (10.xxx.xxx.30) will not.
What did you expect to happen?
Start PL debug successfully
How can we reproduce it (as minimally and precisely as possible)?
Anything else we need to know?
OBServer 日志:
ODC 日志:
Cloud
No response
The text was updated successfully, but these errors were encountered: