Add log to solve tg_cancel_fail in mysql_connection_pool stop

This commit is contained in:
obdev
2023-05-08 08:45:16 +00:00
committed by ob-robot
parent 99e8bc8477
commit 13ac24de25
3 changed files with 16 additions and 2 deletions

View File

@ -215,12 +215,14 @@ void ObMySQLConnectionPool::stop()
if (! is_stop_) { if (! is_stop_) {
int ret = OB_SUCCESS; int ret = OB_SUCCESS;
if (tg_id_ != -1) { if (tg_id_ != -1) {
int origin_tg_id = tg_id_;
if (OB_FAIL(TG_CANCEL_ALL(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 { } else {
TG_STOP(tg_id_); TG_STOP(tg_id_);
TG_WAIT(tg_id_); TG_WAIT(tg_id_);
tg_id_ = -1; tg_id_ = -1;
LOG_INFO("ObMySQLConnectionPool stop succ", K(origin_tg_id));
} }
} }
is_stop_ = true; is_stop_ = true;

View File

@ -242,7 +242,7 @@ void ObLogRestoreProxyUtil::destroy()
inited_ = false; inited_ = false;
tenant_id_ = OB_INVALID_TENANT_ID; tenant_id_ = OB_INVALID_TENANT_ID;
connection_.stop(); connection_.stop();
TG_DESTROY(tg_id_); destroy_tg_();
connection_.destroy(); connection_.destroy();
server_prover_.destroy(); server_prover_.destroy();
user_name_.reset(); user_name_.reset();
@ -328,6 +328,7 @@ int ObLogRestoreProxyUtil::try_init(const uint64_t tenant_id,
if (OB_FAIL(ret)) { if (OB_FAIL(ret)) {
LOG_WARN("proxy connect to primary db failed"); LOG_WARN("proxy connect to primary db failed");
RESTORE_PROXY_USER_ERROR("connection"); RESTORE_PROXY_USER_ERROR("connection");
destroy();
} }
return ret; return ret;
} }
@ -611,5 +612,15 @@ int ObLogRestoreProxyUtil::get_max_log_info(const ObLSID &id, palf::AccessMode &
} }
return ret; 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 share
} // namespace oceanbase } // namespace oceanbase

View File

@ -140,6 +140,7 @@ public:
int get_max_log_info(const ObLSID &id, palf::AccessMode &mode, SCN &scn); int get_max_log_info(const ObLSID &id, palf::AccessMode &mode, SCN &scn);
private: private:
bool is_user_changed_(const char *user_name, const char *user_password, const char *db_name); bool is_user_changed_(const char *user_name, const char *user_password, const char *db_name);
void destroy_tg_();
private: private:
bool inited_; bool inited_;
uint64_t tenant_id_; uint64_t tenant_id_;