Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
bd874dd0
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bd874dd0
编写于
9月 23, 2022
作者:
Z
zhihaop
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: resizeDataBlocksData returns false incorrectly
上级
1525769e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
16 addition
and
17 deletion
+16
-17
src/client/src/tscBulkWrite.c
src/client/src/tscBulkWrite.c
+3
-1
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+11
-14
src/common/src/tglobal.c
src/common/src/tglobal.c
+2
-2
未找到文件。
src/client/src/tscBulkWrite.c
浏览文件 @
bd874dd0
...
...
@@ -56,7 +56,9 @@ inline static void tscReturnsError(SSqlObj* pSql, int code) {
}
pSql
->
res
.
code
=
code
;
tscAsyncResultOnError
(
pSql
);
if
(
pSql
->
fp
)
{
pSql
->
fp
(
pSql
->
param
,
pSql
,
code
);
}
}
/**
...
...
src/client/src/tscUtil.c
浏览文件 @
bd874dd0
...
...
@@ -2219,20 +2219,20 @@ static void extractTableNameList(SSqlObj *pSql, SInsertStatementParam *pInsertPa
* @param destSize the destination size.
* @return whether is success.
*/
inline
static
bool
resizeDataBlocksData
(
STableDataBlocks
*
dataBlocks
,
size_t
destSize
)
{
static
bool
resizeDataBlocksData
(
STableDataBlocks
*
dataBlocks
,
size_t
destSize
)
{
if
(
dataBlocks
->
nAllocSize
>=
destSize
)
{
return
true
;
}
size_t
nAllocSize
=
destSize
+
(
destSize
>>
1
);
char
*
pData
=
realloc
(
dataBlocks
->
pData
,
dataBlocks
->
nAllocSize
);
char
*
pData
=
realloc
(
dataBlocks
->
pData
,
nAllocSize
);
if
(
!
pData
)
{
return
false
;
}
dataBlocks
->
pData
=
pData
;
dataBlocks
->
nAllocSize
=
nAllocSize
;
return
fals
e
;
return
tru
e
;
}
/**
...
...
@@ -2448,6 +2448,7 @@ static void destroySSubmitMsgBuilder(SSubmitMsgBlocksBuilder* builder) {
iter
=
taosHashIterate
(
builder
->
blockBuilders
,
iter
);
}
taosHashCleanup
(
builder
->
blockBuilders
);
free
(
builder
);
}
/**
...
...
@@ -2575,10 +2576,9 @@ int32_t tscMergeKVPayLoadSqlObj(SArray* statements, SSqlObj **result) {
// header: SMsgDesc + SSubmitMsg(without SSubmitBlk[])
assert
(
dataBuf
->
headerSize
==
(
sizeof
(
SMsgDesc
)
+
sizeof
(
SSubmitMsg
)));
assert
(
dataBuf
->
headerSize
==
tableBlock
->
headerSize
);
const
size_t
headerSize
=
tableBlock
->
headerSize
;
const
size_t
destSize
=
dataBuf
->
size
+
(
tableBlock
->
size
-
tableBlock
->
headerSize
);
if
(
!
resizeDataBlocksData
(
dataBuf
,
de
bugFlag
))
{
if
(
!
resizeDataBlocksData
(
dataBuf
,
de
stSize
))
{
tscError
(
"0x%"
PRIx64
" failed to allocate memory for merging submit block, size:%d"
,
pInsertParam
->
objectId
,
dataBuf
->
nAllocSize
);
...
...
@@ -2586,15 +2586,8 @@ int32_t tscMergeKVPayLoadSqlObj(SArray* statements, SSqlObj **result) {
tfree
(
dataBuf
->
pData
);
return
TSDB_CODE_TSC_OUT_OF_MEMORY
;
}
// pData = SMsgDesc + SSubmitMsg(with SSubmitBlk[])
SSubmitBlk
*
target
=
(
SSubmitBlk
*
)
(
dataBuf
->
pData
+
headerSize
);
SSubmitBlk
*
source
=
(
SSubmitBlk
*
)
(
tableBlock
->
pData
+
headerSize
);
const
size_t
targetSize
=
dataBuf
->
size
-
headerSize
;
const
size_t
sourceSize
=
tableBlock
->
size
-
headerSize
;
memcpy
(
POINTER_SHIFT
(
target
,
targetSize
),
source
,
source
Size
);
memcpy
(
dataBuf
->
pData
+
dataBuf
->
size
,
tableBlock
->
pData
+
tableBlock
->
headerSize
,
tableBlock
->
size
-
tableBlock
->
header
Size
);
dataBuf
->
size
=
destSize
;
dataBuf
->
numOfTables
+=
tableBlock
->
numOfTables
;
tscDestroyDataBlock
(
pSql
,
tableBlock
,
false
);
...
...
@@ -2602,10 +2595,14 @@ int32_t tscMergeKVPayLoadSqlObj(SArray* statements, SSqlObj **result) {
// free the data blocks and sql objs. (because it is no longer needed).
taosArrayDestroy
(
&
pInsertParam
->
pDataBlocks
);
taosReleaseRef
(
tscObjRef
,
pSql
->
self
);
}
// clean up.
for
(
int
i
=
1
;
i
<
taosArrayGetSize
(
statements
);
++
i
)
{
SSqlObj
*
pSql
=
*
((
SSqlObj
**
)
taosArrayGet
(
statements
,
i
));
taosReleaseRef
(
tscObjRef
,
pSql
->
self
);
}
taosHashCleanup
(
pVnodeDataBlockHashList
);
*
result
=
merged
;
...
...
src/common/src/tglobal.c
浏览文件 @
bd874dd0
...
...
@@ -134,8 +134,8 @@ int64_t tsMaxRetentWindow = 24 * 3600L; // maximum time window tolerance
// received the statements depends on the network quality.
bool
tsAsyncBatchEnable
=
true
;
bool
tsAsyncBatchThreadLocal
=
false
;
// if thread local enable, each thread will allocate a dispatcher.
int32_t
tsAsyncBatchSize
=
25
6
;
int32_t
tsAsyncBatchTimeout
=
5
;
int32_t
tsAsyncBatchSize
=
9
6
;
int32_t
tsAsyncBatchTimeout
=
10
;
// the maximum allowed query buffer size during query processing for each data node.
// -1 no limit (default)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录