This commit is contained in:
hnwyllmm 2022-11-30 10:05:50 +00:00 committed by ob-robot
parent 47b0a3a4de
commit 59e975f9d7
14 changed files with 33 additions and 33 deletions

View File

@ -505,7 +505,7 @@ int ObObjFreeList::destroy_cur_thread_cache()
ObThreadCache *cur_thread_cache = NULL;
void *item = NULL;
// unregister thread cahce
// unregister thread cache
if (!OB_ISNULL(cur_thread_cache = get_thread_cache(thread_cache_idx_))) {
if (OB_FAIL(mutex_acquire(&lock_))) {
OB_LOG(WARN, "failed to lock of freelist", KCSTRING(name_));

View File

@ -112,7 +112,7 @@ namespace observer
class ObTenantMetaChecker;
}
// for ObTenamtSwitchGuard 临时使用>>>>>>>>
// for ObTenantSwitchGuard 临时使用>>>>>>>>
namespace observer
{
class ObAllVirtualTabletInfo;

View File

@ -1621,7 +1621,7 @@ int ObChangeTenantExecutor::execute(ObExecContext &ctx, ObChangeTenantStmt &stmt
LOG_WARN("fail to get pc mem conf", KR(ret), KPC(session_info));
} else if (OB_FAIL(GCTX.schema_service_->get_tenant_received_broadcast_version(
effective_tenant_id, received_schema_version))) {
LOG_WARN("fail to get tenant received brocast version", KR(ret), K(effective_tenant_id));
LOG_WARN("fail to get tenant received broadcast version", KR(ret), K(effective_tenant_id));
} else if (OB_FAIL(session_info->switch_tenant(effective_tenant_id))) {
LOG_WARN("fail to switch tenant", KR(ret), K(effective_tenant_id), K(pre_effective_tenant_id));
} else if (OB_FAIL(session_info->set_default_database(database_name))) {

View File

@ -178,7 +178,7 @@ int ObLoadDataBase::make_parameterize_stmt(ObExecContext &ctx,
ObMaxConcurrentParam::FixParamStore fixed_param_store(OB_MALLOC_NORMAL_BLOCK_SIZE,
ObWrapperAllocator(&ctx.get_allocator()));
if (OB_FAIL(parser.parse(insertsql.string(), parse_result))) {
LOG_WARN("paser template insert sql failed", K(ret));
LOG_WARN("parser template insert sql failed", K(ret));
} else if (OB_FAIL(ObSqlParameterization::transform_syntax_tree(ctx.get_allocator(),
*session,
NULL,

View File

@ -1837,7 +1837,7 @@ OB_INLINE int ObSql::handle_text_query(const ObString &stmt, ObSqlCtx &context,
ret = OB_ERR_EMPTY_QUERY;
LOG_WARN("query is empty", K(ret));
LOG_USER_ERROR(OB_ERR_EMPTY_QUERY);
// 空请求,可以归类到paser的已知错误,不需要断连接
// 空请求,可以归类到parser的已知错误,不需要断连接
result.get_exec_context().set_need_disconnect(false);
//FIXME qianfu NG_TRACE_EXT(set_need_disconnect, OB_ID(need_disconnect), false);
}
@ -1891,7 +1891,7 @@ OB_INLINE int ObSql::handle_text_query(const ObString &stmt, ObSqlCtx &context,
ret = OB_BATCHED_MULTI_STMT_ROLLBACK;
LOG_WARN("batched multi_stmt needs rollback");
}
// 如果是begin/commit语句,不再从plan cahce中获取plan
// 如果是begin/commit语句,不再从plan cache中获取plan
} else if (!is_begin_commit_stmt
&& OB_FAIL(pc_get_plan_and_fill_result(*pc_ctx, result, get_plan_err,
ectx.get_need_disconnect_for_update()))) {
@ -2080,7 +2080,7 @@ int ObSql::generate_stmt(ParseResult &parse_result,
if (OB_FAIL(ret)) {
} else if (stmt::T_ANONYMOUS_BLOCK == context.stmt_type_ && context.is_prepare_protocol_ && !context.is_prepare_stage_) {
//anonymous + ps在execute阶段不会做parser, 因此不应该检查paser_result
//anonymous + ps在execute阶段不会做parser, 因此不应该检查parser_result
//do nothing...
} else if (OB_ISNULL(parse_result.result_tree_)
|| OB_ISNULL(parse_result.result_tree_->children_)
@ -4057,7 +4057,7 @@ int ObSql::calc_pre_calculable_exprs(const ObDMLStmt &stmt,
} else if (OB_FAIL(ObPlanCacheObject::pre_calculation(is_ignore_stmt,
*pre_calc_frame, exec_ctx,
calc_types))) {
LOG_WARN("failde to pre calculate exprs", K(ret));
LOG_WARN("failed to pre calculate exprs", K(ret));
} else if (OB_UNLIKELY(PRE_CALC_DEFAULT == calc_types &&
!phy_plan.get_pre_calc_frames().add_last(pre_calc_frame))) {
ret = OB_ERR_UNEXPECTED;

View File

@ -1648,7 +1648,7 @@ int ObSQLUtils::get_default_cast_mode(const bool is_explicit_cast,
}
}
cast_mode |= CM_FORMAT_NUMBER_WITH_LIMIT;
LOG_DEBUG("in get_defalut_cast_mode", K(ret), K(is_explicit_cast),
LOG_DEBUG("in get_default_cast_mode", K(ret), K(is_explicit_cast),
K(result_flag), K(session->get_stmt_type()), K(cast_mode));
}
return ret;
@ -2912,7 +2912,7 @@ int ObSQLUtils::update_session_last_schema_version(ObMultiVersionSchemaService &
uint64_t tenant_id = session_info.get_effective_tenant_id();
if (OB_FAIL(schema_service.get_tenant_received_broadcast_version(tenant_id,
received_schema_version))) {
LOG_WARN("fail to get tenant received brocast version", K(ret), K(tenant_id));
LOG_WARN("fail to get tenant received broadcast version", K(ret), K(tenant_id));
} else if (OB_FAIL(session_info.update_sys_variable(SYS_VAR_OB_LAST_SCHEMA_VERSION,
received_schema_version))) {
LOG_WARN("fail to set session variable for last_schema_version", K(ret));

View File

@ -33,4 +33,4 @@ extern void right_to_die_or_duty_to_live_c();
#endif // __cplusplus
#endif // SQL_PARSER_COMPILATION
#endif // !PASER_ALLOC_FUNC_H_
#endif // !PARSER_ALLOC_FUNC_H_

View File

@ -97,25 +97,25 @@ void ObLibCacheRegister::register_lc_obj()
memset(NS_TYPE_LABELS, 0, sizeof(NS_TYPE_LABELS));
memset(CO_ALLOC, 0, sizeof(CO_ALLOC));
memset(NAME_TYPES, 0, sizeof(NAME_TYPES));
#define LIB_CAHCE_OBJ_DEF(ns, ns_name, ck_class, cn_class, co_class, label) REG_LIB_CACHE_OBJ(ns, ns_name, co_class, label);
#define LIB_CACHE_OBJ_DEF(ns, ns_name, ck_class, cn_class, co_class, label) REG_LIB_CACHE_OBJ(ns, ns_name, co_class, label);
#include "sql/plan_cache/ob_lib_cache_register.h"
#undef LIB_CAHCE_OBJ_DEF
#undef LIB_CACHE_OBJ_DEF
}
void ObLibCacheRegister::register_lc_key()
{
memset(CK_ALLOC, 0, sizeof(CK_ALLOC));
#define LIB_CAHCE_OBJ_DEF(ns, ns_name, ck_class, cn_class, co_class, label) REG_LIB_CACHE_KEY(ns, ck_class);
#define LIB_CACHE_OBJ_DEF(ns, ns_name, ck_class, cn_class, co_class, label) REG_LIB_CACHE_KEY(ns, ck_class);
#include "sql/plan_cache/ob_lib_cache_register.h"
#undef LIB_CAHCE_OBJ_DEF
#undef LIB_CACHE_OBJ_DEF
}
void ObLibCacheRegister::register_lc_node()
{
memset(CN_ALLOC, 0, sizeof(CN_ALLOC));
#define LIB_CAHCE_OBJ_DEF(ns, ns_name, ck_class, cn_class, co_class, label) REG_LIB_CACHE_NODE(ns, cn_class);
#define LIB_CACHE_OBJ_DEF(ns, ns_name, ck_class, cn_class, co_class, label) REG_LIB_CACHE_NODE(ns, cn_class);
#include "sql/plan_cache/ob_lib_cache_register.h"
#undef LIB_CAHCE_OBJ_DEF
#undef LIB_CACHE_OBJ_DEF
}
} // namespace common

View File

@ -10,14 +10,14 @@
* See the Mulan PubL v2 for more details.
*/
#ifdef LIB_CAHCE_OBJ_DEF
LIB_CAHCE_OBJ_DEF(NS_CRSR, "CRSR", ObPlanCacheKey, ObPCVSet, ObPhysicalPlan, ObNewModIds::OB_SQL_PHY_PLAN) // physical plan cache
LIB_CAHCE_OBJ_DEF(NS_PRCR, "PRCR", ObPlanCacheKey, ObPCVSet, pl::ObPLFunction, ObNewModIds::OB_SQL_PHY_PL_OBJ) // procedure cache
LIB_CAHCE_OBJ_DEF(NS_SFC, "SFC", ObPlanCacheKey, ObPCVSet, pl::ObPLFunction, ObNewModIds::OB_SQL_PHY_PL_OBJ) // function cache
LIB_CAHCE_OBJ_DEF(NS_ANON, "ANON", ObPlanCacheKey, ObPCVSet, pl::ObPLFunction, ObNewModIds::OB_SQL_PHY_PL_OBJ) // anonymous cache
LIB_CAHCE_OBJ_DEF(NS_TRGR, "TRGR", ObPlanCacheKey, ObPCVSet, pl::ObPLPackage, ObNewModIds::OB_SQL_PHY_PL_OBJ) // trigger cache
LIB_CAHCE_OBJ_DEF(NS_PKG, "PKG", ObPlanCacheKey, ObPCVSet, pl::ObPLPackage, ObNewModIds::OB_SQL_PHY_PL_OBJ) // package cache
#endif /*LIB_CAHCE_OBJ_DEF*/
#ifdef LIB_CACHE_OBJ_DEF
LIB_CACHE_OBJ_DEF(NS_CRSR, "CRSR", ObPlanCacheKey, ObPCVSet, ObPhysicalPlan, ObNewModIds::OB_SQL_PHY_PLAN) // physical plan cache
LIB_CACHE_OBJ_DEF(NS_PRCR, "PRCR", ObPlanCacheKey, ObPCVSet, pl::ObPLFunction, ObNewModIds::OB_SQL_PHY_PL_OBJ) // procedure cache
LIB_CACHE_OBJ_DEF(NS_SFC, "SFC", ObPlanCacheKey, ObPCVSet, pl::ObPLFunction, ObNewModIds::OB_SQL_PHY_PL_OBJ) // function cache
LIB_CACHE_OBJ_DEF(NS_ANON, "ANON", ObPlanCacheKey, ObPCVSet, pl::ObPLFunction, ObNewModIds::OB_SQL_PHY_PL_OBJ) // anonymous cache
LIB_CACHE_OBJ_DEF(NS_TRGR, "TRGR", ObPlanCacheKey, ObPCVSet, pl::ObPLPackage, ObNewModIds::OB_SQL_PHY_PL_OBJ) // trigger cache
LIB_CACHE_OBJ_DEF(NS_PKG, "PKG", ObPlanCacheKey, ObPCVSet, pl::ObPLPackage, ObNewModIds::OB_SQL_PHY_PL_OBJ) // package cache
#endif /*LIB_CACHE_OBJ_DEF*/
#ifndef OCEANBASE_SQL_PLAN_CACHE_OB_LIB_CACHE_REGISTER_
#define OCEANBASE_SQL_PLAN_CACHE_OB_LIB_CACHE_REGISTER_
@ -48,9 +48,9 @@ class ObPlanCache;
enum ObLibCacheNameSpace
{
NS_INVALID,
#define LIB_CAHCE_OBJ_DEF(ns, ns_name, ck_class, cn_class, co_class, label) ns,
#define LIB_CACHE_OBJ_DEF(ns, ns_name, ck_class, cn_class, co_class, label) ns,
#include "sql/plan_cache/ob_lib_cache_register.h"
#undef LIB_CAHCE_OBJ_DEF
#undef LIB_CACHE_OBJ_DEF
NS_MAX
};

View File

@ -122,7 +122,7 @@ private:
common::ObIAllocator *pc_alloc_;
common::ObString sql_; // 往plan cache中增加以sql为key的kv对时需要本成员
common::ObDList<ObPlanCacheValue> pcv_list_;
//正常paser时能够识别的常量的个数,用于校验faster parse识别的常量个数与正常parser识别个数是否一致。
//正常parser时能够识别的常量的个数,用于校验faster parse识别的常量个数与正常parser识别个数是否一致。
int64_t normal_parse_const_cnt_;
int64_t min_cluster_version_;
// 记录该pcv_set下面挂了多少plan,上限为MAX_PCV_SET_PLAN_NUM

View File

@ -40,7 +40,7 @@ TEST(test_cluster_id_hash_conflict, test_cluster_id_hash)
common::ObAddr addr;
addr.parse_from_cstring("127.0.0.1:8080");
int64_t tenant_id = 500;
int64_t tenant_id = OB_SERVER_TENANT_ID;
// The binary of 112 and 120 are only one bit different
int64_t cluster_id_11 = 112;

View File

@ -119,7 +119,7 @@ TEST(TestDtlRpcChannel, Basic)
// // Create a DtlChannelInfo object, ci1 and ci2 are the channel information at both ends of the same channel.
// ObDtlChannelInfo ci1, ci2;
// const uint64_t tenant_id = 500;
// const uint64_t tenant_id = OB_SERVER_TENANT_ID;
// int ret = ObDtlChannelGroup::make_channel(tenant_id, self_addr, self_addr, ci1, ci2);
// ASSERT_EQ(OB_SUCCESS, ret);

View File

@ -683,7 +683,7 @@ public:
ASSERT_SUCC(OB_IO_MANAGER.add_device_channel(THE_IO_DEVICE, 16, 2, 1024));
// add tenant io manager
const uint64_t tenant_id = 500;
const uint64_t tenant_id = OB_SERVER_TENANT_ID;
ObTenantIOConfig io_config;
io_config.memory_limit_ = memory_limit;
io_config.callback_thread_count_ = 2;
@ -1825,4 +1825,4 @@ int IOConfModify::modify_tenant_io( const int64_t min_iops,
LOG_WARN("refresh tenant io config failed", K(ret), K(curr_tenant.tenant_id_), K(curr_tenant.config_));
}
return ret;
}
}

View File

@ -54,7 +54,7 @@ public:
void FakeLs(ObLS &ls);
private:
static constexpr uint64_t TEST_TENANT_ID = 500;
static constexpr uint64_t TEST_TENANT_ID = OB_SERVER_TENANT_ID;
ObMetaPointerMap<ObTabletMapKey, ObTablet> tablet_map_;
ObTenantBase tenant_base_;
};