Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
clmforever
oceanbase
提交
1613b26c
O
oceanbase
项目概览
clmforever
/
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,发现更多精彩内容 >>
提交
1613b26c
编写于
12月 03, 2021
作者:
Y
ym0
提交者:
LINGuanRen
12月 03, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Support to get flag replica by ObPartitionTableOperator
上级
86370d23
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
104 addition
and
49 deletion
+104
-49
src/rootserver/ob_global_index_builder.cpp
src/rootserver/ob_global_index_builder.cpp
+9
-1
src/rootserver/ob_index_builder.cpp
src/rootserver/ob_index_builder.cpp
+2
-1
src/share/partition_table/ob_inmemory_partition_table.cpp
src/share/partition_table/ob_inmemory_partition_table.cpp
+3
-4
src/share/partition_table/ob_inmemory_partition_table.h
src/share/partition_table/ob_inmemory_partition_table.h
+3
-2
src/share/partition_table/ob_ipartition_table.h
src/share/partition_table/ob_ipartition_table.h
+4
-2
src/share/partition_table/ob_partition_table_iterator.cpp
src/share/partition_table/ob_partition_table_iterator.cpp
+15
-4
src/share/partition_table/ob_partition_table_iterator.h
src/share/partition_table/ob_partition_table_iterator.h
+10
-2
src/share/partition_table/ob_partition_table_operator.cpp
src/share/partition_table/ob_partition_table_operator.cpp
+18
-6
src/share/partition_table/ob_partition_table_operator.h
src/share/partition_table/ob_partition_table_operator.h
+3
-2
src/share/partition_table/ob_persistent_partition_table.cpp
src/share/partition_table/ob_persistent_partition_table.cpp
+7
-10
src/share/partition_table/ob_persistent_partition_table.h
src/share/partition_table/ob_persistent_partition_table.h
+3
-2
src/share/partition_table/ob_remote_partition_table_operator.cpp
...re/partition_table/ob_remote_partition_table_operator.cpp
+6
-4
src/share/partition_table/ob_remote_partition_table_operator.h
...hare/partition_table/ob_remote_partition_table_operator.h
+4
-2
src/share/partition_table/ob_rpc_partition_table.cpp
src/share/partition_table/ob_rpc_partition_table.cpp
+5
-4
src/share/partition_table/ob_rpc_partition_table.h
src/share/partition_table/ob_rpc_partition_table.h
+3
-2
src/storage/ob_partition_service.cpp
src/storage/ob_partition_service.cpp
+9
-1
未找到文件。
src/rootserver/ob_global_index_builder.cpp
浏览文件 @
1613b26c
...
...
@@ -1487,6 +1487,9 @@ int ObGlobalIndexBuilder::drive_this_copy_multi_replica(const share::schema::ObT
}
else
{
bool
all_copy_finish
=
true
;
int64_t
major_sstable_exist_reply_ts
=
0
;
const
bool
need_fail_list
=
false
;
const
int64_t
cluster_id
=
OB_INVALID_ID
;
// local cluster
const
bool
filter_flag_replica
=
false
;
common
::
ObArray
<
PartitionSSTableBuildStat
>
partition_sstable_stat_array
;
{
SpinWLockGuard
item_guard
(
task
->
lock_
);
...
...
@@ -1515,7 +1518,12 @@ int ObGlobalIndexBuilder::drive_this_copy_multi_replica(const share::schema::ObT
if
(
!
pkey
.
is_valid
())
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"pkey invalid"
,
K
(
ret
),
K
(
pkey
));
}
else
if
(
OB_FAIL
(
pt_operator_
->
get
(
pkey
.
get_table_id
(),
pkey
.
get_partition_id
(),
info
)))
{
}
else
if
(
OB_FAIL
(
pt_operator_
->
get
(
pkey
.
get_table_id
(),
pkey
.
get_partition_id
(),
info
,
need_fail_list
,
cluster_id
,
filter_flag_replica
)))
{
LOG_WARN
(
"fail to get partition info"
,
K
(
ret
),
K
(
pkey
));
}
else
if
(
OB_FAIL
(
filter
.
set_replica_status
(
REPLICA_STATUS_NORMAL
)))
{
LOG_WARN
(
"fail to set replica status"
,
K
(
ret
));
...
...
src/rootserver/ob_index_builder.cpp
浏览文件 @
1613b26c
...
...
@@ -720,6 +720,7 @@ int ObRSBuildIndexTask::wait_build_index_end(bool& is_end)
const
ObTableSchema
*
index_schema
=
NULL
;
const
ObTableSchema
*
table_schema
=
NULL
;
ObIndexBuildStatus
all_status
;
const
bool
filter_flag_replica
=
false
;
ObTablePartitionIterator
iter
;
ObReplicaFilterHolder
filter
;
int64_t
table_id
=
OB_INVALID_ID
;
...
...
@@ -758,7 +759,7 @@ int ObRSBuildIndexTask::wait_build_index_end(bool& is_end)
}
if
(
OB_FAIL
(
ret
)
||
is_end
)
{
}
else
if
(
OB_FAIL
(
iter
.
init
(
table_id
,
schema_guard
,
ddl_service_
->
get_pt_operator
())))
{
}
else
if
(
OB_FAIL
(
iter
.
init
(
table_id
,
schema_guard
,
ddl_service_
->
get_pt_operator
()
,
filter_flag_replica
)))
{
LOG_WARN
(
"fail to init partition table iterator"
,
K
(
ret
),
"table_id"
,
...
...
src/share/partition_table/ob_inmemory_partition_table.cpp
浏览文件 @
1613b26c
...
...
@@ -53,7 +53,7 @@ void ObInMemoryPartitionTable::reuse()
}
int
ObInMemoryPartitionTable
::
get
(
const
uint64_t
table_id
,
const
int64_t
partition_id
,
ObPartitionInfo
&
partition_info
,
const
bool
need_fetch_faillist
,
const
int64_t
cluster_id
)
const
bool
need_fetch_faillist
,
const
int64_t
cluster_id
,
const
bool
filter_flag_replica
)
{
int
ret
=
OB_SUCCESS
;
lib
::
ObMutexGuard
guard
(
mutex_
);
...
...
@@ -68,7 +68,6 @@ int ObInMemoryPartitionTable::get(const uint64_t table_id, const int64_t partiti
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid argument"
,
K
(
ret
),
KT
(
table_id
),
K
(
partition_id
));
}
else
{
const
bool
filter_flag_replica
=
true
;
if
(
OB_FAIL
(
inner_get
(
table_id
,
partition_id
,
filter_flag_replica
,
partition_info
)))
{
LOG_WARN
(
"inner_get failed"
,
KT
(
table_id
),
K
(
partition_id
),
K
(
filter_flag_replica
),
K
(
ret
));
}
...
...
@@ -84,7 +83,8 @@ int ObInMemoryPartitionTable::get(const uint64_t table_id, const int64_t partiti
}
int
ObInMemoryPartitionTable
::
prefetch_by_table_id
(
const
uint64_t
tenant_id
,
const
uint64_t
start_table_id
,
const
int64_t
start_partition_id
,
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
)
const
int64_t
start_partition_id
,
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
,
const
bool
filter_flag_replica
)
{
int
ret
=
OB_SUCCESS
;
lib
::
ObMutexGuard
guard
(
mutex_
);
...
...
@@ -96,7 +96,6 @@ int ObInMemoryPartitionTable::prefetch_by_table_id(const uint64_t tenant_id, con
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"invalid tenant_id"
,
K
(
tenant_id
),
K
(
ret
),
K
(
start_table_id
),
K
(
start_partition_id
));
}
else
{
const
bool
filter_flag_replica
=
true
;
const
uint64_t
table_id
=
combine_id
(
OB_SYS_TENANT_ID
,
OB_ALL_CORE_TABLE_TID
);
const
int64_t
partition_id
=
ALL_CORE_TABLE_PARTITION_ID
;
ObPartitionInfo
partition_info
;
...
...
src/share/partition_table/ob_inmemory_partition_table.h
浏览文件 @
1613b26c
...
...
@@ -46,11 +46,12 @@ public:
return
inited_
;
}
virtual
int
get
(
const
uint64_t
table_id
,
const
int64_t
partition_id
,
ObPartitionInfo
&
partition_info
,
const
bool
need_fetch_faillist
=
false
,
const
int64_t
cluster_id
=
common
::
OB_INVALID_ID
)
override
;
const
bool
need_fetch_faillist
=
false
,
const
int64_t
cluster_id
=
common
::
OB_INVALID_ID
,
const
bool
filter_flag_replica
=
true
)
override
;
virtual
int
prefetch_by_table_id
(
const
uint64_t
tenant_id
,
const
uint64_t
start_table_id
,
const
int64_t
start_partition_id
,
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
=
false
)
override
;
const
bool
need_fetch_faillist
=
false
,
const
bool
filter_flag_replica
=
true
)
override
;
virtual
int
prefetch
(
const
uint64_t
tenant_id
,
const
uint64_t
start_table_id
,
const
int64_t
start_partition_id
,
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
bool
ignore_row_checksum
,
...
...
src/share/partition_table/ob_ipartition_table.h
浏览文件 @
1613b26c
...
...
@@ -79,7 +79,8 @@ public:
}
virtual
int
get
(
const
uint64_t
table_id
,
const
int64_t
partition_id
,
ObPartitionInfo
&
partition_info
,
const
bool
need_fetch_faillist
=
false
,
const
int64_t
cluster_id
=
common
::
OB_INVALID_ID
)
=
0
;
const
bool
need_fetch_faillist
=
false
,
const
int64_t
cluster_id
=
common
::
OB_INVALID_ID
,
const
bool
filter_flag_replica
=
true
)
=
0
;
virtual
int
batch_fetch_partition_infos
(
const
common
::
ObIArray
<
common
::
ObPartitionKey
>&
keys
,
common
::
ObIAllocator
&
allocator
,
common
::
ObArray
<
ObPartitionInfo
*>&
partitions
,
...
...
@@ -90,7 +91,8 @@ public:
virtual
int
batch_report_partition_role
(
const
common
::
ObIArray
<
share
::
ObPartitionReplica
>&
pkey_array
,
const
common
::
ObRole
new_role
)
=
0
;
virtual
int
prefetch_by_table_id
(
const
uint64_t
tenant_id
,
const
uint64_t
table_id
,
const
int64_t
partition_id
,
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
=
false
)
=
0
;
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
=
false
,
const
bool
filter_flag_replica
=
true
)
=
0
;
virtual
int
prefetch
(
const
uint64_t
tenant_id
,
const
uint64_t
table_id
,
const
int64_t
partition_id
,
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
bool
ignore_row_checksum
,
...
...
src/share/partition_table/ob_partition_table_iterator.cpp
浏览文件 @
1613b26c
...
...
@@ -167,9 +167,18 @@ int ObTablePartitionIterator::ObPrefetchInfo::prefetch()
uint64_t
tenant_id
=
extract_tenant_id
(
table_id_
);
prefetch_idx_
=
0
;
prefetch_partitions_
.
reuse
();
if
(
OB_FAIL
(
pt_operator_
->
prefetch_by_table_id
(
tenant_id
,
table_id_
,
start_partition_id
,
prefetch_partitions_
,
need_fetch_faillist_
)))
{
LOG_WARN
(
"fail to prefetch partitions"
,
K
(
ret
),
K
(
table_id_
),
K
(
start_partition_id
));
if
(
OB_FAIL
(
pt_operator_
->
prefetch_by_table_id
(
tenant_id
,
table_id_
,
start_partition_id
,
prefetch_partitions_
,
need_fetch_faillist_
,
filter_flag_replica_
)))
{
LOG_WARN
(
"fail to prefetch partitions"
,
K
(
ret
),
K
(
table_id_
),
K
(
start_partition_id
),
K_
(
need_fetch_faillist
),
K_
(
filter_flag_replica
));
}
else
if
(
!
first_prefetch
)
{
prefetch_idx_
++
;
// the first partition is duplicated, need to be filtered
}
...
...
@@ -202,7 +211,8 @@ ObTablePartitionIterator::~ObTablePartitionIterator()
// check if we need to access the tenant level meta table by the mode
// when TablePartitionIterator::init is invoked
int
ObTablePartitionIterator
::
init
(
const
uint64_t
table_id
,
ObSchemaGetterGuard
&
schema_guard
,
ObPartitionTableOperator
&
pt_operator
)
const
uint64_t
table_id
,
ObSchemaGetterGuard
&
schema_guard
,
ObPartitionTableOperator
&
pt_operator
,
const
bool
filter_flag_replica
/* = true*/
)
{
int
ret
=
OB_SUCCESS
;
const
uint64_t
tenant_id
=
extract_tenant_id
(
table_id
);
...
...
@@ -232,6 +242,7 @@ int ObTablePartitionIterator::init(
part_level_
=
partition_schema
->
get_part_level
();
prefetch_info_
.
reset
();
prefetch_info_
.
set_need_fetch_faillist
(
need_fetch_faillist_
);
prefetch_info_
.
set_filter_flag_replica
(
filter_flag_replica
);
allocator_
.
reuse
();
inited_
=
true
;
}
...
...
src/share/partition_table/ob_partition_table_iterator.h
浏览文件 @
1613b26c
...
...
@@ -91,7 +91,8 @@ public:
pt_operator_
(
NULL
),
prefetch_iter_end_
(
false
),
prefetch_partitions_
(),
need_fetch_faillist_
(
false
)
need_fetch_faillist_
(
false
),
filter_flag_replica_
(
true
)
{}
~
ObPrefetchInfo
()
{}
...
...
@@ -101,6 +102,7 @@ public:
prefetch_iter_end_
=
false
;
prefetch_partitions_
.
reuse
();
need_fetch_faillist_
=
false
;
filter_flag_replica_
=
true
;
}
int
init
(
uint64_t
table_id
,
ObPartitionTableOperator
&
pt_operator
);
bool
need_prefetch
()
const
...
...
@@ -118,6 +120,10 @@ public:
{
need_fetch_faillist_
=
need_fetch_faillist
;
}
void
set_filter_flag_replica
(
const
bool
filter_flag_replica
)
{
filter_flag_replica_
=
filter_flag_replica
;
}
private:
int64_t
prefetch_idx_
;
...
...
@@ -127,13 +133,15 @@ public:
common
::
ObArray
<
ObPartitionInfo
>
prefetch_partitions_
;
// false by defaulta,only set to true for load balance
bool
need_fetch_faillist_
;
bool
filter_flag_replica_
;
};
ObTablePartitionIterator
();
virtual
~
ObTablePartitionIterator
();
// can be inited twice
int
init
(
const
uint64_t
table_id
,
share
::
schema
::
ObSchemaGetterGuard
&
schema_guard
,
ObPartitionTableOperator
&
pt_operator
);
const
uint64_t
table_id
,
share
::
schema
::
ObSchemaGetterGuard
&
schema_guard
,
ObPartitionTableOperator
&
pt_operator
,
const
bool
filter_flag_replica
=
true
);
bool
is_inited
()
{
return
inited_
;
...
...
src/share/partition_table/ob_partition_table_operator.cpp
浏览文件 @
1613b26c
...
...
@@ -117,7 +117,7 @@ int ObPartitionTableOperator::set_use_rpc_table(ObCommonRpcProxy& rpc_proxy, ObR
}
int
ObPartitionTableOperator
::
get
(
const
uint64_t
table_id
,
const
int64_t
partition_id
,
ObPartitionInfo
&
partition_info
,
const
bool
need_fetch_faillist
,
const
int64_t
cluster_id
)
const
bool
need_fetch_faillist
,
const
int64_t
cluster_id
,
const
bool
filter_flag_replica
)
{
int
ret
=
OB_SUCCESS
;
int64_t
start_time
=
ObTimeUtility
::
current_time
();
...
...
@@ -140,7 +140,8 @@ int ObPartitionTableOperator::get(const uint64_t table_id, const int64_t partiti
ObTimeoutCtx
ctx
;
if
(
OB_FAIL
(
rootserver
::
ObRootUtils
::
get_rs_default_timeout_ctx
(
ctx
)))
{
LOG_WARN
(
"fail to get timeout ctx"
,
K
(
ret
),
K
(
ctx
));
}
else
if
(
OB_FAIL
(
pt
->
get
(
table_id
,
partition_id
,
partition_info
,
need_fetch_faillist
,
cluster_id
)))
{
}
else
if
(
OB_FAIL
(
pt
->
get
(
table_id
,
partition_id
,
partition_info
,
need_fetch_faillist
,
cluster_id
,
filter_flag_replica
)))
{
LOG_WARN
(
"get partition info failed"
,
K
(
ret
),
KT
(
table_id
),
K
(
partition_id
));
}
}
...
...
@@ -153,7 +154,8 @@ int ObPartitionTableOperator::get(const uint64_t table_id, const int64_t partiti
}
int
ObPartitionTableOperator
::
prefetch_by_table_id
(
const
uint64_t
tenant_id
,
const
uint64_t
start_table_id
,
const
int64_t
start_partition_id
,
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
)
const
int64_t
start_partition_id
,
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
,
const
bool
filter_flag_replica
)
{
int
ret
=
OB_SUCCESS
;
ObIPartitionTable
*
pt
=
NULL
;
...
...
@@ -171,9 +173,19 @@ int ObPartitionTableOperator::prefetch_by_table_id(const uint64_t tenant_id, con
}
else
if
(
OB_ISNULL
(
pt
))
{
ret
=
OB_ERR_UNEXPECTED
;
LOG_WARN
(
"NULL partition table"
,
K
(
ret
));
}
else
if
(
OB_FAIL
(
pt
->
prefetch_by_table_id
(
tenant_id
,
start_table_id
,
start_partition_id
,
partition_infos
,
need_fetch_faillist
)))
{
LOG_WARN
(
"partition_table prefetch failed"
,
K
(
tenant_id
),
K
(
start_table_id
),
K
(
start_partition_id
),
K
(
ret
));
}
else
if
(
OB_FAIL
(
pt
->
prefetch_by_table_id
(
tenant_id
,
start_table_id
,
start_partition_id
,
partition_infos
,
need_fetch_faillist
,
filter_flag_replica
)))
{
LOG_WARN
(
"partition_table prefetch failed"
,
K
(
tenant_id
),
K
(
start_table_id
),
K
(
start_partition_id
),
K
(
need_fetch_faillist
),
K
(
filter_flag_replica
),
K
(
ret
));
}
LOG_DEBUG
(
"prefetch by table_id"
,
K
(
ret
),
K
(
tenant_id
),
K
(
start_table_id
),
K
(
start_partition_id
),
K
(
need_fetch_faillist
));
...
...
src/share/partition_table/ob_partition_table_operator.h
浏览文件 @
1613b26c
...
...
@@ -45,11 +45,12 @@ public:
int
set_callback_for_obs
(
obrpc
::
ObCommonRpcProxy
&
rpc_proxy
,
ObRsMgr
&
rs_mgr
,
common
::
ObServerConfig
&
config
);
virtual
int
get
(
const
uint64_t
table_id
,
const
int64_t
partition_id
,
ObPartitionInfo
&
partition_info
,
const
bool
need_fetch_faillist
=
false
,
const
int64_t
cluster_id
=
common
::
OB_INVALID_ID
)
override
;
const
bool
need_fetch_faillist
=
false
,
const
int64_t
cluster_id
=
common
::
OB_INVALID_ID
,
const
bool
filter_flag_replica
=
true
)
override
;
virtual
int
prefetch_by_table_id
(
const
uint64_t
tenant_id
,
const
uint64_t
start_table_id
,
const
int64_t
set_partition_id
,
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
=
false
)
override
;
const
bool
need_fetch_faillist
=
false
,
const
bool
filter_flag_replica
=
true
)
override
;
virtual
int
prefetch
(
const
uint64_t
tenant_id
,
const
uint64_t
start_table_id
,
const
int64_t
set_partition_id
,
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
bool
ignore_row_checksum
,
...
...
src/share/partition_table/ob_persistent_partition_table.cpp
浏览文件 @
1613b26c
...
...
@@ -53,7 +53,8 @@ int ObPersistentPartitionTable::init(ObISQLClient& sql_proxy, ObServerConfig* co
}
int
ObPersistentPartitionTable
::
get
(
const
uint64_t
table_id
,
const
int64_t
partition_id
,
ObPartitionInfo
&
partition_info
,
const
bool
need_fetch_faillist
,
const
int64_t
cluster_id
)
ObPartitionInfo
&
partition_info
,
const
bool
need_fetch_faillist
,
const
int64_t
cluster_id
,
const
bool
filter_flag_replica
)
{
int
ret
=
OB_SUCCESS
;
if
(
!
is_inited
())
{
...
...
@@ -65,19 +66,16 @@ int ObPersistentPartitionTable::get(const uint64_t table_id, const int64_t parti
}
else
if
(
NULL
==
partition_info
.
get_allocator
())
{
ret
=
OB_INVALID_ARGUMENT
;
LOG_WARN
(
"partition info's allocator must set"
,
K
(
ret
),
K
(
partition_info
.
get_allocator
()));
}
else
{
const
bool
filter_flag_replica
=
true
;
if
(
OB_FAIL
(
get_partition_info
(
table_id
,
partition_id
,
filter_flag_replica
,
partition_info
,
need_fetch_faillist
,
cluster_id
)))
{
LOG_WARN
(
"get_partition_info failed"
,
K
(
cluster_id
),
KT
(
table_id
),
K
(
partition_id
),
K
(
filter_flag_replica
),
K
(
ret
));
}
}
else
if
(
OB_FAIL
(
get_partition_info
(
table_id
,
partition_id
,
filter_flag_replica
,
partition_info
,
need_fetch_faillist
,
cluster_id
)))
{
LOG_WARN
(
"get_partition_info failed"
,
K
(
cluster_id
),
KT
(
table_id
),
K
(
partition_id
),
K
(
filter_flag_replica
),
K
(
ret
));
}
return
ret
;
}
int
ObPersistentPartitionTable
::
prefetch_by_table_id
(
const
uint64_t
tenant_id
,
const
uint64_t
start_table_id
,
const
int64_t
start_partition_id
,
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
)
const
int64_t
start_partition_id
,
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
,
const
bool
filter_flag_replica
)
{
int
ret
=
OB_SUCCESS
;
if
(
!
is_inited
())
{
...
...
@@ -92,7 +90,6 @@ int ObPersistentPartitionTable::prefetch_by_table_id(const uint64_t tenant_id, c
}
else
{
ObPartitionTableProxyFactory
factory
(
*
sql_proxy_
,
merge_error_cb_
,
config_
);
ObPartitionTableProxy
*
proxy
=
NULL
;
const
bool
filter_flag_replica
=
true
;
int64_t
fetch_count
=
GCONF
.
partition_table_scan_batch_count
;
if
(
OB_FAIL
(
factory
.
get_proxy
(
start_table_id
,
proxy
)))
{
LOG_WARN
(
"get partition table proxy failed"
,
K
(
ret
),
K
(
start_table_id
));
...
...
src/share/partition_table/ob_persistent_partition_table.h
浏览文件 @
1613b26c
...
...
@@ -39,14 +39,15 @@ public:
}
virtual
int
get
(
const
uint64_t
table_id
,
const
int64_t
partition_id
,
ObPartitionInfo
&
partition_info
,
const
bool
need_fetch_faillist
=
false
,
const
int64_t
cluster_id
=
common
::
OB_INVALID_ID
)
override
;
const
bool
need_fetch_faillist
=
false
,
const
int64_t
cluster_id
=
common
::
OB_INVALID_ID
,
const
bool
filter_flag_replica
=
true
)
override
;
virtual
int
batch_fetch_partition_infos
(
const
common
::
ObIArray
<
common
::
ObPartitionKey
>&
keys
,
common
::
ObIAllocator
&
allocator
,
common
::
ObArray
<
ObPartitionInfo
*>&
partitions
,
const
int64_t
cluster_id
=
common
::
OB_INVALID_ID
)
override
;
virtual
int
prefetch_by_table_id
(
const
uint64_t
tenant_id
,
const
uint64_t
start_table_id
,
const
int64_t
start_partition_id
,
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
=
false
)
override
;
const
bool
need_fetch_faillist
=
false
,
const
bool
filter_flag_replica
=
true
)
override
;
virtual
int
prefetch
(
const
uint64_t
tenant_id
,
const
uint64_t
start_table_id
,
const
int64_t
start_partition_id
,
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
bool
ignore_row_checksum
,
...
...
src/share/partition_table/ob_remote_partition_table_operator.cpp
浏览文件 @
1613b26c
...
...
@@ -41,9 +41,10 @@ int ObRemotePartitionTableOperator::init(
}
int
ObRemotePartitionTableOperator
::
get
(
const
uint64_t
table_id
,
const
int64_t
partition_id
,
ObPartitionInfo
&
partition_info
,
const
bool
need_fetch_faillist
,
const
int64_t
cluster_id
)
ObPartitionInfo
&
partition_info
,
const
bool
need_fetch_faillist
,
const
int64_t
cluster_id
,
const
bool
filter_flag_replica
)
{
UNUSEDx
(
table_id
,
partition_id
,
partition_info
,
need_fetch_faillist
,
cluster_id
);
UNUSEDx
(
table_id
,
partition_id
,
partition_info
,
need_fetch_faillist
,
cluster_id
,
filter_flag_replica
);
return
OB_NOT_SUPPORTED
;
}
...
...
@@ -61,11 +62,12 @@ int ObRemotePartitionTableOperator::batch_execute(const common::ObIArray<ObParti
}
int
ObRemotePartitionTableOperator
::
prefetch_by_table_id
(
const
uint64_t
tenant_id
,
const
uint64_t
table_id
,
const
int64_t
partition_id
,
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
)
const
int64_t
partition_id
,
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
,
const
bool
filter_flag_replica
)
{
UNUSEDx
(
tenant_id
,
table_id
,
partition_id
);
UNUSEDx
(
partition_infos
,
need_fetch_faillist
);
UNUSEDx
(
partition_infos
,
need_fetch_faillist
,
filter_flag_replica
);
return
OB_NOT_SUPPORTED
;
}
...
...
src/share/partition_table/ob_remote_partition_table_operator.h
浏览文件 @
1613b26c
...
...
@@ -37,7 +37,8 @@ public:
{}
int
init
(
share
::
schema
::
ObMultiVersionSchemaService
*
schema_service
,
ObRemoteSqlProxy
*
remote_sql_proxy
);
virtual
int
get
(
const
uint64_t
table_id
,
const
int64_t
partition_id
,
ObPartitionInfo
&
partition_info
,
const
bool
need_fetch_faillist
=
false
,
const
int64_t
cluster_id
=
common
::
OB_INVALID_ID
)
override
;
const
bool
need_fetch_faillist
=
false
,
const
int64_t
cluster_id
=
common
::
OB_INVALID_ID
,
const
bool
filter_flag_replica
=
true
)
override
;
virtual
int
batch_fetch_partition_infos
(
const
common
::
ObIArray
<
common
::
ObPartitionKey
>&
keys
,
common
::
ObIAllocator
&
allocator
,
common
::
ObArray
<
ObPartitionInfo
*>&
partitions
,
const
int64_t
cluster_id
=
common
::
OB_INVALID_ID
)
override
;
...
...
@@ -45,7 +46,8 @@ public:
// not supported interface
virtual
int
batch_execute
(
const
common
::
ObIArray
<
ObPartitionReplica
>&
replicas
)
override
;
virtual
int
prefetch_by_table_id
(
const
uint64_t
tenant_id
,
const
uint64_t
table_id
,
const
int64_t
partition_id
,
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
=
false
)
override
;
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
=
false
,
const
bool
filter_flag_replica
=
true
)
override
;
virtual
int
prefetch
(
const
uint64_t
tenant_id
,
const
uint64_t
table_id
,
const
int64_t
partition_id
,
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
bool
ignore_row_checksum
,
...
...
src/share/partition_table/ob_rpc_partition_table.cpp
浏览文件 @
1613b26c
...
...
@@ -50,10 +50,10 @@ int ObRpcPartitionTable::init(ObCommonRpcProxy& rpc_proxy, ObRsMgr& rs_mgr, ObSe
}
int
ObRpcPartitionTable
::
get
(
const
uint64_t
table_id
,
const
int64_t
partition_id
,
ObPartitionInfo
&
partition_info
,
const
bool
need_fetch_faillist
,
const
int64_t
cluster_id
)
const
bool
need_fetch_faillist
,
const
int64_t
cluster_id
,
const
bool
filter_flag_replica
)
{
int
ret
=
OB_SUCCESS
;
UNUSED
(
need_fetch_faillist
);
UNUSED
x
(
need_fetch_faillist
,
filter_flag_replica
);
ObAddr
rs_addr
;
partition_info
.
set_table_id
(
table_id
);
partition_info
.
set_partition_id
(
partition_id
);
...
...
@@ -347,10 +347,11 @@ int ObRpcPartitionTable::fetch_root_partition_from_obs_v1(
}
int
ObRpcPartitionTable
::
prefetch_by_table_id
(
const
uint64_t
tenant_id
,
const
uint64_t
start_table_id
,
const
int64_t
start_partition_id
,
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
)
const
int64_t
start_partition_id
,
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
,
const
bool
filter_flag_replica
)
{
int
ret
=
OB_SUCCESS
;
UNUSED
(
need_fetch_faillist
);
UNUSED
x
(
need_fetch_faillist
,
filter_flag_replica
);
if
(
!
is_inited_
)
{
ret
=
OB_NOT_INIT
;
LOG_WARN
(
"not init"
,
K
(
ret
));
...
...
src/share/partition_table/ob_rpc_partition_table.h
浏览文件 @
1613b26c
...
...
@@ -41,11 +41,12 @@ public:
}
virtual
int
get
(
const
uint64_t
table_id
,
const
int64_t
partition_id
,
ObPartitionInfo
&
partition_info
,
const
bool
need_fetch_faillist
=
false
,
const
int64_t
cluster_id
=
common
::
OB_INVALID_ID
)
override
;
const
bool
need_fetch_faillist
=
false
,
const
int64_t
cluster_id
=
common
::
OB_INVALID_ID
,
const
bool
filter_flag_replica
=
true
)
override
;
virtual
int
prefetch_by_table_id
(
const
uint64_t
tenant_id
,
const
uint64_t
start_table_id
,
const
int64_t
start_partition_id
,
common
::
ObIArray
<
ObPartitionInfo
>&
partition_infos
,
const
bool
need_fetch_faillist
=
false
)
override
;
const
bool
need_fetch_faillist
=
false
,
const
bool
filter_flag_replica
=
true
)
override
;
virtual
int
prefetch
(
const
uint64_t
tenant_id
,
const
uint64_t
start_table_id
,
const
int64_t
start_partition_id
,
common
::
ObIArray
<
ObPartitionInfo
>&
partition_info
,
bool
ignore_row_checksum
,
...
...
src/storage/ob_partition_service.cpp
浏览文件 @
1613b26c
...
...
@@ -11602,6 +11602,9 @@ int ObPartitionService::check_all_replica_major_sstable_exist(
common::ObMemberList member_list;
const uint64_t fetch_tenant_id =
is_inner_table(index_table_id) ? OB_SYS_TENANT_ID : extract_tenant_id(index_table_id);
const bool need_fail_list = false;
const int64_t cluster_id = OB_INVALID_ID; // local cluster
const bool filter_flag_replica = false;
if (OB_FAIL(schema_service_->get_tenant_full_schema_guard(fetch_tenant_id, schema_guard))) {
STORAGE_LOG(WARN, "fail to get schema guard", K(ret), K(fetch_tenant_id));
} else if (OB_FAIL(schema_guard.get_table_schema(index_table_id, index_schema))) {
...
...
@@ -11623,7 +11626,12 @@ int ObPartitionService::check_all_replica_major_sstable_exist(
} else if (OB_ISNULL(GCTX.pt_operator_)) {
ret = OB_ERR_UNEXPECTED;
STORAGE_LOG(WARN, "error unexpected, pt operator must not be NULL", K(ret));
} else if (OB_FAIL(GCTX.pt_operator_->get(pkey.get_table_id(), pkey.get_partition_id(), partition_info))) {
} else if (OB_FAIL(GCTX.pt_operator_->get(pkey.get_table_id(),
pkey.get_partition_id(),
partition_info,
need_fail_list,
cluster_id,
filter_flag_replica))) {
STORAGE_LOG(WARN, "fail to get partition info", K(ret), K(pkey));
} else if (OB_FAIL(partition_info.filter(filter))) {
STORAGE_LOG(WARN, "fail to filter partition", K(ret));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录