Do not report ERROR when sample rate equals 100
This commit is contained in:
@ -44,11 +44,8 @@
|
||||
#include "share/ob_primary_standby_service.h" // ObPrimaryStandbyService
|
||||
#include "rpc/obmysql/ob_sql_sock_session.h"
|
||||
#include "sql/plan_cache/ob_plan_cache.h"
|
||||
#include "pl/pl_cache/ob_pl_cache_mgr.h"
|
||||
#include "sql/plan_cache/ob_ps_cache.h"
|
||||
#include "share/table/ob_ttl_util.h"
|
||||
#include "rootserver/restore/ob_tenant_clone_util.h"
|
||||
|
||||
namespace oceanbase
|
||||
{
|
||||
using namespace common;
|
||||
@ -381,38 +378,7 @@ int ObFlushCacheExecutor::execute(ObExecContext &ctx, ObFlushCacheStmt &stmt)
|
||||
break;
|
||||
}
|
||||
case CACHE_TYPE_PL_OBJ: {
|
||||
if (stmt.flush_cache_arg_.is_fine_grained_) {
|
||||
// purge in sql_id level, aka. fine-grained plan evict
|
||||
// we assume tenant_list must not be empty and this will be checked in resolve phase
|
||||
if (0 == tenant_num) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("unexpected tenant_list in fine-grained plan evict", K(tenant_num));
|
||||
} else {
|
||||
bool is_evict_by_schema_id = common::OB_INVALID_ID != stmt.flush_cache_arg_.schema_id_;
|
||||
for (int64_t i = 0; i < tenant_num; i++) { // ignore ret
|
||||
int64_t t_id = stmt.flush_cache_arg_.tenant_ids_.at(i);
|
||||
MTL_SWITCH(t_id) {
|
||||
ObPlanCache* plan_cache = MTL(ObPlanCache*);
|
||||
// not specified db_name, evict all dbs
|
||||
if (db_num == 0) {
|
||||
if (is_evict_by_schema_id) {
|
||||
ret = plan_cache->flush_pl_cache_single_cache_obj<pl::ObGetPLKVEntryBySchemaIdOp>(OB_INVALID_ID, stmt.flush_cache_arg_.schema_id_);
|
||||
} else {
|
||||
ret = plan_cache->flush_pl_cache_single_cache_obj<pl::ObGetPLKVEntryBySQLIDOp>(OB_INVALID_ID, sql_id);
|
||||
}
|
||||
} else { // evict db by db
|
||||
for(int64_t j = 0; j < db_num; j++) { // ignore ret
|
||||
if (is_evict_by_schema_id) {
|
||||
ret = plan_cache->flush_pl_cache_single_cache_obj<pl::ObGetPLKVEntryBySchemaIdOp>(stmt.flush_cache_arg_.db_ids_.at(j), stmt.flush_cache_arg_.schema_id_);
|
||||
} else {
|
||||
ret = plan_cache->flush_pl_cache_single_cache_obj<pl::ObGetPLKVEntryBySQLIDOp>(stmt.flush_cache_arg_.db_ids_.at(j), sql_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (0 == tenant_num) {
|
||||
if (0 == tenant_num) {
|
||||
common::ObArray<uint64_t> tenant_ids;
|
||||
if (OB_ISNULL(GCTX.omt_)) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
@ -2733,52 +2699,5 @@ int ObResetConfigExecutor::execute(ObExecContext &ctx, ObResetConfigStmt &stmt)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObCancelCloneExecutor::execute(ObExecContext &ctx, ObCancelCloneStmt &stmt)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObTaskExecutorCtx *task_exec_ctx = NULL;
|
||||
common::ObMySQLProxy *sql_proxy = nullptr;
|
||||
const ObString &clone_tenant_name = stmt.get_clone_tenant_name();
|
||||
bool clone_already_finish = false;
|
||||
|
||||
if (OB_ISNULL(task_exec_ctx = GET_TASK_EXECUTOR_CTX(ctx))) {
|
||||
ret = OB_NOT_INIT;
|
||||
LOG_WARN("get task executor context failed", KR(ret));
|
||||
} else if (OB_ISNULL(sql_proxy = ctx.get_sql_proxy())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("sql proxy must not be null", KR(ret));
|
||||
} else {
|
||||
ObSchemaGetterGuard guard;
|
||||
const ObTenantSchema *tenant_schema = nullptr;
|
||||
if (OB_FAIL(GSCHEMASERVICE.get_tenant_schema_guard(OB_SYS_TENANT_ID, guard))) {
|
||||
LOG_WARN("failed to get sys tenant schema guard", KR(ret));
|
||||
} else if (OB_FAIL(guard.get_tenant_info(clone_tenant_name, tenant_schema))) {
|
||||
LOG_WARN("failed to get tenant info", KR(ret), K(stmt));
|
||||
} else if (OB_ISNULL(tenant_schema)) {
|
||||
LOG_INFO("tenant not exist", KR(ret), K(clone_tenant_name));
|
||||
} else if (tenant_schema->is_normal()) {
|
||||
ret = OB_OP_NOT_ALLOW;
|
||||
LOG_WARN("the new tenant has completed the cloning operation", KR(ret), K(clone_tenant_name));
|
||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "The new tenant has completed the cloning operation, "
|
||||
"or this is not the name of a cloning tenant. "
|
||||
"Cancel cloning");
|
||||
}
|
||||
}
|
||||
|
||||
if (FAILEDx(rootserver::ObTenantCloneUtil::cancel_clone_job(*sql_proxy,
|
||||
clone_tenant_name,
|
||||
clone_already_finish))) {
|
||||
LOG_WARN("cancel clone job failed", KR(ret), K(clone_tenant_name));
|
||||
} else if (clone_already_finish) {
|
||||
ret = OB_OP_NOT_ALLOW;
|
||||
LOG_WARN("the new tenant has completed the cloning operation", KR(ret), K(clone_tenant_name));
|
||||
LOG_USER_ERROR(OB_OP_NOT_ALLOW, "The new tenant has completed the cloning operation, "
|
||||
"or this is not the name of a cloning tenant. "
|
||||
"Cancel cloning");
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
} // end namespace sql
|
||||
} // end namespace oceanbase
|
||||
|
||||
Reference in New Issue
Block a user