Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6f8d4d69
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看板
提交
6f8d4d69
编写于
10月 14, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(tmq): push msg
上级
260ca173
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
62 addition
and
14 deletion
+62
-14
source/dnode/vnode/src/tq/tq.c
source/dnode/vnode/src/tq/tq.c
+5
-5
source/dnode/vnode/src/tq/tqPush.c
source/dnode/vnode/src/tq/tqPush.c
+1
-1
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+2
-0
source/libs/executor/src/groupoperator.c
source/libs/executor/src/groupoperator.c
+15
-0
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+22
-1
source/libs/wal/src/walMeta.c
source/libs/wal/src/walMeta.c
+5
-3
source/libs/wal/src/walRead.c
source/libs/wal/src/walRead.c
+0
-2
source/libs/wal/src/walWrite.c
source/libs/wal/src/walWrite.c
+12
-2
未找到文件。
source/dnode/vnode/src/tq/tq.c
浏览文件 @
6f8d4d69
...
...
@@ -171,11 +171,11 @@ int32_t tqPushDataRsp(STQ* pTq, STqPushEntry* pPushEntry) {
ASSERT
(
taosArrayGetSize
(
pRsp
->
blockSchema
)
==
0
);
if
(
pRsp
->
reqOffset
.
type
==
TMQ_OFFSET__LOG
)
{
if
(
pRsp
->
blockNum
>
0
)
{
ASSERT
(
pRsp
->
rspOffset
.
version
>
pRsp
->
reqOffset
.
version
);
}
else
{
ASSERT
(
pRsp
->
rspOffset
.
version
>=
pRsp
->
reqOffset
.
version
);
}
/*if (pRsp->blockNum > 0) {*/
/*ASSERT(pRsp->rspOffset.version > pRsp->reqOffset.version);*/
/*} else {*/
ASSERT
(
pRsp
->
rspOffset
.
version
>
pRsp
->
reqOffset
.
version
);
/*}*/
}
int32_t
len
=
0
;
...
...
source/dnode/vnode/src/tq/tqPush.c
浏览文件 @
6f8d4d69
...
...
@@ -245,7 +245,7 @@ int tqPushMsg(STQ* pTq, void* msg, int32_t msgLen, tmsg_t msgType, int64_t ver)
tqDebug
(
"vgId:%d cannot find handle %s"
,
pTq
->
pVnode
->
config
.
vgId
,
pPushEntry
->
subKey
);
continue
;
}
if
(
pPushEntry
->
dataRsp
.
reqOffset
.
version
>
ver
)
{
if
(
pPushEntry
->
dataRsp
.
reqOffset
.
version
>
=
ver
)
{
tqDebug
(
"vgId:%d push entry req version %ld, while push version %ld, skip"
,
pTq
->
pVnode
->
config
.
vgId
,
pPushEntry
->
dataRsp
.
reqOffset
.
version
,
ver
);
continue
;
...
...
source/libs/executor/inc/executorimpl.h
浏览文件 @
6f8d4d69
...
...
@@ -479,6 +479,7 @@ typedef struct SStreamScanInfo {
SExprInfo
*
pPseudoExpr
;
int32_t
numOfPseudoExpr
;
SExprSupp
tbnameCalSup
;
SExprSupp
tagCalSup
;
int32_t
primaryTsIndex
;
// primary time stamp slot id
SReadHandle
readHandle
;
SInterval
interval
;
// if the upstream is an interval operator, the interval info is also kept here.
...
...
@@ -775,6 +776,7 @@ typedef struct SStreamPartitionOperatorInfo {
SPartitionBySupporter
partitionSup
;
SExprSupp
scalarSup
;
SExprSupp
tbnameCalSup
;
SExprSupp
tagCalSup
;
SHashObj
*
pPartitions
;
void
*
parIte
;
SSDataBlock
*
pInputDataBlock
;
...
...
source/libs/executor/src/groupoperator.c
浏览文件 @
6f8d4d69
...
...
@@ -991,6 +991,8 @@ static void destroyStreamPartitionOperatorInfo(void* param) {
taosMemoryFree
(
pInfo
->
partitionSup
.
keyBuf
);
cleanupExprSupp
(
&
pInfo
->
scalarSup
);
cleanupExprSupp
(
&
pInfo
->
tbnameCalSup
);
cleanupExprSupp
(
&
pInfo
->
tagCalSup
);
blockDataDestroy
(
pInfo
->
pDelRes
);
taosMemoryFreeClear
(
param
);
}
...
...
@@ -1037,6 +1039,19 @@ SOperatorInfo* createStreamPartitionOperatorInfo(SOperatorInfo* downstream, SStr
}
}
if
(
pPartNode
->
pTags
!=
NULL
)
{
int32_t
numOfTags
;
SExprInfo
*
pTagExpr
=
createExprInfo
(
pPartNode
->
pTags
,
NULL
,
&
numOfTags
);
if
(
pTagExpr
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_error
;
}
if
(
initExprSupp
(
&
pInfo
->
tagCalSup
,
pTagExpr
,
numOfTags
)
!=
0
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_error
;
}
}
int32_t
keyLen
=
0
;
code
=
initGroupOptrInfo
(
&
pInfo
->
partitionSup
.
pGroupColVals
,
&
keyLen
,
&
pInfo
->
partitionSup
.
keyBuf
,
pInfo
->
partitionSup
.
pGroupCols
);
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
6f8d4d69
...
...
@@ -1311,10 +1311,15 @@ static void calBlockTag(SExprSupp* pTagCalSup, SSDataBlock* pBlock, SSDataBlock*
blockDataEnsureCapacity
(
pResBlock
,
1
);
projectApplyFunctions
(
pTagCalSup
->
pExprInfo
,
pResBlock
,
pSrcBlock
,
pTagCalSup
->
pCtx
,
1
,
NULL
);
projectApplyFunctions
(
pTagCalSup
->
pExprInfo
,
pResBlock
,
pSrcBlock
,
pTagCalSup
->
pCtx
,
pTagCalSup
->
numOfExprs
,
NULL
);
ASSERT
(
pResBlock
->
info
.
rows
==
1
);
// build tagArray
/*SArray* tagArray = taosArrayInit(0, sizeof(void*));*/
/*STagVal tagVal = {*/
/*.cid = 0,*/
/*.type = 0,*/
/*};*/
// build STag
// set STag
...
...
@@ -2110,6 +2115,9 @@ static void destroyStreamScanOperatorInfo(void* param) {
taosMemoryFree
(
pStreamScan
->
pPseudoExpr
);
}
cleanupExprSupp
(
&
pStreamScan
->
tbnameCalSup
);
cleanupExprSupp
(
&
pStreamScan
->
tagCalSup
);
updateInfoDestroy
(
pStreamScan
->
pUpdateInfo
);
blockDataDestroy
(
pStreamScan
->
pRes
);
blockDataDestroy
(
pStreamScan
->
pUpdateRes
);
...
...
@@ -2164,6 +2172,19 @@ SOperatorInfo* createStreamScanOperatorInfo(SReadHandle* pHandle, STableScanPhys
}
}
if
(
pTableScanNode
->
pTags
!=
NULL
)
{
int32_t
numOfTags
;
SExprInfo
*
pTagExpr
=
createExprInfo
(
pTableScanNode
->
pTags
,
NULL
,
&
numOfTags
);
if
(
pTagExpr
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_error
;
}
if
(
initExprSupp
(
&
pInfo
->
tagCalSup
,
pTagExpr
,
numOfTags
)
!=
0
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
goto
_error
;
}
}
pInfo
->
pBlockLists
=
taosArrayInit
(
4
,
POINTER_BYTES
);
if
(
pInfo
->
pBlockLists
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
...
...
source/libs/wal/src/walMeta.c
浏览文件 @
6f8d4d69
...
...
@@ -351,7 +351,10 @@ int walCheckAndRepairIdx(SWal* pWal) {
taosWriteFile
(
pIdxFile
,
&
idxEntry
,
sizeof
(
SWalIdxEntry
));
break
;
}
taosLSeekFile
(
pIdxFile
,
offset
,
SEEK_SET
);
if
(
taosLSeekFile
(
pIdxFile
,
offset
,
SEEK_SET
)
<
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
wError
(
"vgId:%d cannot seek offset %ld when repair idx since %s"
,
pWal
->
cfg
.
vgId
,
offset
,
terrstr
());
}
int64_t
contLen
=
taosReadFile
(
pIdxFile
,
&
idxEntry
,
sizeof
(
SWalIdxEntry
));
if
(
contLen
<
0
||
contLen
!=
sizeof
(
SWalIdxEntry
))
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
...
...
@@ -636,6 +639,5 @@ int walRemoveMeta(SWal* pWal) {
if
(
metaVer
==
-
1
)
return
0
;
char
fnameStr
[
WAL_FILE_LEN
];
walBuildMetaName
(
pWal
,
metaVer
,
fnameStr
);
taosRemoveFile
(
fnameStr
);
return
0
;
return
taosRemoveFile
(
fnameStr
);
}
source/libs/wal/src/walRead.c
浏览文件 @
6f8d4d69
...
...
@@ -514,7 +514,6 @@ int32_t walReadVer(SWalReader *pReader, int64_t ver) {
pReader
->
pHead
->
head
.
version
,
ver
);
pReader
->
curInvalid
=
1
;
terrno
=
TSDB_CODE_WAL_FILE_CORRUPTED
;
ASSERT
(
0
);
taosThreadMutexUnlock
(
&
pReader
->
mutex
);
return
-
1
;
}
...
...
@@ -528,7 +527,6 @@ int32_t walReadVer(SWalReader *pReader, int64_t ver) {
wError
(
"checksum written into log:%u, checksum calculated:%u"
,
logCkSum
,
readCkSum
);
pReader
->
curInvalid
=
1
;
terrno
=
TSDB_CODE_WAL_FILE_CORRUPTED
;
ASSERT
(
0
);
taosThreadMutexUnlock
(
&
pReader
->
mutex
);
return
-
1
;
}
...
...
source/libs/wal/src/walWrite.c
浏览文件 @
6f8d4d69
...
...
@@ -42,10 +42,20 @@ int32_t walRestoreFromSnapshot(SWal *pWal, int64_t ver) {
SWalFileInfo
*
pFileInfo
=
taosArrayGet
(
pWal
->
fileInfoSet
,
i
);
char
fnameStr
[
WAL_FILE_LEN
];
walBuildLogName
(
pWal
,
pFileInfo
->
firstVer
,
fnameStr
);
taosRemoveFile
(
fnameStr
);
if
(
taosRemoveFile
(
fnameStr
)
<
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
wError
(
"vgId:%d restore from snapshot, cannot remove file %s since %s"
,
pWal
->
cfg
.
vgId
,
fnameStr
,
terrstr
());
return
-
1
;
}
wInfo
(
"vgId:%d restore from snapshot, remove file %s"
,
pWal
->
cfg
.
vgId
,
fnameStr
);
walBuildIdxName
(
pWal
,
pFileInfo
->
firstVer
,
fnameStr
);
taosRemoveFile
(
fnameStr
);
if
(
taosRemoveFile
(
fnameStr
)
<
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
wError
(
"vgId:%d cannot remove file %s since %s"
,
pWal
->
cfg
.
vgId
,
fnameStr
,
terrstr
());
return
-
1
;
}
wInfo
(
"vgId:%d restore from snapshot, remove file %s"
,
pWal
->
cfg
.
vgId
,
fnameStr
);
}
}
walRemoveMeta
(
pWal
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录