Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
野花太放肆
oceanbase
提交
a8778f6a
O
oceanbase
项目概览
野花太放肆
/
oceanbase
与 Fork 源项目一致
Fork自
oceanbase / oceanbase
通知
1
Star
1
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,体验更适合开发者的 AI 搜索 >>
提交
a8778f6a
编写于
3月 24, 2023
作者:
L
leslieyuchen
提交者:
ob-robot
3月 24, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix the bug of lookup iter failing to switch partition correctly
上级
e05be5a0
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
20 addition
and
20 deletion
+20
-20
src/sql/das/ob_das_scan_op.cpp
src/sql/das/ob_das_scan_op.cpp
+9
-7
src/sql/das/ob_das_scan_op.h
src/sql/das/ob_das_scan_op.h
+1
-1
src/sql/das/ob_das_spatial_index_lookup_op.cpp
src/sql/das/ob_das_spatial_index_lookup_op.cpp
+3
-3
src/sql/das/ob_das_spatial_index_lookup_op.h
src/sql/das/ob_das_spatial_index_lookup_op.h
+1
-1
src/sql/das/ob_das_task.h
src/sql/das/ob_das_task.h
+1
-3
src/sql/engine/table/ob_table_scan_op.cpp
src/sql/engine/table/ob_table_scan_op.cpp
+5
-5
未找到文件。
src/sql/das/ob_das_scan_op.cpp
浏览文件 @
a8778f6a
...
...
@@ -593,11 +593,12 @@ int ObDASScanOp::reuse_iter()
int
&
ret
=
errcode_
;
ObITabletScan
&
tsc_service
=
get_tsc_service
();
ObLocalIndexLookupOp
*
lookup_op
=
get_lookup_op
();
scan_param_
.
need_switch_param_
=
need_switch_param
();
if
(
OB_FAIL
(
tsc_service
.
reuse_scan_iter
(
need_switch_param
(),
get_storage_scan_iter
())))
{
const
ObTabletID
&
storage_tablet_id
=
scan_param_
.
tablet_id_
;
scan_param_
.
need_switch_param_
=
(
storage_tablet_id
.
is_valid
()
&&
storage_tablet_id
!=
tablet_id_
?
true
:
false
);
if
(
OB_FAIL
(
tsc_service
.
reuse_scan_iter
(
scan_param_
.
need_switch_param_
,
get_storage_scan_iter
())))
{
LOG_WARN
(
"reuse scan iterator failed"
,
K
(
ret
));
}
else
if
(
lookup_op
!=
nullptr
&&
OB_FAIL
(
lookup_op
->
reset_lookup_state
(
need_switch_param
()
)))
{
&&
OB_FAIL
(
lookup_op
->
reset_lookup_state
()))
{
LOG_WARN
(
"reuse lookup iterator failed"
,
K
(
ret
));
}
else
{
scan_param_
.
key_ranges_
.
reuse
();
...
...
@@ -933,6 +934,8 @@ int ObLocalIndexLookupOp::do_index_lookup()
}
}
}
else
{
const
ObTabletID
&
storage_tablet_id
=
scan_param_
.
tablet_id_
;
scan_param_
.
need_switch_param_
=
(
storage_tablet_id
.
is_valid
()
&&
storage_tablet_id
!=
tablet_id_
?
true
:
false
);
scan_param_
.
tablet_id_
=
tablet_id_
;
scan_param_
.
ls_id_
=
ls_id_
;
if
(
OB_FAIL
(
reuse_iter
()))
{
...
...
@@ -982,7 +985,7 @@ int ObLocalIndexLookupOp::process_next_index_batch_for_row()
{
int
ret
=
OB_SUCCESS
;
if
(
need_next_index_batch
())
{
reset_lookup_state
(
false
);
reset_lookup_state
();
index_end_
=
false
;
state_
=
INDEX_SCAN
;
}
else
{
...
...
@@ -998,7 +1001,7 @@ int ObLocalIndexLookupOp::process_next_index_batch_for_rows(int64_t &count)
if
(
OB_FAIL
(
check_lookup_row_cnt
()))
{
LOG_WARN
(
"check lookup row cnt failed"
,
K
(
ret
));
}
else
if
(
need_next_index_batch
())
{
reset_lookup_state
(
false
);
reset_lookup_state
();
index_end_
=
false
;
state_
=
INDEX_SCAN
;
ret
=
OB_SUCCESS
;
...
...
@@ -1163,7 +1166,7 @@ int ObLocalIndexLookupOp::reuse_iter()
}
return
ret
;
}
int
ObLocalIndexLookupOp
::
reset_lookup_state
(
bool
need_switch_param
)
int
ObLocalIndexLookupOp
::
reset_lookup_state
()
{
int
ret
=
OB_SUCCESS
;
state_
=
INDEX_SCAN
;
...
...
@@ -1172,7 +1175,6 @@ int ObLocalIndexLookupOp::reset_lookup_state(bool need_switch_param)
// Keep lookup_rtdef_->stmt_allocator_.alloc_ consistent with index_rtdef_->stmt_allocator_.alloc_
// to avoid memory expansion
if
(
lookup_iter_
!=
nullptr
)
{
scan_param_
.
need_switch_param_
=
need_switch_param
;
scan_param_
.
key_ranges_
.
reuse
();
scan_param_
.
ss_key_ranges_
.
reuse
();
}
...
...
src/sql/das/ob_das_scan_op.h
浏览文件 @
a8778f6a
...
...
@@ -329,7 +329,7 @@ public:
void
set_rowkey_iter
(
common
::
ObNewRowIterator
*
rowkey_iter
)
{
rowkey_iter_
=
rowkey_iter
;}
common
::
ObNewRowIterator
*
get_rowkey_iter
()
{
return
rowkey_iter_
;
}
int
reuse_iter
();
virtual
int
reset_lookup_state
(
bool
need_switch_param
);
virtual
int
reset_lookup_state
();
int
revert_iter
();
VIRTUAL_TO_STRING_KV
(
KPC_
(
lookup_ctdef
),
KPC_
(
lookup_rtdef
),
...
...
src/sql/das/ob_das_spatial_index_lookup_op.cpp
浏览文件 @
a8778f6a
...
...
@@ -63,10 +63,10 @@ ObSpatialIndexLookupOp::~ObSpatialIndexLookupOp()
sorter_
.
~
ObExternalSort
();
}
int
ObSpatialIndexLookupOp
::
reset_lookup_state
(
bool
need_switch_param
)
int
ObSpatialIndexLookupOp
::
reset_lookup_state
()
{
is_inited_
=
false
;
return
ObLocalIndexLookupOp
::
reset_lookup_state
(
need_switch_param
);
return
ObLocalIndexLookupOp
::
reset_lookup_state
();
}
int
ObSpatialIndexLookupOp
::
filter_by_mbr
(
const
ObObj
&
mbr_obj
,
bool
&
pass_through
)
...
...
@@ -209,7 +209,7 @@ int ObSpatialIndexLookupOp::get_next_row()
ret
=
OB_SUCCESS
;
if
(
need_next_index_batch
())
{
// reuse lookup_iter_ only
ObLocalIndexLookupOp
::
reset_lookup_state
(
false
);
ObLocalIndexLookupOp
::
reset_lookup_state
();
index_end_
=
false
;
state_
=
INDEX_SCAN
;
}
else
{
...
...
src/sql/das/ob_das_spatial_index_lookup_op.h
浏览文件 @
a8778f6a
...
...
@@ -47,7 +47,7 @@ public:
transaction
::
ObTxDesc
*
tx_desc
,
transaction
::
ObTxReadSnapshot
*
snapshot
,
const
ObMbrFilterArray
*
mbr_filters
);
int
reset_lookup_state
(
bool
need_switch_param
);
int
reset_lookup_state
();
int
filter_by_mbr
(
const
ObObj
&
mbr_obj
,
bool
&
pass_through
);
int
get_next_row
();
private:
...
...
src/sql/das/ob_das_task.h
浏览文件 @
a8778f6a
...
...
@@ -183,8 +183,6 @@ public:
void
set_can_part_retry
(
const
bool
flag
)
{
can_part_retry_
=
flag
;
}
bool
can_part_retry
()
const
{
return
can_part_retry_
;
}
bool
is_in_retry
()
const
{
return
in_part_retry_
||
in_stmt_retry_
;
}
void
set_need_switch_param
(
bool
v
)
{
need_switch_param_
=
v
;
}
bool
need_switch_param
()
const
{
return
need_switch_param_
;
}
void
set_task_status
(
ObDasTaskStatus
status
);
ObDasTaskStatus
get_task_status
()
const
{
return
task_status_
;
};
const
ObDasAggregatedTasks
*
get_agg_tasks
()
const
{
return
agg_tasks_
;
};
...
...
@@ -223,7 +221,7 @@ protected:
uint16_t
task_started_
:
1
;
uint16_t
in_part_retry_
:
1
;
uint16_t
in_stmt_retry_
:
1
;
uint16_t
need_switch_param_
:
1
;
//need to switch param in gi table rescan
uint16_t
need_switch_param_
:
1
;
//need to switch param in gi table rescan
, this parameter has been deprecated
uint16_t
status_reserved_
:
12
;
};
};
...
...
src/sql/engine/table/ob_table_scan_op.cpp
浏览文件 @
a8778f6a
...
...
@@ -1517,10 +1517,6 @@ int ObTableScanOp::local_iter_rescan()
for
(;
OB_SUCC
(
ret
)
&&
!
task_iter
.
is_end
();
++
task_iter
)
{
ObDASScanOp
*
scan_op
=
DAS_SCAN_OP
(
*
task_iter
);
if
(
MY_SPEC
.
gi_above_
)
{
ObTableScanParam
&
scan_param
=
scan_op
->
get_scan_param
();
scan_op
->
set_tablet_id
(
MY_INPUT
.
tablet_loc_
->
tablet_id_
);
scan_op
->
set_ls_id
(
MY_INPUT
.
tablet_loc_
->
ls_id_
);
scan_op
->
set_tablet_loc
(
MY_INPUT
.
tablet_loc_
);
if
(
!
MY_SPEC
.
is_index_global_
&&
MY_CTDEF
.
lookup_ctdef_
!=
nullptr
)
{
//is local index lookup, need to set the lookup ctdef to the das scan op
ObDASTableLoc
*
lookup_table_loc
=
tsc_rtdef_
.
lookup_rtdef_
->
table_loc_
;
...
...
@@ -1563,7 +1559,11 @@ int ObTableScanOp::local_iter_reuse()
ObDASScanOp
*
scan_op
=
DAS_SCAN_OP
(
*
task_iter
);
bool
need_switch_param
=
(
scan_op
->
get_tablet_loc
()
!=
MY_INPUT
.
tablet_loc_
&&
MY_INPUT
.
tablet_loc_
!=
nullptr
);
scan_op
->
set_need_switch_param
(
need_switch_param
);
if
(
MY_INPUT
.
tablet_loc_
!=
nullptr
)
{
scan_op
->
set_tablet_id
(
MY_INPUT
.
tablet_loc_
->
tablet_id_
);
scan_op
->
set_ls_id
(
MY_INPUT
.
tablet_loc_
->
ls_id_
);
scan_op
->
set_tablet_loc
(
MY_INPUT
.
tablet_loc_
);
}
scan_op
->
reuse_iter
();
}
if
(
OB_FAIL
(
reuse_table_rescan_allocator
()))
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录