das tablet mapper use schema_guard in sql_ctx

This commit is contained in:
leslieyuchen
2023-07-05 08:18:11 +00:00
committed by ob-robot
parent 4c1cda057a
commit 6819b7ed03
10 changed files with 38 additions and 50 deletions

View File

@ -134,6 +134,10 @@ int ObRpcLoadDataShuffleTaskExecuteP::process()
if (OB_FAIL(ObGlobalLoadDataStatMap::getInstance()->get_job_status(task.gid_, job_status))) {
LOG_WARN("fail to get job, main thread has already quit", K(ret), K(task));
} else if (OB_FAIL(GCTX.schema_service_->get_tenant_schema_guard(MTL_ID(), schema_guard_))) {
//Confirmed with the load data owner that the inability to calculate the correct tablet_id here will not affect the execution,
//so we use the latest schema version to obtain the guard
LOG_WARN("get tenant schema guard failed", KR(ret));
} else if (OB_ISNULL(job_status)) {
ret = OB_ERR_UNEXPECTED;
LOG_WARN("job status is null", K(ret));
@ -144,6 +148,7 @@ int ObRpcLoadDataShuffleTaskExecuteP::process()
ret = OB_ERR_UNEXPECTED;
LOG_ERROR("handle is null", K(ret));
} else {
handle->exec_ctx.get_sql_ctx()->schema_guard_ = &schema_guard_;
if (OB_UNLIKELY(THIS_WORKER.is_timeout())) {
ret = OB_TIMEOUT;
LOG_WARN("LOAD DATA shuffle task timeout", K(ret), K(task));

View File

@ -530,6 +530,7 @@ protected:
int process();
private:
const observer::ObGlobalContext &gctx_;
share::schema::ObSchemaGetterGuard schema_guard_;
};
class ObRpcLoadDataShuffleTaskCallBack