Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
知世而放
oceanbase
提交
cd2ffe63
O
oceanbase
项目概览
知世而放
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
oceanbase
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cd2ffe63
编写于
9月 24, 2021
作者:
T
Tyshawn
提交者:
wangzelin.wzl
9月 24, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix schedule fast gc sstable after stop server
上级
81b151f0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
59 addition
and
82 deletion
+59
-82
deps/oblib/src/lib/alloc/object_set.cpp
deps/oblib/src/lib/alloc/object_set.cpp
+2
-1
deps/oblib/src/lib/allocator/ob_mem_leak_checker.h
deps/oblib/src/lib/allocator/ob_mem_leak_checker.h
+4
-3
deps/oblib/src/lib/rc/context.cpp
deps/oblib/src/lib/rc/context.cpp
+4
-4
deps/oblib/src/lib/rc/context.h
deps/oblib/src/lib/rc/context.h
+47
-73
src/observer/ob_dump_task_generator.cpp
src/observer/ob_dump_task_generator.cpp
+1
-1
src/storage/ob_table_mgr.cpp
src/storage/ob_table_mgr.cpp
+1
-0
未找到文件。
deps/oblib/src/lib/alloc/object_set.cpp
浏览文件 @
cd2ffe63
...
...
@@ -509,7 +509,8 @@ void ObjectSet::reset()
if
(
!
has_unfree
)
{
int64_t
pos
=
snprintf
(
buf
,
buf_len
,
"label: %s, static_id: %d, static_info: %s, dynamic_info: %s"
,
"context: %p, label: %s, static_id: 0x%lx, static_info: %s, dynamic_info: %s"
,
mem_context_
,
label
,
mem_context_
->
get_static_id
(),
common
::
to_cstring
(
mem_context_
->
get_static_info
()),
...
...
deps/oblib/src/lib/allocator/ob_mem_leak_checker.h
浏览文件 @
cd2ffe63
...
...
@@ -87,7 +87,7 @@ public:
{
return
LABEL_CHECK
==
ct_
;
}
int
get_static_id
()
const
int
64_t
get_static_id
()
const
{
return
static_id_
;
}
...
...
@@ -118,7 +118,8 @@ public:
char
*
end
=
(
char
*
)
memchr
(
cpy
,
'@'
,
strlen
(
cpy
));
if
(
end
!=
nullptr
)
{
tmp_ct
=
CONTEXT_CHECK
;
static_id_
=
atoi
(
end
+
1
);
static_id_
=
0
;
sscanf
(
end
+
1
,
"0x%lx"
,
&
static_id_
);
*
end
=
'\0'
;
is_wildcard_
=
0
==
STRCMP
(
"*"
,
cpy
);
}
else
{
...
...
@@ -278,7 +279,7 @@ private:
char
label_
[
lib
::
AOBJECT_LABEL_SIZE
+
1
];
};
CheckType
ct_
;
int
static_id_
;
int
64_t
static_id_
;
bool
is_wildcard_
;
int
len_
;
mod_alloc_info_t
malloc_info_
;
...
...
deps/oblib/src/lib/rc/context.cpp
浏览文件 @
cd2ffe63
...
...
@@ -32,10 +32,10 @@ __MemoryContext__& __MemoryContext__::root()
param
.
set_properties
(
ADD_CHILD_THREAD_SAFE
|
ALLOC_THREAD_SAFE
)
.
set_parallel
(
4
)
.
set_mem_attr
(
OB_SERVER_TENANT_ID
,
ObModIds
::
OB_ROOT_CONTEXT
,
ObCtxIds
::
DEFAULT_CTX_ID
);
//
ObMallocAllocator to design a non-destroy mode
const
static
int
static_id
=
StaticInfos
::
get_instance
().
add
(
__FILENAME__
,
__LINE__
,
__FUNCTION__
)
;
__MemoryContext__
*
tmp
=
new
(
std
::
nothrow
)
__MemoryContext__
(
false
,
DynamicInfo
(),
nullptr
,
param
,
static_id
);
//
root_context相对底层,被其他static对象依赖,而static对象之间析构顺序又是不确定的,
// So here is modeled on ObMallocAllocator to design a non-destroy mode
static
StaticInfo
static_info
{
__FILENAME__
,
__LINE__
,
__FUNCTION__
}
;
__MemoryContext__
*
tmp
=
new
(
std
::
nothrow
)
__MemoryContext__
(
false
,
DynamicInfo
(),
nullptr
,
param
,
&
static_info
);
abort_unless
(
tmp
!=
nullptr
);
int
ret
=
tmp
->
init
();
abort_unless
(
OB_SUCCESS
==
ret
);
...
...
deps/oblib/src/lib/rc/context.h
浏览文件 @
cd2ffe63
...
...
@@ -35,25 +35,25 @@ namespace lib {
#define CURRENT_CONTEXT lib::Flow::current_ctx()
#define ROOT_CONTEXT lib::MemoryContext::root()
#define CREATE_CONTEXT(args...) CREATE_CONTEXT_(CONCAT(static_i
d
, __COUNTER__), args)
#define CREATE_CONTEXT(args...) CREATE_CONTEXT_(CONCAT(static_i
nfo
, __COUNTER__), args)
#define DESTROY_CONTEXT(context) lib::__MemoryContext__::destory_context(context)
#define WITH_CONTEXT(context) WITH_CONTEXT_P(true, context)
#define WITH_CONTEXT_P(condition, context) CONTEXT_P(condition, lib::ContextSource::WITH, context)
#define CREATE_WITH_TEMP_CONTEXT(...) CREATE_WITH_TEMP_CONTEXT_P(true, __VA_ARGS__)
#define CREATE_WITH_TEMP_CONTEXT_P(condition, args...) \
CREATE_WITH_TEMP_CONTEXT_P_(CONCAT(static_i
d
, __COUNTER__), condition, args)
CREATE_WITH_TEMP_CONTEXT_P_(CONCAT(static_i
nfo
, __COUNTER__), condition, args)
// The following are auxiliary macros
#define CREATE_CONTEXT_(static_i
d, context, args...)
\
create_context(context, lib::DynamicInfo(), args, ({
\
const static int static_id = lib::StaticInfos::get_instance().add(__FILENAME__, __LINE__, __FUNCTION__)
; \
static_id;
\
#define CREATE_CONTEXT_(static_i
nfo, context, args...)
\
create_context(context, lib::DynamicInfo(), args, ({ \
static lib::StaticInfo static_info{__FILENAME__, __LINE__, __FUNCTION__}
; \
&static_info;
\
}))
#define CONTEXT_P(condition, context_source, ...) \
for (lib::_S<context_source> _s{condition, __VA_ARGS__}; OB_SUCC(ret) && _s.i_-- > 0; _s.i_--) \
if (OB_SUCC(_s.get_ret()))
#define CREATE_WITH_TEMP_CONTEXT_P_(static_i
d, condition, ...)
\
const static int static_id = lib::StaticInfos::get_instance().add(__FILENAME__, __LINE__, __FUNCTION__)
; \
CONTEXT_P(condition, lib::ContextSource::CREATE, lib::DynamicInfo(), __VA_ARGS__,
static_id
)
#define CREATE_WITH_TEMP_CONTEXT_P_(static_i
nfo, condition, ...)
\
static lib::StaticInfo static_info{__FILENAME__, __LINE__, __FUNCTION__}
; \
CONTEXT_P(condition, lib::ContextSource::CREATE, lib::DynamicInfo(), __VA_ARGS__,
&static_info
)
using
std
::
nullptr_t
;
using
lib
::
ObMemAttr
;
...
...
@@ -233,39 +233,6 @@ struct StaticInfo {
TO_STRING_KV
(
K
(
filename_
),
K
(
line_
),
K
(
function_
));
};
class
StaticInfos
{
public:
StaticInfos
()
:
cnt_
(
0
)
{}
static
StaticInfos
&
get_instance
()
{
static
StaticInfos
one
;
return
one
;
}
int
get_cnt
()
const
{
return
cnt_
;
}
int
add
(
const
char
*
filename
,
const
int
line
,
const
char
*
function
)
{
int
pos
=
ATOMIC_FAA
(
&
cnt_
,
1
);
abort_unless
(
pos
<
MAX_NUM
&&
nullptr
==
infos_
[
pos
].
filename_
);
infos_
[
pos
]
=
{
filename
,
line
,
function
};
const
int
static_id
=
pos
;
OB_LOG
(
INFO
,
"add info"
,
K
(
static_id
),
"info"
,
infos_
[
static_id
]);
return
static_id
;
}
const
StaticInfo
&
get
(
const
int
static_id
)
const
{
return
infos_
[
static_id
];
}
private:
static
const
int
MAX_NUM
=
128
;
StaticInfo
infos_
[
MAX_NUM
];
int
cnt_
;
};
struct
DynamicInfo
{
DynamicInfo
()
:
tid_
(
GETTID
()),
cid_
(
CO_IS_ENABLED
()
?
CO_ID
()
:
0lu
),
create_time_
(
common
::
ObTimeUtility
::
fast_current_time
())
...
...
@@ -315,30 +282,36 @@ public:
}
public:
__MemoryContext__
(
const
bool
need_free
,
const
DynamicInfo
&
di
,
__MemoryContext__
*
parent
,
ContextParam
&
param
,
const
int
static_id
)
:
magic_code_
(
-
1
),
seq_id_
(
-
1
),
need_free_
(
need_free
),
tree_node_
(
parent
!=
nullptr
?
&
parent
->
tree_node_
:
nullptr
,
param
.
properties_
&
ADD_CHILD_THREAD_SAFE
),
di_
(
di
),
param_
(
param
),
properties_
(
param
.
properties_
),
static_id_
(
static_id
),
p_alloc_
(
nullptr
),
p_arena_alloc_
(
nullptr
),
p_safe_arena_alloc_
(
nullptr
),
parallel_alloc_
(
nullptr
),
freeable_alloc_
(
nullptr
),
default_allocator_
(
nullptr
)
{
}
int
get_static_id
()
const
{
return
static_id_
;
}
const
DynamicInfo
&
get_dynamic_info
()
const
{
return
di_
;
}
const
StaticInfo
&
get_static_info
()
const
{
return
StaticInfos
::
get_instance
().
get
(
static_id_
);
}
void
*
allocf
(
const
int64_t
size
,
const
ObMemAttr
&
attr
=
default_memattr
)
__MemoryContext__
(
const
bool
need_free
,
const
DynamicInfo
&
di
,
__MemoryContext__
*
parent
,
ContextParam
&
param
,
const
StaticInfo
*
static_info
)
:
magic_code_
(
-
1
),
seq_id_
(
-
1
),
need_free_
(
need_free
),
tree_node_
(
parent
!=
nullptr
?
&
parent
->
tree_node_
:
nullptr
,
param
.
properties_
&
ADD_CHILD_THREAD_SAFE
),
di_
(
di
),
param_
(
param
),
properties_
(
param
.
properties_
),
static_id_
(
reinterpret_cast
<
int64_t
>
(
static_info
)),
p_alloc_
(
nullptr
),
p_arena_alloc_
(
nullptr
),
p_safe_arena_alloc_
(
nullptr
),
parallel_alloc_
(
nullptr
),
freeable_alloc_
(
nullptr
),
default_allocator_
(
nullptr
)
{}
int64_t
get_static_id
()
const
{
return
static_id_
;
}
const
DynamicInfo
&
get_dynamic_info
()
const
{
return
di_
;
}
const
StaticInfo
&
get_static_info
()
const
{
return
*
reinterpret_cast
<
StaticInfo
*>
(
static_id_
);
}
void
*
allocf
(
const
int64_t
size
,
const
ObMemAttr
&
attr
=
default_memattr
)
{
return
freeable_alloc_
->
alloc
(
size
,
attr
);
}
...
...
@@ -407,12 +380,13 @@ public:
return
*
default_allocator_
;
}
static
__MemoryContext__
&
root
();
bool
check_magic_code
()
const
{
return
MAGIC_CODE
==
magic_code_
;
}
TO_STRING_KV
(
KP
(
this
),
"static_id"
,
static_id_
,
"static_info"
,
StaticInfos
::
get_instance
().
get
(
static_id_
),
"dynamic info"
,
di_
,
K
(
properties_
),
K
(
attr_
));
bool
check_magic_code
()
const
{
return
MAGIC_CODE
==
magic_code_
;
}
TO_STRING_KV
(
KP
(
this
),
"static_id"
,
static_id_
,
"static_info"
,
*
reinterpret_cast
<
StaticInfo
*>
(
static_id_
),
"dynamic info"
,
di_
,
K
(
properties_
),
K
(
attr_
));
private:
static
__MemoryContext__
*
node2context
(
TreeNode
*
node
)
{
...
...
@@ -590,7 +564,7 @@ public:
DynamicInfo
di_
;
ContextParam
param_
;
int64_t
properties_
;
int
static_id_
;
int
64_t
static_id_
;
common
::
ObMemAttr
attr_
;
// Delayed member
...
...
src/observer/ob_dump_task_generator.cpp
浏览文件 @
cd2ffe63
...
...
@@ -180,7 +180,7 @@ void ObDumpTaskGenerator::dump_memory_leak()
pos
+=
snprintf
(
buf
+
pos
,
buf_len
-
pos
,
"
\n
######## LEAK_CHECKER (origin_str = %s, label_ = %s, check_type = %d, "
"static_id_ =
%d
, current_ts = %ld)########
\n
"
,
"static_id_ =
0x%lx
, current_ts = %ld)########
\n
"
,
get_mem_leak_checker
().
get_str
(),
get_mem_leak_checker
().
get_label
(),
get_mem_leak_checker
().
get_check_type
(),
...
...
src/storage/ob_table_mgr.cpp
浏览文件 @
cd2ffe63
...
...
@@ -116,6 +116,7 @@ void ObTableMgr::stop()
LOG_INFO
(
"ObTableMgr::stop"
);
TG_STOP
(
lib
::
TGDefIDs
::
TableMgrGC
);
TG_WAIT
(
lib
::
TGDefIDs
::
TableMgrGC
);
is_gc_started_
=
false
;
LOG_INFO
(
"timer stopped"
);
ObBucketWLockAllGuard
guard
(
sstable_bucket_lock_
);
enable_write_log_
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录