Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
2cf04d23
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2cf04d23
编写于
3月 24, 2020
作者:
S
slguan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-10] fix compile error in dnode
上级
355eeda4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
27 addition
and
28 deletion
+27
-28
src/dnode/src/dnodeRead.c
src/dnode/src/dnodeRead.c
+4
-4
src/dnode/src/dnodeWrite.c
src/dnode/src/dnodeWrite.c
+23
-24
未找到文件。
src/dnode/src/dnodeRead.c
浏览文件 @
2cf04d23
...
...
@@ -164,7 +164,7 @@ static void *dnodeProcessReadQueue(void *param) {
void
*
pVnode
;
while
(
1
)
{
if
(
taosReadQitemFromQset
(
qset
,
&
type
,
&
pReadMsg
,
&
pVnode
)
==
0
)
{
if
(
taosReadQitemFromQset
(
qset
,
&
type
,
(
void
**
)
&
pReadMsg
,
(
void
**
)
&
pVnode
)
==
0
)
{
dnodeHandleIdleReadWorker
();
continue
;
}
...
...
@@ -228,11 +228,11 @@ static void dnodeProcessReadResult(void *pVnode, SReadMsg *pRead) {
rpcFreeCont
(
pRead
->
rpcMsg
.
pCont
);
// free the received message
}
static
void
dnodeProcessQueryMsg
(
SReadMsg
*
pMsg
)
{
static
void
dnodeProcessQueryMsg
(
void
*
pVnode
,
SReadMsg
*
pMsg
)
{
SQueryTableMsg
*
pQueryTableMsg
=
(
SQueryTableMsg
*
)
pMsg
->
pCont
;
SQInfo
*
pQInfo
=
NULL
;
void
*
tsdb
=
dnodeGetVnodeTsdb
(
p
Msg
->
p
Vnode
);
void
*
tsdb
=
dnodeGetVnodeTsdb
(
pVnode
);
int32_t
code
=
qCreateQueryInfo
(
tsdb
,
pQueryTableMsg
,
&
pQInfo
);
SQueryTableRsp
*
pRsp
=
(
SQueryTableRsp
*
)
rpcMallocCont
(
sizeof
(
SQueryTableRsp
));
...
...
@@ -254,7 +254,7 @@ static void dnodeProcessQueryMsg(SReadMsg *pMsg) {
}
static
int32_t
c
=
0
;
static
void
dnodeProcessRetrieveMsg
(
SReadMsg
*
pMsg
)
{
static
void
dnodeProcessRetrieveMsg
(
void
*
pVnode
,
SReadMsg
*
pMsg
)
{
SRetrieveTableMsg
*
pRetrieve
=
pMsg
->
pCont
;
void
*
pQInfo
=
(
void
*
)
htobe64
(
pRetrieve
->
qhandle
);
...
...
src/dnode/src/dnodeWrite.c
浏览文件 @
2cf04d23
...
...
@@ -53,12 +53,12 @@ typedef struct _thread_obj {
static
void
(
*
dnodeProcessWriteMsgFp
[
TSDB_MSG_TYPE_MAX
])(
void
*
,
SWriteMsg
*
);
static
void
*
dnodeProcessWriteQueue
(
void
*
param
);
static
void
dnodeHandleIdleWorker
(
SWriteWorker
*
pWorker
);
static
void
dnodeProcessWriteResult
(
SWriteMsg
*
pWrite
);
static
void
dnodeProcessSubmitMsg
(
SWriteMsg
*
pMsg
);
static
void
dnodeProcessCreateTableMsg
(
SWriteMsg
*
pMsg
);
static
void
dnodeProcessDropTableMsg
(
SWriteMsg
*
pMsg
);
static
void
dnodeProcessAlterTableMsg
(
SWriteMsg
*
pMsg
);
static
void
dnodeProcessDropStableMsg
(
SWriteMsg
*
pMsg
);
static
void
dnodeProcessWriteResult
(
void
*
pVnode
,
SWriteMsg
*
pWrite
);
static
void
dnodeProcessSubmitMsg
(
void
*
pVnode
,
SWriteMsg
*
pMsg
);
static
void
dnodeProcessCreateTableMsg
(
void
*
pVnode
,
SWriteMsg
*
pMsg
);
static
void
dnodeProcessDropTableMsg
(
void
*
pVnode
,
SWriteMsg
*
pMsg
);
static
void
dnodeProcessAlterTableMsg
(
void
*
pVnode
,
SWriteMsg
*
pMsg
);
static
void
dnodeProcessDropStableMsg
(
void
*
pVnode
,
SWriteMsg
*
pMsg
);
SWriteWorkerPool
wWorkerPool
;
...
...
@@ -193,20 +193,20 @@ static void *dnodeProcessWriteQueue(void *param) {
continue
;
}
for
(
int32_t
i
=
0
;
i
<
numOfMsgs
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
numOfMsgs
;
++
i
)
{
// retrieve all items, and write them into WAL
taosGetQitem
(
qall
,
&
type
,
&
pWriteMsg
);
taosGetQitem
(
qall
,
&
type
,
(
void
**
)
&
pWriteMsg
);
// walWrite(pVnode->whandle, writeMsg.rpcMsg.msgType, writeMsg.pCont, writeMsg.contLen);
}
// flush WAL file
// walFsync(pVnode->whandle);
// browse all items, and process them one by one
taosResetQitems
(
qall
);
for
(
int32_t
i
=
0
;
i
<
numOfMsgs
;
++
i
)
{
taosGetQitem
(
qall
,
&
type
,
&
pWriteMsg
);
taosGetQitem
(
qall
,
&
type
,
(
void
**
)
&
pWriteMsg
);
terrno
=
0
;
if
(
dnodeProcessWriteMsgFp
[
pWriteMsg
->
rpcMsg
.
msgType
])
{
...
...
@@ -218,7 +218,6 @@ static void *dnodeProcessWriteQueue(void *param) {
dnodeProcessWriteResult
(
pVnode
,
pWriteMsg
);
taosFreeQitem
(
pWriteMsg
);
}
}
taosFreeQall
(
qall
);
...
...
@@ -270,7 +269,7 @@ static void dnodeHandleIdleWorker(SWriteWorker *pWorker) {
}
}
static
void
dnodeProcessSubmitMsg
(
SWriteMsg
*
pMsg
)
{
static
void
dnodeProcessSubmitMsg
(
void
*
pVnode
,
SWriteMsg
*
pMsg
)
{
dTrace
(
"submit msg is disposed"
);
SShellSubmitRspMsg
*
pRsp
=
rpcMallocCont
(
sizeof
(
SShellSubmitRspMsg
));
...
...
@@ -279,7 +278,7 @@ static void dnodeProcessSubmitMsg(SWriteMsg *pMsg) {
pRsp
->
affectedRows
=
htonl
(
1
);
pRsp
->
numOfFailedBlocks
=
0
;
void
*
tsdb
=
dnodeGetVnodeTsdb
(
p
Msg
->
p
Vnode
);
void
*
tsdb
=
dnodeGetVnodeTsdb
(
pVnode
);
assert
(
tsdb
!=
NULL
);
tsdbInsertData
(
tsdb
,
pMsg
->
pCont
);
...
...
@@ -295,7 +294,7 @@ static void dnodeProcessSubmitMsg(SWriteMsg *pMsg) {
rpcSendResponse
(
&
rpcRsp
);
}
static
void
dnodeProcessCreateTableMsg
(
SWriteMsg
*
pMsg
)
{
static
void
dnodeProcessCreateTableMsg
(
void
*
pVnode
,
SWriteMsg
*
pMsg
)
{
SMDCreateTableMsg
*
pTable
=
pMsg
->
rpcMsg
.
pCont
;
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
rpcMsg
.
handle
,
.
pCont
=
NULL
,
.
contLen
=
0
,
.
code
=
0
,
.
msgType
=
0
};
...
...
@@ -344,16 +343,16 @@ static void dnodeProcessCreateTableMsg(SWriteMsg *pMsg) {
tsdbTableSetTagValue
(
&
tCfg
,
dataRow
,
false
);
}
void
*
pTsdb
=
dnodeGetVnodeTsdb
(
p
Msg
->
p
Vnode
);
void
*
pTsdb
=
dnodeGetVnodeTsdb
(
pVnode
);
rpcRsp
.
code
=
tsdbCreateTable
(
pTsdb
,
&
tCfg
);
dnodeReleaseVnode
(
p
Msg
->
p
Vnode
);
dnodeReleaseVnode
(
pVnode
);
dTrace
(
"table:%s, create table result:%s"
,
pTable
->
tableId
,
tstrerror
(
rpcRsp
.
code
));
rpcSendResponse
(
&
rpcRsp
);
}
static
void
dnodeProcessDropTableMsg
(
SWriteMsg
*
pMsg
)
{
static
void
dnodeProcessDropTableMsg
(
void
*
pVnode
,
SWriteMsg
*
pMsg
)
{
SMDDropTableMsg
*
pTable
=
pMsg
->
rpcMsg
.
pCont
;
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
rpcMsg
.
handle
,
.
pCont
=
NULL
,
.
contLen
=
0
,
.
code
=
0
,
.
msgType
=
0
};
...
...
@@ -363,16 +362,16 @@ static void dnodeProcessDropTableMsg(SWriteMsg *pMsg) {
.
tid
=
htonl
(
pTable
->
sid
)
};
void
*
pTsdb
=
dnodeGetVnodeTsdb
(
p
Msg
->
p
Vnode
);
void
*
pTsdb
=
dnodeGetVnodeTsdb
(
pVnode
);
rpcRsp
.
code
=
tsdbDropTable
(
pTsdb
,
tableId
);
dnodeReleaseVnode
(
p
Msg
->
p
Vnode
);
dnodeReleaseVnode
(
pVnode
);
dTrace
(
"table:%s, drop table result:%s"
,
pTable
->
tableId
,
tstrerror
(
rpcRsp
.
code
));
rpcSendResponse
(
&
rpcRsp
);
}
static
void
dnodeProcessAlterTableMsg
(
SWriteMsg
*
pMsg
)
{
static
void
dnodeProcessAlterTableMsg
(
void
*
pVnode
,
SWriteMsg
*
pMsg
)
{
SMDCreateTableMsg
*
pTable
=
pMsg
->
rpcMsg
.
pCont
;
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
rpcMsg
.
handle
,
.
pCont
=
NULL
,
.
contLen
=
0
,
.
code
=
0
,
.
msgType
=
0
};
...
...
@@ -421,16 +420,16 @@ static void dnodeProcessAlterTableMsg(SWriteMsg *pMsg) {
tsdbTableSetTagValue
(
&
tCfg
,
dataRow
,
false
);
}
void
*
pTsdb
=
dnodeGetVnodeTsdb
(
p
Msg
->
p
Vnode
);
void
*
pTsdb
=
dnodeGetVnodeTsdb
(
pVnode
);
rpcRsp
.
code
=
tsdbAlterTable
(
pTsdb
,
&
tCfg
);
dnodeReleaseVnode
(
p
Msg
->
p
Vnode
);
dnodeReleaseVnode
(
pVnode
);
dTrace
(
"table:%s, alter table result:%s"
,
pTable
->
tableId
,
tstrerror
(
rpcRsp
.
code
));
rpcSendResponse
(
&
rpcRsp
);
}
static
void
dnodeProcessDropStableMsg
(
SWriteMsg
*
pMsg
)
{
static
void
dnodeProcessDropStableMsg
(
void
*
pVnode
,
SWriteMsg
*
pMsg
)
{
SMDDropSTableMsg
*
pTable
=
pMsg
->
rpcMsg
.
pCont
;
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
rpcMsg
.
handle
,
.
pCont
=
NULL
,
.
contLen
=
0
,
.
code
=
0
,
.
msgType
=
0
};
...
...
@@ -442,7 +441,7 @@ static void dnodeProcessDropStableMsg(SWriteMsg *pMsg) {
//rpcRsp.code = tsdbDropSTable(pTsdb, pTable->uid);
rpcRsp
.
code
=
TSDB_CODE_SUCCESS
;
dnodeReleaseVnode
(
p
Msg
->
p
Vnode
);
dnodeReleaseVnode
(
pVnode
);
dTrace
(
"stable:%s, drop stable result:%s"
,
pTable
->
tableId
,
tstrerror
(
rpcRsp
.
code
));
rpcSendResponse
(
&
rpcRsp
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录