Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
oceanbase
oceanbase
提交
b4bfa011
O
oceanbase
项目概览
oceanbase
/
oceanbase
8 个月 前同步成功
通知
260
Star
6084
Fork
1301
代码
文件
提交
分支
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,体验更适合开发者的 AI 搜索 >>
提交
b4bfa011
编写于
7月 15, 2022
作者:
O
obdev
提交者:
wangzelin.wzl
7月 15, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[CP] [CP] fix bug that a tranction span tenant
上级
20910756
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
8 deletion
+14
-8
src/rootserver/ob_global_index_builder.cpp
src/rootserver/ob_global_index_builder.cpp
+6
-0
src/rootserver/ob_index_builder.cpp
src/rootserver/ob_index_builder.cpp
+4
-0
src/rootserver/ob_snapshot_info_manager.cpp
src/rootserver/ob_snapshot_info_manager.cpp
+2
-4
src/rootserver/ob_snapshot_info_manager.h
src/rootserver/ob_snapshot_info_manager.h
+2
-4
未找到文件。
src/rootserver/ob_global_index_builder.cpp
浏览文件 @
b4bfa011
...
...
@@ -1216,6 +1216,12 @@ int ObGlobalIndexBuilder::hold_snapshot(const ObGlobalIndexTask* task, const int
LOG_WARN
(
"fail to start trans"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
ddl_service_
->
get_snapshot_mgr
().
acquire_snapshot
(
trans
,
info1
)))
{
LOG_WARN
(
"fail to acquire snapshot"
,
K
(
ret
));
}
else
if
(
!
info2
.
is_valid
())
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
info2
));
}
else
if
(
OB_FAIL
(
ddl_service_
->
get_snapshot_mgr
().
set_index_building_snapshot
(
proxy
,
info2
.
table_id_
,
info2
.
snapshot_ts_
)))
{
LOG_WARN
(
"fail to set index building snapshot"
,
KR
(
ret
),
K
(
info2
));
}
else
if
(
OB_FAIL
(
ddl_service_
->
get_snapshot_mgr
().
acquire_snapshot_for_building_index
(
trans
,
info2
,
info2
.
table_id_
)))
{
LOG_WARN
(
"fail to acquire snapshot"
,
K
(
ret
));
...
...
src/rootserver/ob_index_builder.cpp
浏览文件 @
b4bfa011
...
...
@@ -931,9 +931,13 @@ int ObRSBuildIndexTask::acquire_snapshot(const int64_t snapshot_version, const i
info
.
schema_version_
=
schema_version
;
info
.
tenant_id_
=
extract_tenant_id
(
index_id_
);
info
.
table_id_
=
data_table_id
;
common
::
ObMySQLProxy
&
proxy
=
ddl_service_
->
get_sql_proxy
();
if
(
!
info
.
is_valid
())
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
info
));
}
else
if
(
OB_FAIL
(
ddl_service_
->
get_snapshot_mgr
().
set_index_building_snapshot
(
proxy
,
info
.
table_id_
,
info
.
snapshot_ts_
)))
{
LOG_WARN
(
"fail to set index building snapshot"
,
KR
(
ret
),
K
(
info
));
}
else
if
(
OB_FAIL
(
ddl_service_
->
get_snapshot_mgr
().
acquire_snapshot_for_building_index
(
trans
,
info
,
index_id_
)))
{
LOG_WARN
(
"fail to acquire snapshot"
,
K
(
ret
),
K
(
index_id_
),
K
(
data_table_id
),
K
(
info
));
}
...
...
src/rootserver/ob_snapshot_info_manager.cpp
浏览文件 @
b4bfa011
...
...
@@ -34,7 +34,7 @@ int ObSnapshotInfoManager::init(const ObAddr& self_addr)
}
int
ObSnapshotInfoManager
::
set_index_building_snapshot
(
common
::
ObMySQL
Transaction
&
trans
,
const
int64_t
index_table_id
,
const
int64_t
snapshot_ts
)
common
::
ObMySQL
Proxy
&
proxy
,
const
int64_t
index_table_id
,
const
int64_t
snapshot_ts
)
{
int
ret
=
OB_SUCCESS
;
ObSqlString
sql
;
...
...
@@ -49,7 +49,7 @@ int ObSnapshotInfoManager::set_index_building_snapshot(
ObSchemaUtils
::
get_extract_schema_id
(
tenant_id
,
index_table_id
),
ObSchemaUtils
::
get_extract_tenant_id
(
tenant_id
,
tenant_id
))))
{
LOG_WARN
(
"fail to update index building snapshot"
,
KR
(
ret
),
K
(
index_table_id
),
K
(
snapshot_ts
));
}
else
if
(
OB_FAIL
(
trans
.
write
(
tenant_id
,
sql
.
ptr
(),
affected_rows
)))
{
}
else
if
(
OB_FAIL
(
proxy
.
write
(
tenant_id
,
sql
.
ptr
(),
affected_rows
)))
{
LOG_WARN
(
"fail to write sql"
,
KR
(
ret
),
K
(
sql
));
}
else
if
(
1
!=
affected_rows
&&
0
!=
affected_rows
)
{
ret
=
OB_ERR_UNEXPECTED
;
...
...
@@ -66,8 +66,6 @@ int ObSnapshotInfoManager::acquire_snapshot_for_building_index(
if
(
!
snapshot
.
is_valid
())
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
K
(
snapshot
));
}
else
if
(
OB_FAIL
(
set_index_building_snapshot
(
trans
,
index_table_id
,
snapshot
.
snapshot_ts_
)))
{
LOG_WARN
(
"fail to set index building snapshot"
,
KR
(
ret
),
K
(
snapshot
));
}
else
if
(
OB_FAIL
(
snapshot_proxy
.
add_snapshot
(
trans
,
snapshot
)))
{
LOG_WARN
(
"fail to add snapshot"
,
K
(
ret
));
}
...
...
src/rootserver/ob_snapshot_info_manager.h
浏览文件 @
b4bfa011
...
...
@@ -39,12 +39,10 @@ public:
int
check_restore_point
(
common
::
ObMySQLProxy
&
proxy
,
const
int64_t
tenant_id
,
const
int64_t
table_id
,
bool
&
is_exist
);
int
get_snapshot_count
(
common
::
ObMySQLProxy
&
proxy
,
const
int64_t
tenant_id
,
share
::
ObSnapShotType
snapshot_type
,
int64_t
&
count
);
common
::
ObMySQLProxy
&
proxy
,
const
int64_t
tenant_id
,
share
::
ObSnapShotType
snapshot_type
,
int64_t
&
count
);
int
set_index_building_snapshot
(
common
::
ObMySQLProxy
&
proxy
,
const
int64_t
index_table_id
,
const
int64_t
snapshot_ts
);
private:
int
set_index_building_snapshot
(
common
::
ObMySQLTransaction
&
trans
,
const
int64_t
index_table_id
,
const
int64_t
snapshot_ts
);
DISALLOW_COPY_AND_ASSIGN
(
ObSnapshotInfoManager
);
private:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录