alloc fix: glibc malloc Memory Splitting to Tenants
This commit is contained in:
7
deps/oblib/src/rpc/obmysql/ob_mysql_util.cpp
vendored
7
deps/oblib/src/rpc/obmysql/ob_mysql_util.cpp
vendored
@ -1042,17 +1042,18 @@ int ObMySQLUtil::urowid_cell_str(char *buf, const int64_t len, const ObURowIDDat
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObMySQLUtil::sql_utd_cell_str(char *buf, const int64_t len, const ObString &val, int64_t &pos)
|
||||
int ObMySQLUtil::sql_utd_cell_str(uint64_t tenant_id, char *buf, const int64_t len, const ObString &val, int64_t &pos)
|
||||
{
|
||||
INIT_SUCC(ret);
|
||||
ret = OB_NOT_SUPPORTED;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int ObMySQLUtil::json_cell_str(char *buf, const int64_t len, const ObString &val, int64_t &pos)
|
||||
int ObMySQLUtil::json_cell_str(uint64_t tenant_id, char *buf, const int64_t len, const ObString &val, int64_t &pos)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
ObArenaAllocator allocator;
|
||||
lib::ObMemAttr mem_attr(tenant_id, "JsonAlloc");
|
||||
ObArenaAllocator allocator(mem_attr);
|
||||
ObJsonBin j_bin(val.ptr(), val.length(), &allocator);
|
||||
ObIJsonBase *j_base = &j_bin;
|
||||
ObJsonBuffer jbuf(&allocator);
|
||||
|
||||
4
deps/oblib/src/rpc/obmysql/ob_mysql_util.h
vendored
4
deps/oblib/src/rpc/obmysql/ob_mysql_util.h
vendored
@ -429,8 +429,8 @@ public:
|
||||
int64_t &pos);
|
||||
static int lob_locator_cell_str(char *buf, const int64_t len,
|
||||
const common::ObLobLocator &lob_locator, int64_t &pos);
|
||||
static int json_cell_str(char *buf, const int64_t len, const ObString &val, int64_t &pos);
|
||||
static int sql_utd_cell_str(char *buf, const int64_t len, const ObString &val, int64_t &pos);
|
||||
static int json_cell_str(uint64_t tenant_id, char *buf, const int64_t len, const ObString &val, int64_t &pos);
|
||||
static int sql_utd_cell_str(uint64_t tenant_id, char *buf, const int64_t len, const ObString &val, int64_t &pos);
|
||||
static int geometry_cell_str(char *buf, const int64_t len, const ObString &val, int64_t &pos);
|
||||
static inline int16_t float_length(const int16_t scale);
|
||||
public:
|
||||
|
||||
@ -191,7 +191,7 @@ int ObSMUtils::cell_str(
|
||||
break;
|
||||
}
|
||||
case ObJsonTC:{
|
||||
ret = ObMySQLUtil::json_cell_str(buf, len, obj.get_string(), pos);
|
||||
ret = ObMySQLUtil::json_cell_str(MTL_ID(), buf, len, obj.get_string(), pos);
|
||||
break;
|
||||
}
|
||||
case ObGeometryTC: {
|
||||
@ -297,7 +297,7 @@ int ObSMUtils::cell_str(
|
||||
break;
|
||||
}
|
||||
case ObUserDefinedSQLTC: {
|
||||
ret = ObMySQLUtil::sql_utd_cell_str(buf, len, obj.get_string(), pos);
|
||||
ret = ObMySQLUtil::sql_utd_cell_str(MTL_ID(), buf, len, obj.get_string(), pos);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@ -592,6 +592,7 @@ void ObServer::destroy()
|
||||
sql_engine_.destroy();
|
||||
FLOG_INFO("sql engine destroyed");
|
||||
|
||||
|
||||
FLOG_INFO("begin to destroy pl engine");
|
||||
pl_engine_.destory();
|
||||
FLOG_INFO("pl engine destroyed");
|
||||
@ -2298,6 +2299,7 @@ int ObServer::init_sql()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (OB_SUCC(ret)) {
|
||||
LOG_INFO("init sql done");
|
||||
} else {
|
||||
|
||||
@ -6202,7 +6202,7 @@ int ObAggregateProcessor::get_json_arrayagg_result(const ObAggrInfo &aggr_info,
|
||||
ObDatum &concat_result)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
common::ObArenaAllocator tmp_alloc;
|
||||
common::ObArenaAllocator tmp_alloc(ObModIds::OB_SQL_AGGR_FUNC, OB_MALLOC_NORMAL_BLOCK_SIZE, MTL_ID());
|
||||
if (OB_ISNULL(extra) || OB_UNLIKELY(extra->empty())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("get unpexcted null", K(ret), K(extra));
|
||||
@ -6324,7 +6324,7 @@ int ObAggregateProcessor::get_ora_json_arrayagg_result(const ObAggrInfo &aggr_in
|
||||
ObDatum &concat_result)
|
||||
{
|
||||
int ret = OB_SUCCESS;
|
||||
common::ObArenaAllocator tmp_alloc;
|
||||
common::ObArenaAllocator tmp_alloc(ObModIds::OB_SQL_AGGR_FUNC, OB_MALLOC_NORMAL_BLOCK_SIZE, MTL_ID());
|
||||
if (OB_ISNULL(extra) || OB_UNLIKELY(extra->empty())) {
|
||||
ret = OB_ERR_UNEXPECTED;
|
||||
LOG_WARN("get unpexcted null", K(ret), K(extra));
|
||||
|
||||
Reference in New Issue
Block a user