Add log to solve tg_cancel_fail in mysql_connection_pool stop
This commit is contained in:
@ -215,12 +215,14 @@ void ObMySQLConnectionPool::stop()
|
||||
if (! is_stop_) {
|
||||
int ret = OB_SUCCESS;
|
||||
if (tg_id_ != -1) {
|
||||
int origin_tg_id = tg_id_;
|
||||
if (OB_FAIL(TG_CANCEL_ALL(tg_id_))) {
|
||||
LOG_ERROR("fail to cancel timer task", K(ret), K(this));
|
||||
LOG_ERROR("fail to cancel timer task", K(ret), K(tg_id_), K(is_stop_), K(this));
|
||||
} else {
|
||||
TG_STOP(tg_id_);
|
||||
TG_WAIT(tg_id_);
|
||||
tg_id_ = -1;
|
||||
LOG_INFO("ObMySQLConnectionPool stop succ", K(origin_tg_id));
|
||||
}
|
||||
}
|
||||
is_stop_ = true;
|
||||
|
||||
@ -242,7 +242,7 @@ void ObLogRestoreProxyUtil::destroy()
|
||||
inited_ = false;
|
||||
tenant_id_ = OB_INVALID_TENANT_ID;
|
||||
connection_.stop();
|
||||
TG_DESTROY(tg_id_);
|
||||
destroy_tg_();
|
||||
connection_.destroy();
|
||||
server_prover_.destroy();
|
||||
user_name_.reset();
|
||||
@ -328,6 +328,7 @@ int ObLogRestoreProxyUtil::try_init(const uint64_t tenant_id,
|
||||
if (OB_FAIL(ret)) {
|
||||
LOG_WARN("proxy connect to primary db failed");
|
||||
RESTORE_PROXY_USER_ERROR("connection");
|
||||
destroy();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@ -611,5 +612,15 @@ int ObLogRestoreProxyUtil::get_max_log_info(const ObLSID &id, palf::AccessMode &
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void ObLogRestoreProxyUtil::destroy_tg_()
|
||||
{
|
||||
if (-1 != tg_id_) {
|
||||
int origin_tg_id = tg_id_;
|
||||
TG_DESTROY(tg_id_);
|
||||
tg_id_ = -1;
|
||||
LOG_INFO("destroy_tg_ succ", K(origin_tg_id));
|
||||
}
|
||||
}
|
||||
} // namespace share
|
||||
} // namespace oceanbase
|
||||
|
||||
@ -140,6 +140,7 @@ public:
|
||||
int get_max_log_info(const ObLSID &id, palf::AccessMode &mode, SCN &scn);
|
||||
private:
|
||||
bool is_user_changed_(const char *user_name, const char *user_password, const char *db_name);
|
||||
void destroy_tg_();
|
||||
private:
|
||||
bool inited_;
|
||||
uint64_t tenant_id_;
|
||||
|
||||
Reference in New Issue
Block a user