change the update stat cache way, use the current worker thread instead of RS worker thread

This commit is contained in:
wangt1xiuyi
2023-02-21 05:41:51 +00:00
committed by ob-robot
parent ed67ac652e
commit 7afa91237f
6 changed files with 140 additions and 165 deletions

View File

@ -41,7 +41,6 @@ namespace sql
int ObAnalyzeExecutor::execute(ObExecContext &ctx, ObAnalyzeStmt &stmt)
{
int ret = OB_SUCCESS;
obrpc::ObCommonRpcProxy *proxy = NULL;
ObTableStatParam param;
share::schema::ObSchemaGetterGuard *schema_guard = ctx.get_virtual_table_ctx().schema_guard_;
ObSQLSessionInfo *session = ctx.get_my_session();
@ -59,13 +58,11 @@ int ObAnalyzeExecutor::execute(ObExecContext &ctx, ObAnalyzeStmt &stmt)
} else if (OB_FAIL(stmt.fill_table_stat_param(ctx, param))) {
LOG_WARN("failed to fill table stat param", K(ret));
} else if (!stmt.is_delete_histogram()) {
if (OB_FAIL(ctx.get_task_executor_ctx()->get_common_rpc(proxy))) {
LOG_WARN("failed to get common rpc", K(ret));
} else if (OB_FAIL(ObDbmsStatsLockUnlock::check_stat_locked(ctx, param))) {
if (OB_FAIL(ObDbmsStatsLockUnlock::check_stat_locked(ctx, param))) {
LOG_WARN("failed check stat locked", K(ret));
} else if (OB_FAIL(ObDbmsStatsExecutor::gather_table_stats(ctx, param))) {
LOG_WARN("failed to gather table stats", K(ret));
} else if (OB_FAIL(pl::ObDbmsStats::update_stat_cache(proxy, param))) {
} else if (OB_FAIL(pl::ObDbmsStats::update_stat_cache(session->get_rpc_tenant_id(), param))) {
LOG_WARN("failed to update stat cache", K(ret));
} else {
LOG_TRACE("succeed to gather table stats", K(param));