Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
a746d288
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
a746d288
编写于
7月 07, 2023
作者:
K
kailixu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: add debug info
上级
cb8b10f6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
41 addition
and
7 deletion
+41
-7
include/common/tdatablock.h
include/common/tdatablock.h
+1
-1
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+34
-1
source/dnode/vnode/src/sma/smaRollup.c
source/dnode/vnode/src/sma/smaRollup.c
+6
-5
未找到文件。
include/common/tdatablock.h
浏览文件 @
a746d288
...
...
@@ -244,7 +244,7 @@ const char* blockDecode(SSDataBlock* pBlock, const char* pData);
char
*
dumpBlockData
(
SSDataBlock
*
pDataBlock
,
const
char
*
flag
,
char
**
dumpBuf
);
int32_t
buildSubmitReqFromDataBlock
(
SSubmitReq2
**
pReq
,
const
SSDataBlock
*
pDataBlocks
,
const
STSchema
*
pTSchema
,
int64_t
uid
,
int32_t
vgId
,
tb_uid_t
suid
);
tb_uid_t
suid
,
int64_t
blkVer
,
const
char
*
tag
);
char
*
buildCtbNameByGroupId
(
const
char
*
stbName
,
uint64_t
groupId
);
int32_t
buildCtbNameByGroupIdImpl
(
const
char
*
stbName
,
uint64_t
groupId
,
char
*
pBuf
);
...
...
source/common/src/tdatablock.c
浏览文件 @
a746d288
...
...
@@ -1872,13 +1872,32 @@ char* dumpBlockData(SSDataBlock* pDataBlock, const char* flag, char** pDataBuf)
return
dumpBuf
;
}
static
SHashObj
*
dupCheck
=
NULL
;
static
int8_t
dupInit
=
0
;
int32_t
buildSubmitReqFromDataBlock
(
SSubmitReq2
**
ppReq
,
const
SSDataBlock
*
pDataBlock
,
const
STSchema
*
pTSchema
,
int64_t
uid
,
int32_t
vgId
,
tb_uid_t
suid
)
{
int64_t
uid
,
int32_t
vgId
,
tb_uid_t
suid
,
int64_t
blkVer
,
const
char
*
tag
)
{
SSubmitReq2
*
pReq
=
*
ppReq
;
SArray
*
pVals
=
NULL
;
int32_t
numOfBlks
=
0
;
int32_t
sz
=
1
;
if
(
!
dupCheck
)
{
if
(
0
==
atomic_val_compare_exchange_8
(
&
dupInit
,
0
,
1
))
{
dupCheck
=
taosHashInit
(
32
,
taosGetDefaultHashFunction
(
TSDB_DATA_TYPE_BINARY
),
false
,
HASH_ENTRY_LOCK
);
if
(
!
dupCheck
)
ASSERT
(
0
);
}
else
{
int32_t
cnt
=
0
;
while
(
!
dupCheck
)
{
++
cnt
;
if
(
cnt
>
1000
)
{
sched_yield
();
cnt
=
0
;
}
}
}
}
terrno
=
TSDB_CODE_SUCCESS
;
if
(
NULL
==
pReq
)
{
...
...
@@ -1892,6 +1911,8 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq2** ppReq, const SSDataBlock* pDat
}
}
char
dupKey
[
40
];
for
(
int32_t
i
=
0
;
i
<
sz
;
++
i
)
{
int32_t
colNum
=
taosArrayGetSize
(
pDataBlock
->
pDataBlock
);
int32_t
rows
=
pDataBlock
->
info
.
rows
;
...
...
@@ -1936,6 +1957,18 @@ int32_t buildSubmitReqFromDataBlock(SSubmitReq2** ppReq, const SSDataBlock* pDat
ASSERT
(
PRIMARYKEY_TIMESTAMP_COL_ID
==
pCol
->
colId
);
SColVal
cv
=
COL_VAL_VALUE
(
pCol
->
colId
,
pCol
->
type
,
(
SValue
){.
val
=
*
(
TSKEY
*
)
var
});
taosArrayPush
(
pVals
,
&
cv
);
snprintf
(
dupKey
,
40
,
"%"
PRIi64
":%"
PRIi64
,
*
(
TSKEY
*
)
var
,
blkVer
);
uInfo
(
"%s:%d key:ver: %s, tags: %s"
,
__func__
,
__LINE__
,
dupKey
,
tag
);
int32_t
dupKeyLen
=
strlen
(
dupKey
);
assert
(
dupKeyLen
<
40
);
void
*
hashKey
=
NULL
;
if
((
hashKey
=
taosHashGet
(
dupCheck
,
&
dupKey
,
dupKeyLen
+
1
)))
{
ASSERT
(
0
);
}
else
{
if
(
taosHashPut
(
dupCheck
,
&
dupKey
,
dupKeyLen
+
1
,
NULL
,
0
)
!=
0
){
ASSERT
(
0
);
}
}
}
else
if
(
colDataIsNull_s
(
pColInfoData
,
j
))
{
SColVal
cv
=
COL_VAL_NULL
(
pCol
->
colId
,
pCol
->
type
);
taosArrayPush
(
pVals
,
&
cv
);
...
...
source/dnode/vnode/src/sma/smaRollup.c
浏览文件 @
a746d288
...
...
@@ -45,7 +45,7 @@ static void tdReleaseRSmaInfo(SSma *pSma, SRSmaInfo *pInfo);
static
void
tdFreeRSmaSubmitItems
(
SArray
*
pItems
);
static
int32_t
tdRSmaFetchAllResult
(
SSma
*
pSma
,
SRSmaInfo
*
pInfo
);
static
int32_t
tdRSmaExecAndSubmitResult
(
SSma
*
pSma
,
qTaskInfo_t
taskInfo
,
SRSmaInfoItem
*
pItem
,
STSchema
*
pTSchema
,
int64_t
suid
);
int64_t
suid
,
const
char
*
tag
);
static
void
tdRSmaFetchTrigger
(
void
*
param
,
void
*
tmrId
);
static
void
tdRSmaQTaskInfoFree
(
qTaskInfo_t
*
taskHandle
,
int32_t
vgId
,
int32_t
level
);
static
int32_t
tdRSmaRestoreQTaskInfoInit
(
SSma
*
pSma
,
int64_t
*
nTables
);
...
...
@@ -581,7 +581,7 @@ _end:
}
static
int32_t
tdRSmaExecAndSubmitResult
(
SSma
*
pSma
,
qTaskInfo_t
taskInfo
,
SRSmaInfoItem
*
pItem
,
STSchema
*
pTSchema
,
int64_t
suid
)
{
int64_t
suid
,
const
char
*
tag
)
{
int32_t
code
=
0
;
int32_t
lino
=
0
;
SSDataBlock
*
output
=
NULL
;
...
...
@@ -620,7 +620,8 @@ static int32_t tdRSmaExecAndSubmitResult(SSma *pSma, qTaskInfo_t taskInfo, SRSma
SSubmitReq2
*
pReq
=
NULL
;
// TODO: the schema update should be handled later(TD-17965)
if
(
buildSubmitReqFromDataBlock
(
&
pReq
,
output
,
pTSchema
,
output
->
info
.
id
.
groupId
,
SMA_VID
(
pSma
),
suid
)
<
0
)
{
if
(
buildSubmitReqFromDataBlock
(
&
pReq
,
output
,
pTSchema
,
output
->
info
.
id
.
groupId
,
SMA_VID
(
pSma
),
suid
,
output
->
info
.
version
,
tag
)
<
0
)
{
code
=
terrno
?
terrno
:
TSDB_CODE_RSMA_RESULT
;
TSDB_CHECK_CODE
(
code
,
lino
,
_exit
);
}
...
...
@@ -775,7 +776,7 @@ static int32_t tdExecuteRSmaImpl(SSma *pSma, const void *pMsg, int32_t msgSize,
}
SRSmaInfoItem
*
pItem
=
RSMA_INFO_ITEM
(
pInfo
,
idx
);
tdRSmaExecAndSubmitResult
(
pSma
,
qTaskInfo
,
pItem
,
pInfo
->
pTSchema
,
pInfo
->
suid
);
tdRSmaExecAndSubmitResult
(
pSma
,
qTaskInfo
,
pItem
,
pInfo
->
pTSchema
,
pInfo
->
suid
,
__func__
);
return
TSDB_CODE_SUCCESS
;
}
...
...
@@ -1246,7 +1247,7 @@ static int32_t tdRSmaFetchAllResult(SSma *pSma, SRSmaInfo *pInfo) {
if
((
terrno
=
qSetSMAInput
(
taskInfo
,
&
dataBlock
,
1
,
STREAM_INPUT__DATA_BLOCK
))
<
0
)
{
goto
_err
;
}
if
(
tdRSmaExecAndSubmitResult
(
pSma
,
taskInfo
,
pItem
,
pInfo
->
pTSchema
,
pInfo
->
suid
)
<
0
)
{
if
(
tdRSmaExecAndSubmitResult
(
pSma
,
taskInfo
,
pItem
,
pInfo
->
pTSchema
,
pInfo
->
suid
,
__func__
)
<
0
)
{
goto
_err
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录