Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2968ac85
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
未验证
提交
2968ac85
编写于
7月 05, 2022
作者:
dengyihao
提交者:
GitHub
7月 05, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #14520 from taosdata/fix/rpcMem
fix: invalid read/write
上级
55a6455d
9927aad9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
45 addition
and
41 deletion
+45
-41
include/common/tmsg.h
include/common/tmsg.h
+3
-2
source/dnode/vnode/src/vnd/vnodeCfg.c
source/dnode/vnode/src/vnd/vnodeCfg.c
+33
-33
source/dnode/vnode/src/vnd/vnodeQuery.c
source/dnode/vnode/src/vnd/vnodeQuery.c
+7
-5
source/libs/transport/src/transSvr.c
source/libs/transport/src/transSvr.c
+2
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
2968ac85
...
...
@@ -55,8 +55,9 @@ extern int32_t tMsgDict[];
#define TMSG_SEG_CODE(TYPE) (((TYPE)&0xff00) >> 8)
#define TMSG_SEG_SEQ(TYPE) ((TYPE)&0xff)
#define TMSG_INFO(TYPE) tMsgInfo[tMsgDict[TMSG_SEG_CODE(TYPE)] + TMSG_SEG_SEQ(TYPE)]
#define TMSG_INDEX(TYPE) (tMsgDict[TMSG_SEG_CODE(TYPE)] + TMSG_SEG_SEQ(TYPE))
#define TMSG_INFO(TYPE) \
(((TYPE) >= 0 && (TYPE) < TDMT_MAX) ? tMsgInfo[tMsgDict[TMSG_SEG_CODE(TYPE)] + TMSG_SEG_SEQ(TYPE)] : 0)
#define TMSG_INDEX(TYPE) (tMsgDict[TMSG_SEG_CODE(TYPE)] + TMSG_SEG_SEQ(TYPE))
typedef
uint16_t
tmsg_t
;
...
...
source/dnode/vnode/src/vnd/vnodeCfg.c
浏览文件 @
2968ac85
...
...
@@ -79,7 +79,7 @@ int vnodeEncodeConfig(const void *pObj, SJson *pJson) {
SJson
*
pNodeRetentions
=
tjsonCreateArray
();
tjsonAddItemToObject
(
pJson
,
"retentions"
,
pNodeRetentions
);
for
(
int32_t
i
=
0
;
i
<
nRetention
;
++
i
)
{
SJson
*
pNodeRetention
=
tjsonCreateObject
();
SJson
*
pNodeRetention
=
tjsonCreateObject
();
const
SRetention
*
pRetention
=
pCfg
->
tsdbCfg
.
retentions
+
i
;
tjsonAddIntegerToObject
(
pNodeRetention
,
"freq"
,
pRetention
->
freq
);
tjsonAddIntegerToObject
(
pNodeRetention
,
"freqUnit"
,
pRetention
->
freqUnit
);
...
...
@@ -118,45 +118,45 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) {
int32_t
code
;
tjsonGetNumberValue
(
pJson
,
"vgId"
,
pCfg
->
vgId
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
if
(
tjsonGetStringValue
(
pJson
,
"dbname"
,
pCfg
->
dbname
)
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"dbId"
,
pCfg
->
dbId
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"szPage"
,
pCfg
->
szPage
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"szCache"
,
pCfg
->
szCache
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"szBuf"
,
pCfg
->
szBuf
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"isHeap"
,
pCfg
->
isHeap
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"isWeak"
,
pCfg
->
isWeak
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"isTsma"
,
pCfg
->
isTsma
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"isRsma"
,
pCfg
->
isRsma
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"precision"
,
pCfg
->
tsdbCfg
.
precision
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"update"
,
pCfg
->
tsdbCfg
.
update
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"compression"
,
pCfg
->
tsdbCfg
.
compression
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"slLevel"
,
pCfg
->
tsdbCfg
.
slLevel
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"daysPerFile"
,
pCfg
->
tsdbCfg
.
days
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"minRows"
,
pCfg
->
tsdbCfg
.
minRows
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"maxRows"
,
pCfg
->
tsdbCfg
.
maxRows
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"keep0"
,
pCfg
->
tsdbCfg
.
keep0
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"keep1"
,
pCfg
->
tsdbCfg
.
keep1
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"keep2"
,
pCfg
->
tsdbCfg
.
keep2
,
code
);
if
(
code
<
0
)
return
-
1
;
SJson
*
pNodeRetentions
=
tjsonGetObjectItem
(
pJson
,
"retentions"
);
if
(
code
<
0
)
return
-
1
;
SJson
*
pNodeRetentions
=
tjsonGetObjectItem
(
pJson
,
"retentions"
);
int32_t
nRetention
=
tjsonGetArraySize
(
pNodeRetentions
);
if
(
nRetention
>
TSDB_RETENTION_MAX
)
{
nRetention
=
TSDB_RETENTION_MAX
;
...
...
@@ -170,30 +170,30 @@ int vnodeDecodeConfig(const SJson *pJson, void *pObj) {
tjsonGetNumberValue
(
pNodeRetention
,
"keepUnit"
,
(
pCfg
->
tsdbCfg
.
retentions
)[
i
].
keepUnit
,
code
);
}
tjsonGetNumberValue
(
pJson
,
"wal.vgId"
,
pCfg
->
walCfg
.
vgId
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"wal.fsyncPeriod"
,
pCfg
->
walCfg
.
fsyncPeriod
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"wal.retentionPeriod"
,
pCfg
->
walCfg
.
retentionPeriod
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"wal.rollPeriod"
,
pCfg
->
walCfg
.
rollPeriod
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"wal.retentionSize"
,
pCfg
->
walCfg
.
retentionSize
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"wal.segSize"
,
pCfg
->
walCfg
.
segSize
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"wal.level"
,
pCfg
->
walCfg
.
level
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"hashBegin"
,
pCfg
->
hashBegin
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"hashEnd"
,
pCfg
->
hashEnd
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"hashMethod"
,
pCfg
->
hashMethod
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"syncCfg.replicaNum"
,
pCfg
->
syncCfg
.
replicaNum
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
tjsonGetNumberValue
(
pJson
,
"syncCfg.myIndex"
,
pCfg
->
syncCfg
.
myIndex
,
code
);
if
(
code
<
0
)
return
-
1
;
if
(
code
<
0
)
return
-
1
;
SJson
*
pNodeInfoArr
=
tjsonGetObjectItem
(
pJson
,
"syncCfg.nodeInfo"
);
int
arraySize
=
tjsonGetArraySize
(
pNodeInfoArr
);
...
...
source/dnode/vnode/src/vnd/vnodeQuery.c
浏览文件 @
2968ac85
...
...
@@ -27,10 +27,10 @@ int vnodeGetTableMeta(SVnode *pVnode, SRpcMsg *pMsg) {
SMetaReader
mer1
=
{
0
};
SMetaReader
mer2
=
{
0
};
char
tableFName
[
TSDB_TABLE_FNAME_LEN
];
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
=
{
0
}
;
int32_t
code
=
0
;
int32_t
rspLen
=
0
;
void
*
pRsp
=
NULL
;
void
*
pRsp
=
NULL
;
SSchemaWrapper
schema
=
{
0
};
SSchemaWrapper
schemaTag
=
{
0
};
...
...
@@ -111,6 +111,7 @@ _exit:
rpcMsg
.
pCont
=
pRsp
;
rpcMsg
.
contLen
=
rspLen
;
rpcMsg
.
code
=
code
;
rpcMsg
.
msgType
=
pMsg
->
msgType
;
if
(
code
)
{
qError
(
"get table %s meta failed cause of %s"
,
infoReq
.
tbName
,
tstrerror
(
code
));
...
...
@@ -130,10 +131,10 @@ int vnodeGetTableCfg(SVnode *pVnode, SRpcMsg *pMsg) {
SMetaReader
mer1
=
{
0
};
SMetaReader
mer2
=
{
0
};
char
tableFName
[
TSDB_TABLE_FNAME_LEN
];
SRpcMsg
rpcMsg
;
SRpcMsg
rpcMsg
=
{
0
}
;
int32_t
code
=
0
;
int32_t
rspLen
=
0
;
void
*
pRsp
=
NULL
;
void
*
pRsp
=
NULL
;
SSchemaWrapper
schema
=
{
0
};
SSchemaWrapper
schemaTag
=
{
0
};
...
...
@@ -220,6 +221,7 @@ _exit:
rpcMsg
.
pCont
=
pRsp
;
rpcMsg
.
contLen
=
rspLen
;
rpcMsg
.
code
=
code
;
rpcMsg
.
msgType
=
pMsg
->
msgType
;
if
(
code
)
{
qError
(
"get table %s cfg failed cause of %s"
,
cfgReq
.
tbName
,
tstrerror
(
code
));
...
...
@@ -260,7 +262,7 @@ void vnodeGetInfo(SVnode *pVnode, const char **dbname, int32_t *vgId) {
}
// wrapper of tsdb read interface
tsdbReaderT
tsdbQueryCacheLast
(
SVnode
*
pVnode
,
SQueryTableDataCond
*
pCond
,
STableListInfo
*
tableList
,
uint64_t
qId
,
tsdbReaderT
tsdbQueryCacheLast
(
SVnode
*
pVnode
,
SQueryTableDataCond
*
pCond
,
STableListInfo
*
tableList
,
uint64_t
qId
,
void
*
pMemRef
)
{
#if 0
return tsdbQueryCacheLastT(pVnode->pTsdb, pCond, groupList, qId, pMemRef);
...
...
source/libs/transport/src/transSvr.c
浏览文件 @
2968ac85
...
...
@@ -402,8 +402,9 @@ static void uvPrepareSendData(SSvrMsg* smsg, uv_buf_t* wb) {
}
else
{
pHead
->
msgType
=
pMsg
->
msgType
;
// set up resp msg type
if
(
pHead
->
msgType
==
0
&&
transMsgLenFromCont
(
pMsg
->
contLen
)
==
sizeof
(
STransMsgHead
))
if
(
pHead
->
msgType
==
0
&&
transMsgLenFromCont
(
pMsg
->
contLen
)
==
sizeof
(
STransMsgHead
))
{
pHead
->
msgType
=
pConn
->
inType
+
1
;
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录