[CP] fix pc diag view bug: return -4002 error code

This commit is contained in:
obdev
2024-03-04 11:48:13 +00:00
committed by ob-robot
parent 4bb2e4280e
commit 6615941936
2 changed files with 10 additions and 2 deletions

View File

@ -4179,7 +4179,6 @@ int ObPLFunction::update_cache_obj_stat(ObILibCacheCtx &ctx)
PLCacheObjStat &stat = get_stat_for_update();
stat.pl_schema_id_ = pc_ctx.key_.key_id_;
stat.gen_time_ = ObTimeUtility::current_time();
stat.last_active_time_ = ObTimeUtility::current_time();
stat.hit_count_ = 0;
MEMCPY(stat.sql_id_, pc_ctx.sql_id_, (int32_t)sizeof(pc_ctx.sql_id_));
@ -4193,6 +4192,11 @@ int ObPLFunction::update_cache_obj_stat(ObILibCacheCtx &ctx)
stat.sql_cs_type_ = pc_ctx.session_info_->get_local_collation_connection();
}
}
if (OB_SUCC(ret)) {
// Update last_active_time_ last, because last_active_time_ is used to
// indicate whether the cache stat has been updated.
stat.last_active_time_ = ObTimeUtility::current_time();
}
return ret;
}

View File

@ -1186,7 +1186,6 @@ int ObPhysicalPlan::update_cache_obj_stat(ObILibCacheCtx &ctx)
stat_.plan_hash_value_ = get_signature();
stat_.gen_time_ = ObTimeUtility::current_time();
stat_.schema_version_ = get_tenant_schema_version();
stat_.last_active_time_ = stat_.gen_time_;
stat_.hit_count_ = 0;
stat_.mem_used_ = get_mem_size();
stat_.slow_count_ = 0;
@ -1284,6 +1283,11 @@ int ObPhysicalPlan::update_cache_obj_stat(ObILibCacheCtx &ctx)
stat_.plan_tmp_tbl_name_str_len_ = static_cast<int32_t>(pos);
}
}
if (OB_SUCC(ret)) {
// Update last_active_time_ last, because last_active_time_ is used to
// indicate whether the cache stat has been updated.
stat_.last_active_time_ = stat_.gen_time_;
}
}
return ret;
}