Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
77295df8
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
77295df8
编写于
2月 26, 2023
作者:
D
dapan1121
提交者:
GitHub
2月 26, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #20161 from taosdata/fix/TS-2729
fix: table scan crash issue
上级
f9a8579b
bf5ed135
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
90 addition
and
4 deletion
+90
-4
Jenkinsfile2
Jenkinsfile2
+1
-1
source/dnode/vnode/src/tsdb/tsdbRead.c
source/dnode/vnode/src/tsdb/tsdbRead.c
+49
-2
tests/parallel_test/cases.task
tests/parallel_test/cases.task
+1
-1
tests/script/tsim/query/partitionby.sim
tests/script/tsim/query/partitionby.sim
+39
-0
未找到文件。
Jenkinsfile2
浏览文件 @
77295df8
...
...
@@ -423,7 +423,7 @@ pipeline {
echo "${WKDIR}/restore.sh -p ${BRANCH_NAME} -n ${BUILD_ID} -c {container name}"
}
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
timeout(time: 1
2
0, unit: 'MINUTES'){
timeout(time: 1
3
0, unit: 'MINUTES'){
pre_test()
script {
sh '''
...
...
source/dnode/vnode/src/tsdb/tsdbRead.c
浏览文件 @
77295df8
...
...
@@ -155,6 +155,7 @@ typedef struct SBlockInfoBuf {
int32_t
currentIndex
;
SArray
*
pData
;
int32_t
numPerBucket
;
int32_t
numOfTables
;
}
SBlockInfoBuf
;
struct
STsdbReader
{
...
...
@@ -302,6 +303,47 @@ static int32_t initBlockScanInfoBuf(SBlockInfoBuf* pBuf, int32_t numOfTables) {
taosArrayPush
(
pBuf
->
pData
,
&
p
);
}
pBuf
->
numOfTables
=
numOfTables
;
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
ensureBlockScanInfoBuf
(
SBlockInfoBuf
*
pBuf
,
int32_t
numOfTables
)
{
if
(
numOfTables
<=
pBuf
->
numOfTables
)
{
return
TSDB_CODE_SUCCESS
;
}
if
(
pBuf
->
numOfTables
>
0
)
{
STableBlockScanInfo
**
p
=
(
STableBlockScanInfo
**
)
taosArrayPop
(
pBuf
->
pData
);
taosMemoryFree
(
*
p
);
pBuf
->
numOfTables
/=
pBuf
->
numPerBucket
;
}
int32_t
num
=
(
numOfTables
-
pBuf
->
numOfTables
)
/
pBuf
->
numPerBucket
;
int32_t
remainder
=
(
numOfTables
-
pBuf
->
numOfTables
)
%
pBuf
->
numPerBucket
;
if
(
pBuf
->
pData
==
NULL
)
{
pBuf
->
pData
=
taosArrayInit
(
num
+
1
,
POINTER_BYTES
);
}
for
(
int32_t
i
=
0
;
i
<
num
;
++
i
)
{
char
*
p
=
taosMemoryCalloc
(
pBuf
->
numPerBucket
,
sizeof
(
STableBlockScanInfo
));
if
(
p
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
taosArrayPush
(
pBuf
->
pData
,
&
p
);
}
if
(
remainder
>
0
)
{
char
*
p
=
taosMemoryCalloc
(
remainder
,
sizeof
(
STableBlockScanInfo
));
if
(
p
==
NULL
)
{
return
TSDB_CODE_OUT_OF_MEMORY
;
}
taosArrayPush
(
pBuf
->
pData
,
&
p
);
}
pBuf
->
numOfTables
=
numOfTables
;
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -3876,8 +3918,13 @@ int32_t tsdbSetTableList(STsdbReader* pReader, const void* pTableList, int32_t n
clearBlockScanInfo
(
*
p
);
}
// todo handle the case where size is less than the value of num
ASSERT
(
size
>=
num
);
if
(
size
<
num
)
{
int32_t
code
=
ensureBlockScanInfoBuf
(
&
pReader
->
blockInfoBuf
,
num
);
if
(
code
)
{
return
code
;
}
pReader
->
status
.
uidList
.
tableUidList
=
(
uint64_t
*
)
taosMemoryRealloc
(
pReader
->
status
.
uidList
.
tableUidList
,
sizeof
(
uint64_t
)
*
num
);
}
taosHashClear
(
pReader
->
status
.
pTableMap
);
STableUidList
*
pUidList
=
&
pReader
->
status
.
uidList
;
...
...
tests/parallel_test/cases.task
浏览文件 @
77295df8
...
...
@@ -181,7 +181,7 @@
,,y,script,./test.sh -f tsim/query/groupby.sim
,,y,script,./test.sh -f tsim/query/event.sim
,,y,script,./test.sh -f tsim/query/forceFill.sim
,,
n,script,./test.sh -f tsim/query/join
.sim
,,
y,script,./test.sh -f tsim/query/partitionby
.sim
,,y,script,./test.sh -f tsim/qnode/basic1.sim
,,y,script,./test.sh -f tsim/snode/basic1.sim
,,y,script,./test.sh -f tsim/mnode/basic1.sim
...
...
tests/script/tsim/query/partitionby.sim
0 → 100644
浏览文件 @
77295df8
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sql connect
$dbPrefix = db
$tbPrefix1 = tba
$tbPrefix2 = tbb
$mtPrefix = stb
$tbNum = 10
$rowNum = 2
print =============== step1
$i = 0
$db = $dbPrefix . $i
$mt1 = $mtPrefix . $i
$i = 1
$mt2 = $mtPrefix . $i
sql drop database $db -x step1
step1:
sql create database $db vgroups 3
sql use $db
sql create table $mt1 (ts timestamp, f1 int) TAGS(tag1 int, tag2 binary(500))
sql create table tb0 using $mt1 tags(0, 'a');
sql create table tb1 using $mt1 tags(1, 'b');
sql create table tb2 using $mt1 tags(1, 'a');
sql create table tb3 using $mt1 tags(1, 'a');
sql create table tb4 using $mt1 tags(3, 'b');
sql create table tb5 using $mt1 tags(3, 'a');
sql create table tb6 using $mt1 tags(3, 'b');
sql create table tb7 using $mt1 tags(3, 'b');
sql select * from $mt1 partition by tag1,tag2 limit 1;
if $rows != 0 then
return -1
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录