Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
271822eb
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看板
提交
271822eb
编写于
12月 08, 2022
作者:
L
Liu Jicong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: support submitreq2
上级
df251e97
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
47 addition
and
29 deletion
+47
-29
source/dnode/vnode/src/tq/tqRead.c
source/dnode/vnode/src/tq/tqRead.c
+26
-7
source/dnode/vnode/src/vnd/vnodeSvr.c
source/dnode/vnode/src/vnd/vnodeSvr.c
+0
-2
source/libs/wal/src/walRead.c
source/libs/wal/src/walRead.c
+21
-20
未找到文件。
source/dnode/vnode/src/tq/tqRead.c
浏览文件 @
271822eb
...
...
@@ -389,7 +389,7 @@ int32_t tqReaderSetSubmitReq2(STqReader* pReader, void* msgStr, int32_t msgLen,
pReader
->
msg2
.
ver
=
ver
;
pReader
->
ver
=
ver
;
tqDebug
(
"tq reader set msg %p
"
,
msgStr
);
tqDebug
(
"tq reader set msg %p
%d"
,
msgStr
,
msgLen
);
if
(
pReader
->
setMsg
==
0
)
{
SDecoder
decoder
;
...
...
@@ -683,6 +683,7 @@ int32_t tqRetrieveDataBlock2(SSDataBlock* pBlock, STqReader* pReader) {
}
else
if
(
pCol
->
cid
==
pColData
->
info
.
colId
)
{
for
(
int32_t
i
=
0
;
i
<
pCol
->
nVal
;
i
++
)
{
tColDataGetValue
(
pCol
,
sourceIdx
,
&
colVal
);
#if 0
void* val = NULL;
if (IS_STR_DATA_TYPE(colVal.type)) {
val = colVal.value.pData;
...
...
@@ -692,6 +693,20 @@ int32_t tqRetrieveDataBlock2(SSDataBlock* pBlock, STqReader* pReader) {
if (colDataAppend(pColData, i, val, !COL_VAL_IS_VALUE(&colVal)) < 0) {
goto FAIL;
}
#endif
char
val
[
65535
+
2
];
if
(
IS_STR_DATA_TYPE
(
colVal
.
type
))
{
memcpy
(
varDataVal
(
val
),
colVal
.
value
.
pData
,
colVal
.
value
.
nData
);
varDataSetLen
(
val
,
colVal
.
value
.
nData
);
if
(
colDataAppend
(
pColData
,
i
,
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
goto
FAIL
;
}
/*val = colVal.value.pData;*/
}
else
{
if
(
colDataAppend
(
pColData
,
i
,
(
void
*
)
&
colVal
.
value
.
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
goto
FAIL
;
}
}
}
sourceIdx
++
;
targetIdx
++
;
...
...
@@ -718,14 +733,18 @@ int32_t tqRetrieveDataBlock2(SSDataBlock* pBlock, STqReader* pReader) {
sourceIdx
++
;
continue
;
}
else
if
(
colVal
.
cid
==
pColData
->
info
.
colId
)
{
void
*
val
=
NULL
;
char
val
[
65535
+
2
]
;
if
(
IS_STR_DATA_TYPE
(
colVal
.
type
))
{
val
=
colVal
.
value
.
pData
;
memcpy
(
varDataVal
(
val
),
colVal
.
value
.
pData
,
colVal
.
value
.
nData
);
varDataSetLen
(
val
,
colVal
.
value
.
nData
);
if
(
colDataAppend
(
pColData
,
i
,
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
goto
FAIL
;
}
/*val = colVal.value.pData;*/
}
else
{
val
=
&
colVal
.
value
.
val
;
}
if
(
colDataAppend
(
pColData
,
i
,
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
goto
FAIL
;
if
(
colDataAppend
(
pColData
,
i
,
(
void
*
)
&
colVal
.
value
.
val
,
!
COL_VAL_IS_VALUE
(
&
colVal
))
<
0
)
{
goto
FAIL
;
}
}
sourceIdx
++
;
...
...
source/dnode/vnode/src/vnd/vnodeSvr.c
浏览文件 @
271822eb
...
...
@@ -881,8 +881,6 @@ static int32_t vnodeProcessSubmitReq(SVnode *pVnode, int64_t version, void *pReq
pRsp
->
code
=
TSDB_CODE_SUCCESS
;
vDebug
(
"vvvvvvvvvvvv %p, %d"
,
pReq
,
len
);
// decode
SDecoder
dc
=
{
0
};
tDecoderInit
(
&
dc
,
pReq
,
len
);
...
...
source/libs/wal/src/walRead.c
浏览文件 @
271822eb
...
...
@@ -271,57 +271,58 @@ static int32_t walFetchHeadNew(SWalReader *pRead, int64_t fetchVer) {
return
0
;
}
static
int32_t
walFetchBodyNew
(
SWalReader
*
pRead
)
{
SWalCont
*
pReadHead
=
&
pRead
->
pHead
->
head
;
static
int32_t
walFetchBodyNew
(
SWalReader
*
pRead
er
)
{
SWalCont
*
pReadHead
=
&
pRead
er
->
pHead
->
head
;
int64_t
ver
=
pReadHead
->
version
;
wDebug
(
"vgId:%d, wal starts to fetch body, index:%"
PRId64
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
);
wDebug
(
"vgId:%d, wal starts to fetch body, ver:%"
PRId64
" ,len:%d"
,
pReader
->
pWal
->
cfg
.
vgId
,
ver
,
pReadHead
->
bodyLen
);
if
(
pRead
->
capacity
<
pReadHead
->
bodyLen
)
{
SWalCkHead
*
ptr
=
(
SWalCkHead
*
)
taosMemoryRealloc
(
pRead
->
pHead
,
sizeof
(
SWalCkHead
)
+
pReadHead
->
bodyLen
);
if
(
pRead
er
->
capacity
<
pReadHead
->
bodyLen
)
{
SWalCkHead
*
ptr
=
(
SWalCkHead
*
)
taosMemoryRealloc
(
pRead
er
->
pHead
,
sizeof
(
SWalCkHead
)
+
pReadHead
->
bodyLen
);
if
(
ptr
==
NULL
)
{
terrno
=
TSDB_CODE_OUT_OF_MEMORY
;
return
-
1
;
}
pRead
->
pHead
=
ptr
;
pReadHead
=
&
pRead
->
pHead
->
head
;
pRead
->
capacity
=
pReadHead
->
bodyLen
;
pRead
er
->
pHead
=
ptr
;
pReadHead
=
&
pRead
er
->
pHead
->
head
;
pRead
er
->
capacity
=
pReadHead
->
bodyLen
;
}
if
(
pReadHead
->
bodyLen
!=
taosReadFile
(
pRead
->
pLogFile
,
pReadHead
->
body
,
pReadHead
->
bodyLen
))
{
if
(
pReadHead
->
bodyLen
!=
taosReadFile
(
pRead
er
->
pLogFile
,
pReadHead
->
body
,
pReadHead
->
bodyLen
))
{
if
(
pReadHead
->
bodyLen
<
0
)
{
terrno
=
TAOS_SYSTEM_ERROR
(
errno
);
wError
(
"vgId:%d, wal fetch body error:%"
PRId64
", read request index:%"
PRId64
", since %s"
,
pRead
->
pWal
->
cfg
.
vgId
,
pRead
->
pHead
->
head
.
version
,
ver
,
tstrerror
(
terrno
));
pRead
er
->
pWal
->
cfg
.
vgId
,
pReader
->
pHead
->
head
.
version
,
ver
,
tstrerror
(
terrno
));
}
else
{
wError
(
"vgId:%d, wal fetch body error:%"
PRId64
", read request index:%"
PRId64
", since file corrupted"
,
pRead
->
pWal
->
cfg
.
vgId
,
pRead
->
pHead
->
head
.
version
,
ver
);
pRead
er
->
pWal
->
cfg
.
vgId
,
pReader
->
pHead
->
head
.
version
,
ver
);
terrno
=
TSDB_CODE_WAL_FILE_CORRUPTED
;
}
pRead
->
curInvalid
=
1
;
pRead
er
->
curInvalid
=
1
;
ASSERT
(
0
);
return
-
1
;
}
if
(
pReadHead
->
version
!=
ver
)
{
wError
(
"vgId:%d, wal fetch body error:%"
PRId64
", read request index:%"
PRId64
,
pRead
->
pWal
->
cfg
.
vgId
,
pRead
->
pHead
->
head
.
version
,
ver
);
pRead
->
curInvalid
=
1
;
wError
(
"vgId:%d, wal fetch body error:%"
PRId64
", read request index:%"
PRId64
,
pRead
er
->
pWal
->
cfg
.
vgId
,
pRead
er
->
pHead
->
head
.
version
,
ver
);
pRead
er
->
curInvalid
=
1
;
terrno
=
TSDB_CODE_WAL_FILE_CORRUPTED
;
ASSERT
(
0
);
return
-
1
;
}
if
(
walValidBodyCksum
(
pRead
->
pHead
)
!=
0
)
{
wError
(
"vgId:%d, wal fetch body error:%"
PRId64
", since body checksum not passed"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
);
pRead
->
curInvalid
=
1
;
if
(
walValidBodyCksum
(
pRead
er
->
pHead
)
!=
0
)
{
wError
(
"vgId:%d, wal fetch body error:%"
PRId64
", since body checksum not passed"
,
pRead
er
->
pWal
->
cfg
.
vgId
,
ver
);
pRead
er
->
curInvalid
=
1
;
terrno
=
TSDB_CODE_WAL_FILE_CORRUPTED
;
ASSERT
(
0
);
return
-
1
;
}
wDebug
(
"vgId:%d, index:%"
PRId64
" is fetched, cursor advance"
,
pRead
->
pWal
->
cfg
.
vgId
,
ver
);
pRead
->
curVersion
=
ver
+
1
;
wDebug
(
"vgId:%d, index:%"
PRId64
" is fetched, cursor advance"
,
pRead
er
->
pWal
->
cfg
.
vgId
,
ver
);
pRead
er
->
curVersion
=
ver
+
1
;
return
0
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录