提交 d84589f7 编写于 作者: L LINxiansheng 提交者: wangzelin.wzl

fix a bug about alter affect later than turn on or off

上级 e01bfda9
......@@ -175,12 +175,11 @@ int ObRSTCollector::flush_query_response_time(uint64_t tenant_id,const ObString&
int ObRSTCollector::enable_query_response_time(uint64_t tenant_id){
int ret = OB_SUCCESS;
omt::ObTenantConfigGuard tenant_config(TENANT_CONF(tenant_id));
if(tenant_config->query_response_time_stats){
SERVER_LOG(INFO, "query_response_time_stats already turn on", K(ret), K(tenant_id));
ObRSTTimeCollector* time_collector;
if (OB_SUCC(collector_map_.get_refactored(tenant_id, time_collector))){
SERVER_LOG(WARN, "time collector of the tenant does not exist", K(ret), K(tenant_id));
} else if (OB_FAIL(collector_map_.set_refactored(tenant_id, new ObRSTTimeCollector()))) {
if (OB_HASH_EXIST == ret) {
ret = OB_ERR_ALREADY_EXISTS;
}
SERVER_LOG(WARN, "time collector of the tenant create failed", K(ret), K(tenant_id));
}
return ret;
}
......@@ -188,8 +187,11 @@ int ObRSTCollector::enable_query_response_time(uint64_t tenant_id){
int ObRSTCollector::free_query_response_time(uint64_t tenant_id){
int ret = OB_SUCCESS;
omt::ObTenantConfigGuard tenant_config(TENANT_CONF(tenant_id));
if (OB_FAIL(collector_map_.erase_refactored(tenant_id))) {
SERVER_LOG(WARN,"erase the time collector failed", K(tenant_id));
ObRSTTimeCollector* time_collector;
if (OB_FAIL(collector_map_.get_refactored(tenant_id, time_collector))){
SERVER_LOG(WARN, "time collector of the tenant does not exist", K(ret), K(tenant_id));
} else if (OB_FAIL(collector_map_.erase_refactored(tenant_id))) {
SERVER_LOG(WARN, "erase the time collector failed", K(tenant_id));
}
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册