Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
大炮V587
oceanbase
提交
59df2a1a
O
oceanbase
项目概览
大炮V587
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
59df2a1a
编写于
12月 09, 2022
作者:
O
obdev
提交者:
ob-robot
1月 12, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove is_valid in ps cache and plan cache.
上级
9b8edfcf
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
6 addition
and
29 deletion
+6
-29
src/observer/virtual_table/ob_all_plan_cache_stat.cpp
src/observer/virtual_table/ob_all_plan_cache_stat.cpp
+0
-2
src/observer/virtual_table/ob_all_virtual_ps_item_info.cpp
src/observer/virtual_table/ob_all_virtual_ps_item_info.cpp
+2
-3
src/observer/virtual_table/ob_all_virtual_ps_stat.cpp
src/observer/virtual_table/ob_all_virtual_ps_stat.cpp
+0
-2
src/sql/plan_cache/ob_plan_cache.cpp
src/sql/plan_cache/ob_plan_cache.cpp
+0
-2
src/sql/plan_cache/ob_plan_cache.h
src/sql/plan_cache/ob_plan_cache.h
+0
-3
src/sql/plan_cache/ob_plan_cache_manager.cpp
src/sql/plan_cache/ob_plan_cache_manager.cpp
+0
-2
src/sql/plan_cache/ob_ps_cache.cpp
src/sql/plan_cache/ob_ps_cache.cpp
+2
-10
src/sql/plan_cache/ob_ps_cache.h
src/sql/plan_cache/ob_ps_cache.h
+0
-3
src/sql/session/ob_sql_session_info.cpp
src/sql/session/ob_sql_session_info.cpp
+2
-2
未找到文件。
src/observer/virtual_table/ob_all_plan_cache_stat.cpp
浏览文件 @
59df2a1a
...
...
@@ -380,8 +380,6 @@ int ObAllPlanCacheStat::get_row_from_tenants()
ObPlanCache
*
plan_cache
=
pcm_
->
get_plan_cache
(
tenant_id
);
if
(
OB_UNLIKELY
(
NULL
==
plan_cache
))
{
SERVER_LOG
(
WARN
,
"invalid plan cache"
,
K
(
ret
),
K
(
tenant_id
));
}
else
if
(
!
plan_cache
->
is_valid
())
{
// do nothing
}
else
{
if
(
OB_FAIL
(
fill_cells
(
*
plan_cache
)))
{
SERVER_LOG
(
WARN
,
"fail to fill cells"
,
K
(
ret
),
K
(
cur_row_
));
...
...
src/observer/virtual_table/ob_all_virtual_ps_item_info.cpp
浏览文件 @
59df2a1a
...
...
@@ -198,10 +198,9 @@ int ObAllVirtualPsItemInfo::get_next_row_from_specified_tenant(uint64_t tenant_i
}
else
if
(
NULL
==
(
ps_cache_
=
pcm_
->
get_ps_cache
(
tenant_id
)))
{
is_end
=
true
;
SERVER_LOG
(
DEBUG
,
"plan cache not exists for this tenant yet"
,
K
(
ret
));
}
else
if
(
false
==
ps_cache_
->
is_inited
()
||
false
==
ps_cache_
->
is_valid
()
)
{
}
else
if
(
false
==
ps_cache_
->
is_inited
())
{
is_end
=
true
;
SERVER_LOG
(
DEBUG
,
"ps cache is not ready, ignore this"
,
K
(
ret
),
K
(
ps_cache_
->
is_inited
()),
K
(
ps_cache_
->
is_valid
()));
SERVER_LOG
(
DEBUG
,
"ps cache is not ready, ignore this"
,
K
(
ret
),
K
(
ps_cache_
->
is_inited
()));
}
else
if
(
OB_FAIL
(
ps_cache_
->
get_all_stmt_id
(
&
stmt_id_array_
)))
{
SERVER_LOG
(
WARN
,
"get_all_stmt_id failed"
,
K
(
ret
));
}
else
{
...
...
src/observer/virtual_table/ob_all_virtual_ps_stat.cpp
浏览文件 @
59df2a1a
...
...
@@ -126,8 +126,6 @@ int ObAllVirtualPsStat::inner_get_next_row()
K
(
effective_tenant_id_
));
}
else
if
(
false
==
ps_cache
->
is_inited
())
{
SERVER_LOG
(
DEBUG
,
"ps_cache is not init, ignore this"
,
K
(
ret
));
}
else
if
(
false
==
ps_cache
->
is_valid
())
{
SERVER_LOG
(
DEBUG
,
"ps_cache is not valid, ignore this"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
fill_cells
(
*
ps_cache
,
tenant_id
)))
{
SERVER_LOG
(
WARN
,
"fill_cells failed"
,
K
(
ret
),
K
(
tenant_id
));
}
else
{
...
...
src/sql/plan_cache/ob_plan_cache.cpp
浏览文件 @
59df2a1a
...
...
@@ -322,7 +322,6 @@ struct ObNodeStatFilterOp : public ObKVEntryTraverseOp
ObPlanCache
::
ObPlanCache
()
:
inited_
(
false
),
valid_
(
false
),
tenant_id_
(
OB_INVALID_TENANT_ID
),
mem_limit_pct_
(
OB_PLAN_CACHE_PERCENTAGE
),
mem_high_pct_
(
OB_PLAN_CACHE_EVICT_HIGH_PERCENTAGE
),
...
...
@@ -376,7 +375,6 @@ int ObPlanCache::init(int64_t hash_bucket, common::ObAddr addr,
tenant_id_
=
tenant_id
;
ref_handle_mgr_
.
set_tenant_id
(
tenant_id_
);
inited_
=
true
;
valid_
=
true
;
pcm_
=
pcm
;
}
}
...
...
src/sql/plan_cache/ob_plan_cache.h
浏览文件 @
59df2a1a
...
...
@@ -275,8 +275,6 @@ public:
int
foreach_cache_evict
(
CallBack
&
cb
);
//asynchronous update plan baseline
int
asyn_update_baseline
();
bool
is_valid
()
{
return
valid_
;}
void
set_valid
(
bool
valid
)
{
valid_
=
valid
;}
void
destroy
();
int64_t
inc_ref_count
();
void
dec_ref_count
();
...
...
@@ -368,7 +366,6 @@ private:
const
static
int64_t
SLICE_SIZE
=
1024
;
//1k
private:
bool
inited_
;
bool
valid_
;
int64_t
tenant_id_
;
int64_t
mem_limit_pct_
;
int64_t
mem_high_pct_
;
// high water mark percentage
...
...
src/sql/plan_cache/ob_plan_cache_manager.cpp
浏览文件 @
59df2a1a
...
...
@@ -263,7 +263,6 @@ int ObPlanCacheManager::revert_plan_cache(const uint64_t &tenant_id)
"pc ref_count"
,
ppc
->
get_ref_count
(),
K
(
tenant_id
));
//cancel scheduled task
ppc
->
set_valid
(
false
);
ppc
->
dec_ref_count
();
}
else
if
(
OB_HASH_NOT_EXIST
==
tmp_ret
)
{
// maybe erase by other thread
SQL_PC_LOG
(
INFO
,
"Plan Cache not exist"
,
K
(
tenant_id
));
...
...
@@ -742,7 +741,6 @@ int ObPlanCacheManager::revert_ps_cache(const uint64_t &tenant_id)
K
(
tenant_id
));
//cancel scheduled task
ppc
->
dec_ref_count
();
ppc
->
set_valid
(
false
);
}
else
if
(
OB_HASH_NOT_EXIST
==
tmp_ret
)
{
// maybe erase by other thread
SQL_PC_LOG
(
INFO
,
"PS Plan Cache not exist"
,
K
(
tenant_id
));
}
else
{
...
...
src/sql/plan_cache/ob_ps_cache.cpp
浏览文件 @
59df2a1a
...
...
@@ -28,7 +28,6 @@ namespace sql
ObPsCache
::
ObPsCache
()
:
next_ps_stmt_id_
(
0
),
inited_
(
false
),
valid_
(
false
),
tenant_id_
(
OB_INVALID_ID
),
host_
(),
ref_count_
(
0
),
...
...
@@ -96,7 +95,6 @@ int ObPsCache::init(const int64_t hash_bucket,
tenant_id_
=
tenant_id
;
host_
=
addr
;
inited_
=
true
;
valid_
=
true
;
LOG_INFO
(
"init ps plan cache success"
,
K
(
addr
),
K
(
tenant_id
),
K
(
hash_bucket
));
}
}
...
...
@@ -492,9 +490,6 @@ int ObPsCache::get_all_stmt_id(ObIArray<ObPsStmtId> *id_array)
}
else
if
(
!
is_inited
())
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ps_cache is not init yet"
,
K
(
ret
));
}
else
if
(
!
is_valid
())
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ps_cache is not valid anymore"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
stmt_info_map_
.
foreach_refactored
(
op
)))
{
LOG_WARN
(
"traverse stmt_info_map_ failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
op
.
get_callback_ret
()))
{
...
...
@@ -771,9 +766,6 @@ int ObPsCache::inner_cache_evict(bool is_evict_all)
if
(
!
is_inited
())
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ps_cache is not init yet"
,
K
(
ret
));
}
else
if
(
!
is_valid
())
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"ps_cache is not valid anymore"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
stmt_info_map_
.
foreach_refactored
(
op
)))
{
LOG_WARN
(
"traverse stmt_info_map_ failed"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
op
.
get_callback_ret
()))
{
...
...
@@ -835,7 +827,7 @@ int ObPsCache::mem_total(int64_t &mem_total) const
{
int
ret
=
OB_SUCCESS
;
mem_total
=
0
;
if
(
true
==
is_inited
()
&&
true
==
is_valid
()
)
{
if
(
true
==
is_inited
())
{
if
(
OB_ISNULL
(
inner_allocator_
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"inner_allocator_ is NULL"
,
K
(
ret
));
...
...
@@ -843,7 +835,7 @@ int ObPsCache::mem_total(int64_t &mem_total) const
mem_total
=
inner_allocator_
->
total
();
}
}
else
{
LOG_DEBUG
(
"ps cache is not init
or not valid"
,
K
(
ret
),
K
(
is_inited
()),
K
(
is_vali
d
()));
LOG_DEBUG
(
"ps cache is not init
"
,
K
(
ret
),
K
(
is_inite
d
()));
}
return
ret
;
}
...
...
src/sql/plan_cache/ob_ps_cache.h
浏览文件 @
59df2a1a
...
...
@@ -48,8 +48,6 @@ public:
const
common
::
ObAddr
addr
,
const
uint64_t
tenant_id
);
bool
is_inited
()
const
{
return
inited_
;
}
bool
is_valid
()
const
{
return
valid_
;
}
void
set_valid
(
bool
valid
)
{
valid_
=
valid
;
}
int64_t
inc_ref_count
();
void
dec_ref_count
();
int64_t
get_ref_count
()
const
{
return
ref_count_
;
}
...
...
@@ -144,7 +142,6 @@ private:
ObPsStmtId
next_ps_stmt_id_
;
bool
inited_
;
bool
valid_
;
int64_t
tenant_id_
;
common
::
ObAddr
host_
;
volatile
int64_t
ref_count_
;
...
...
src/sql/session/ob_sql_session_info.cpp
浏览文件 @
59df2a1a
...
...
@@ -886,7 +886,7 @@ ObPsCache *ObSQLSessionInfo::get_ps_cache()
{
if
(
OB_ISNULL
(
plan_cache_manager_
))
{
LOG_WARN
(
"invalid status"
,
K_
(
ps_cache
),
K_
(
plan_cache_manager
));
}
else
if
(
OB_NOT_NULL
(
ps_cache_
)
&&
ps_cache_
->
is_valid
()
)
{
}
else
if
(
OB_NOT_NULL
(
ps_cache_
))
{
//do nothing
}
else
{
int
ret
=
OB_SUCCESS
;
...
...
@@ -906,7 +906,7 @@ ObPsCache *ObSQLSessionInfo::get_ps_cache()
ps_cache_
=
plan_cache_manager_
->
get_or_create_ps_cache
(
tenant_id
,
pc_mem_conf
);
if
(
OB_ISNULL
(
ps_cache_
))
{
LOG_WARN
(
"failed to get ps pl
an cache"
);
LOG_WARN
(
"failed to get ps plan cache"
);
}
else
{
ps_session_info_allocator_
.
set_attr
(
mem_attr
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录