Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Metz
oceanbase
提交
f935bcf9
O
oceanbase
项目概览
Metz
/
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,发现更多精彩内容 >>
提交
f935bcf9
编写于
1月 14, 2022
作者:
Y
ym0
提交者:
LINGuanRen
1月 14, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PHYSICAL RESTORE] Avoid coredump while create user partitions
上级
e14104e3
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
4 deletion
+29
-4
src/rootserver/ob_ddl_service.cpp
src/rootserver/ob_ddl_service.cpp
+3
-0
src/rootserver/ob_root_service.cpp
src/rootserver/ob_root_service.cpp
+24
-4
src/rootserver/restore/ob_restore_scheduler.cpp
src/rootserver/restore/ob_restore_scheduler.cpp
+1
-0
src/share/ob_debug_sync_point.h
src/share/ob_debug_sync_point.h
+1
-0
未找到文件。
src/rootserver/ob_ddl_service.cpp
浏览文件 @
f935bcf9
...
@@ -6475,6 +6475,9 @@ int ObDDLService::create_table_partitions_for_physical_restore(const obrpc::ObRe
...
@@ -6475,6 +6475,9 @@ int ObDDLService::create_table_partitions_for_physical_restore(const obrpc::ObRe
LOG_WARN("root_balancer_ is null", K(ret));
LOG_WARN("root_balancer_ is null", K(ret));
} else if (OB_FAIL(schema_guard.get_table_schema(table_id, table_schema))) {
} else if (OB_FAIL(schema_guard.get_table_schema(table_id, table_schema))) {
LOG_WARN("fail to get table", K(ret), K(table_id));
LOG_WARN("fail to get table", K(ret), K(table_id));
} else if (OB_ISNULL(table_schema)) {
ret = OB_TABLE_NOT_EXIST;
LOG_WARN("table not exist. table may be droppped concurrently in physical restore", KR(ret), K(table_id));
} else if (OB_FAIL(root_balancer_->alloc_partitions_for_create(*table_schema, create_mode, table_addr))) {
} else if (OB_FAIL(root_balancer_->alloc_partitions_for_create(*table_schema, create_mode, table_addr))) {
LOG_WARN("alloc partition address failed", K(ret), KPC(table_schema));
LOG_WARN("alloc partition address failed", K(ret), KPC(table_schema));
} else if (OB_FAIL(create_partitions_for_physical_restore(
} else if (OB_FAIL(create_partitions_for_physical_restore(
src/rootserver/ob_root_service.cpp
浏览文件 @
f935bcf9
...
@@ -8487,7 +8487,7 @@ int ObRootService::physical_restore_tenant(const obrpc::ObPhysicalRestoreTenantA
...
@@ -8487,7 +8487,7 @@ int ObRootService::physical_restore_tenant(const obrpc::ObPhysicalRestoreTenantA
int
ret
=
OB_SUCCESS
;
int
ret
=
OB_SUCCESS
;
int64_t
gc_snapshot_ts
=
OB_INVALID_TIMESTAMP
;
int64_t
gc_snapshot_ts
=
OB_INVALID_TIMESTAMP
;
int64_t
current_timestamp
=
ObTimeUtility
::
current_time
();
int64_t
current_timestamp
=
ObTimeUtility
::
current_time
();
const
int64_t
RESTORE_TIMESTAMP_DETA
=
10
*
1000
*
1000L
;
// 防止恢复到未来的某个时间
const
int64_t
RESTORE_TIMESTAMP_DETA
=
10
*
1000
*
1000L
;
int64_t
job_id
=
OB_INVALID_ID
;
int64_t
job_id
=
OB_INVALID_ID
;
ObSchemaGetterGuard
schema_guard
;
ObSchemaGetterGuard
schema_guard
;
if
(
!
inited_
)
{
if
(
!
inited_
)
{
...
@@ -11743,10 +11743,13 @@ int ObRootService::purge_recyclebin_objects(int64_t purge_each_time)
...
@@ -11743,10 +11743,13 @@ int ObRootService::purge_recyclebin_objects(int64_t purge_each_time)
// always passed
// always passed
int64_t
expire_timeval
=
GCONF
.
recyclebin_object_expire_time
;
int64_t
expire_timeval
=
GCONF
.
recyclebin_object_expire_time
;
ObSEArray
<
uint64_t
,
16
>
tenant_ids
;
ObSEArray
<
uint64_t
,
16
>
tenant_ids
;
ObSchemaGetterGuard
guard
;
if
(
OB_ISNULL
(
schema_service_
))
{
if
(
OB_ISNULL
(
schema_service_
))
{
ret
=
OB_ERR_UNEXPECTED
;
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"schema_serviece_ is null"
,
KR
(
ret
));
LOG_WARN
(
"schema_serviece_ is null"
,
KR
(
ret
));
}
else
if
(
OB_FAIL
(
schema_service_
->
get_tenant_ids
(
tenant_ids
)))
{
}
else
if
(
OB_FAIL
(
schema_service_
->
get_tenant_schema_guard
(
OB_SYS_TENANT_ID
,
guard
)))
{
LOG_WARN
(
"fail to get sys schema guard"
,
KR
(
ret
));
}
else
if
(
OB_FAIL
(
guard
.
get_tenant_ids
(
tenant_ids
)))
{
LOG_WARN
(
"get all tenants failed"
,
KR
(
ret
));
LOG_WARN
(
"get all tenants failed"
,
KR
(
ret
));
}
else
{
}
else
{
const
int64_t
current_time
=
ObTimeUtility
::
current_time
();
const
int64_t
current_time
=
ObTimeUtility
::
current_time
();
...
@@ -11756,19 +11759,36 @@ int ObRootService::purge_recyclebin_objects(int64_t purge_each_time)
...
@@ -11756,19 +11759,36 @@ int ObRootService::purge_recyclebin_objects(int64_t purge_each_time)
obrpc
::
Int64
affected_rows
=
0
;
obrpc
::
Int64
affected_rows
=
0
;
obrpc
::
ObPurgeRecycleBinArg
arg
;
obrpc
::
ObPurgeRecycleBinArg
arg
;
int64_t
purge_sum
=
purge_each_time
;
int64_t
purge_sum
=
purge_each_time
;
const
bool
is_standby
=
PRIMARY_CLUSTER
!=
ObClusterInfoGetter
::
get_cluster_type_v2
();
const
ObSimpleTenantSchema
*
simple_tenant
=
NULL
;
// ignore ret
// ignore ret
for
(
int
i
=
0
;
i
<
tenant_ids
.
count
()
&&
in_service
()
&&
purge_sum
>
0
;
++
i
)
{
for
(
int
i
=
0
;
i
<
tenant_ids
.
count
()
&&
in_service
()
&&
purge_sum
>
0
;
++
i
)
{
int64_t
purge_time
=
GCONF
.
_recyclebin_object_purge_frequency
;
int64_t
purge_time
=
GCONF
.
_recyclebin_object_purge_frequency
;
const
uint64_t
tenant_id
=
tenant_ids
.
at
(
i
);
if
(
purge_time
<=
0
)
{
if
(
purge_time
<=
0
)
{
break
;
break
;
}
}
if
(
OB_SYS_TENANT_ID
!=
tenant_id
&&
is_standby
)
{
// standby cluster won't purge recyclebin automacially.
LOG_TRACE
(
"user tenant won't purge recyclebin automacially in standby cluster"
,
K
(
tenant_id
));
continue
;
}
else
if
(
OB_FAIL
(
guard
.
get_tenant_info
(
tenant_id
,
simple_tenant
)))
{
LOG_WARN
(
"fail to get simple tenant schema"
,
KR
(
ret
),
K
(
tenant_id
));
}
else
if
(
OB_ISNULL
(
simple_tenant
))
{
ret
=
OB_TENANT_NOT_EXIST
;
LOG_WARN
(
"simple tenant schema not exist"
,
KR
(
ret
),
K
(
tenant_id
));
}
else
if
(
!
simple_tenant
->
is_normal
())
{
// only deal with normal tenant.
LOG_TRACE
(
"tenant which isn't normal won't purge recyclebin automacially"
,
K
(
tenant_id
));
continue
;
}
// ignore error code of different tenant
// ignore error code of different tenant
ret
=
OB_SUCCESS
;
ret
=
OB_SUCCESS
;
affected_rows
=
0
;
affected_rows
=
0
;
arg
.
tenant_id_
=
tenant_id
s
.
at
(
i
)
;
arg
.
tenant_id_
=
tenant_id
;
arg
.
expire_time_
=
expire_time
;
arg
.
expire_time_
=
expire_time
;
arg
.
auto_purge_
=
true
;
arg
.
auto_purge_
=
true
;
arg
.
exec_tenant_id_
=
tenant_id
s
.
at
(
i
)
;
arg
.
exec_tenant_id_
=
tenant_id
;
LOG_INFO
(
"start purge recycle objects of tenant"
,
K
(
arg
),
K
(
purge_sum
));
LOG_INFO
(
"start purge recycle objects of tenant"
,
K
(
arg
),
K
(
purge_sum
));
while
(
OB_SUCC
(
ret
)
&&
in_service
()
&&
purge_sum
>
0
)
{
while
(
OB_SUCC
(
ret
)
&&
in_service
()
&&
purge_sum
>
0
)
{
int64_t
start_time
=
ObTimeUtility
::
current_time
();
int64_t
start_time
=
ObTimeUtility
::
current_time
();
...
...
src/rootserver/restore/ob_restore_scheduler.cpp
浏览文件 @
f935bcf9
...
@@ -2610,6 +2610,7 @@ int ObRestoreScheduler::create_user_partitions(const ObPhysicalRestoreJob& job_i
...
@@ -2610,6 +2610,7 @@ int ObRestoreScheduler::create_user_partitions(const ObPhysicalRestoreJob& job_i
LOG_WARN
(
"fail to get tenant tablegroup schemas"
,
KR
(
ret
),
K
(
tenant_id
));
LOG_WARN
(
"fail to get tenant tablegroup schemas"
,
KR
(
ret
),
K
(
tenant_id
));
}
else
{
}
else
{
// Only non-delay-deleted PG/Standalone partitions should be created.
// Only non-delay-deleted PG/Standalone partitions should be created.
DEBUG_SYNC
(
BEFORE_SEND_RESTORE_PARTITIONS_RPC
);
const
int64_t
DEFAULT_TIMEOUT
=
10
*
1000
*
1000L
;
// 10s
const
int64_t
DEFAULT_TIMEOUT
=
10
*
1000
*
1000L
;
// 10s
const
int64_t
TIMEOUT_PER_RPC
=
GCONF
.
rpc_timeout
;
// 2s
const
int64_t
TIMEOUT_PER_RPC
=
GCONF
.
rpc_timeout
;
// 2s
const
int64_t
PARTITION_CNT_PER_RPC
=
5
;
const
int64_t
PARTITION_CNT_PER_RPC
=
5
;
...
...
src/share/ob_debug_sync_point.h
浏览文件 @
f935bcf9
...
@@ -293,6 +293,7 @@ class ObString;
...
@@ -293,6 +293,7 @@ class ObString;
ACT(BACKUP_BACKUPPIECE_AFTER_SCHEDULE, ) \
ACT(BACKUP_BACKUPPIECE_AFTER_SCHEDULE, ) \
ACT(FOLLOWER_BEFORE_UPDATE_RESTORE_FLAG_RESTORE_LOG, ) \
ACT(FOLLOWER_BEFORE_UPDATE_RESTORE_FLAG_RESTORE_LOG, ) \
ACT(BEFORE_GLOBAL_INDEX_BUILDER_MOVE_TASK, ) \
ACT(BEFORE_GLOBAL_INDEX_BUILDER_MOVE_TASK, ) \
ACT(BEFORE_SEND_RESTORE_PARTITIONS_RPC, ) \
ACT(MAX_DEBUG_SYNC_POINT, )
ACT(MAX_DEBUG_SYNC_POINT, )
DECLARE_ENUM
(
ObDebugSyncPoint
,
debug_sync_point
,
OB_DEBUG_SYNC_POINT_DEF
);
DECLARE_ENUM
(
ObDebugSyncPoint
,
debug_sync_point
,
OB_DEBUG_SYNC_POINT_DEF
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录