Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
c1d7a1a7
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看板
未验证
提交
c1d7a1a7
编写于
11月 05, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
11月 05, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #4124 from taosdata/feature/table
Feature/table
上级
4f3d28a9
048d0a46
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
94 addition
and
85 deletion
+94
-85
src/dnode/src/dnodeVRead.c
src/dnode/src/dnodeVRead.c
+18
-30
src/inc/vnode.h
src/inc/vnode.h
+10
-7
src/vnode/src/vnodeMain.c
src/vnode/src/vnodeMain.c
+0
-15
src/vnode/src/vnodeRead.c
src/vnode/src/vnodeRead.c
+65
-32
src/vnode/src/vnodeWrite.c
src/vnode/src/vnodeWrite.c
+1
-1
未找到文件。
src/dnode/src/dnodeVRead.c
浏览文件 @
c1d7a1a7
...
...
@@ -92,33 +92,23 @@ void dnodeDispatchToVReadQueue(SRpcMsg *pMsg) {
pHead
->
vgId
=
htonl
(
pHead
->
vgId
);
pHead
->
contLen
=
htonl
(
pHead
->
contLen
);
taos_queue
queue
=
vnodeAcquireRqueue
(
pHead
->
vgId
);
if
(
queue
==
NULL
)
{
leftLen
-=
pHead
->
contLen
;
pCont
-=
pHead
->
contLen
;
continue
;
void
*
pVnode
=
vnodeAcquire
(
pHead
->
vgId
);
if
(
pVnode
!=
NULL
)
{
int32_t
code
=
vnodeWriteToRQueue
(
pVnode
,
pCont
,
pHead
->
contLen
,
TAOS_QTYPE_RPC
,
pMsg
);
if
(
code
==
TSDB_CODE_SUCCESS
)
queuedMsgNum
++
;
vnodeRelease
(
pVnode
);
}
// put message into queue
SVReadMsg
*
pRead
=
taosAllocateQitem
(
sizeof
(
SVReadMsg
));
pRead
->
rpcMsg
=
*
pMsg
;
pRead
->
pCont
=
pCont
;
pRead
->
contLen
=
pHead
->
contLen
;
// next vnode
leftLen
-=
pHead
->
contLen
;
pCont
-=
pHead
->
contLen
;
queuedMsgNum
++
;
taosWriteQitem
(
queue
,
TAOS_QTYPE_RPC
,
pRead
);
}
if
(
queuedMsgNum
==
0
)
{
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
handle
,
.
code
=
TSDB_CODE_VND_INVALID_VGROUP_ID
};
rpcSendResponse
(
&
rpcRsp
);
rpcFreeCont
(
pMsg
->
pCont
);
}
rpcFreeCont
(
pMsg
->
pCont
);
}
void
*
dnodeAllocVReadQueue
(
void
*
pVnode
)
{
...
...
@@ -162,50 +152,48 @@ void dnodeFreeVReadQueue(void *rqueue) {
void
dnodeSendRpcVReadRsp
(
void
*
pVnode
,
SVReadMsg
*
pRead
,
int32_t
code
)
{
SRpcMsg
rpcRsp
=
{
.
handle
=
pRead
->
rpc
Msg
.
h
andle
,
.
handle
=
pRead
->
rpc
H
andle
,
.
pCont
=
pRead
->
rspRet
.
rsp
,
.
contLen
=
pRead
->
rspRet
.
len
,
.
code
=
code
,
};
rpcSendResponse
(
&
rpcRsp
);
rpcFreeCont
(
pRead
->
rpcMsg
.
pCont
);
vnodeRelease
(
pVnode
);
}
void
dnodeDispatchNonRspMsg
(
void
*
pVnode
,
SVReadMsg
*
pRead
,
int32_t
code
)
{
rpcFreeCont
(
pRead
->
rpcMsg
.
pCont
);
vnodeRelease
(
pVnode
);
}
static
void
*
dnodeProcessReadQueue
(
void
*
param
)
{
SVReadMsg
*
pRead
Msg
;
SVReadMsg
*
pRead
;
int32_t
qtype
;
void
*
pVnode
;
while
(
1
)
{
if
(
taosReadQitemFromQset
(
tsVReadQset
,
&
qtype
,
(
void
**
)
&
pRead
Msg
,
&
pVnode
)
==
0
)
{
if
(
taosReadQitemFromQset
(
tsVReadQset
,
&
qtype
,
(
void
**
)
&
pRead
,
&
pVnode
)
==
0
)
{
dDebug
(
"qset:%p dnode vread got no message from qset, exiting"
,
tsVReadQset
);
break
;
}
dDebug
(
"%p, msg:%
s will be processed in vread queue, qtype:%d, msg:%p"
,
pReadMsg
->
rpcMsg
.
ahandle
,
taosMsg
[
pRead
Msg
->
rpcMsg
.
msgType
],
qtype
,
pReadMsg
);
dDebug
(
"%p, msg:%
p:%s will be processed in vread queue, qtype:%d"
,
pRead
->
rpcAhandle
,
pRead
,
taosMsg
[
pRead
->
msgType
],
qtype
);
int32_t
code
=
vnodeProcessRead
(
pVnode
,
pRead
Msg
);
int32_t
code
=
vnodeProcessRead
(
pVnode
,
pRead
);
if
(
qtype
==
TAOS_QTYPE_RPC
&&
code
!=
TSDB_CODE_QRY_NOT_READY
)
{
dnodeSendRpcVReadRsp
(
pVnode
,
pRead
Msg
,
code
);
dnodeSendRpcVReadRsp
(
pVnode
,
pRead
,
code
);
}
else
{
if
(
code
==
TSDB_CODE_QRY_HAS_RSP
)
{
dnodeSendRpcVReadRsp
(
pVnode
,
pRead
Msg
,
pReadMsg
->
rpcMsg
.
code
);
dnodeSendRpcVReadRsp
(
pVnode
,
pRead
,
pRead
->
code
);
}
else
{
// code == TSDB_CODE_QRY_NOT_READY, do not return msg to client
assert
(
pRead
Msg
->
rpcMsg
.
handle
==
NULL
||
(
pReadMsg
->
rpcMsg
.
handle
!=
NULL
&&
pReadMsg
->
rpcMsg
.
msgType
==
5
));
dnodeDispatchNonRspMsg
(
pVnode
,
pRead
Msg
,
code
);
assert
(
pRead
->
rpcHandle
==
NULL
||
(
pRead
->
rpcHandle
!=
NULL
&&
pRead
->
msgType
==
5
));
dnodeDispatchNonRspMsg
(
pVnode
,
pRead
,
code
);
}
}
taosFreeQitem
(
pRead
Msg
);
taosFreeQitem
(
pRead
);
}
return
NULL
;
...
...
src/inc/vnode.h
浏览文件 @
c1d7a1a7
...
...
@@ -37,10 +37,15 @@ typedef struct {
}
SRspRet
;
typedef
struct
{
SRspRet
rspRet
;
void
*
pCont
;
int32_t
code
;
int32_t
contLen
;
SRpcMsg
rpcMsg
;
void
*
rpcHandle
;
void
*
rpcAhandle
;
void
*
qhandle
;
int8_t
qtype
;
int8_t
msgType
;
SRspRet
rspRet
;
char
pCont
[];
}
SVReadMsg
;
typedef
struct
{
...
...
@@ -62,13 +67,11 @@ int32_t vnodeAlter(void *pVnode, SCreateVnodeMsg *pVnodeCfg);
int32_t
vnodeClose
(
int32_t
vgId
);
void
*
vnodeAcquire
(
int32_t
vgId
);
// add refcount
void
*
vnodeAcquireRqueue
(
int32_t
vgId
);
// add refCount, get read queue
void
vnodeRelease
(
void
*
pVnode
);
// dec refCount
void
*
vnodeGetWal
(
void
*
pVnode
);
int32_t
vnodeWriteToWQueue
(
void
*
vparam
,
void
*
wparam
,
int32_t
qtype
,
void
*
rparam
);
int32_t
vnodeProcessWrite
(
void
*
vparam
,
void
*
wparam
,
int32_t
qtype
,
void
*
rparam
);
int32_t
vnodeCheckWrite
(
void
*
pVnode
);
int32_t
vnodeGetVnodeList
(
int32_t
vnodeList
[],
int32_t
*
numOfVnodes
);
void
vnodeBuildStatusMsg
(
void
*
param
);
void
vnodeConfirmForward
(
void
*
param
,
uint64_t
version
,
int32_t
code
);
...
...
@@ -77,8 +80,8 @@ void vnodeSetAccess(SVgroupAccess *pAccess, int32_t numOfVnodes);
int32_t
vnodeInitResources
();
void
vnodeCleanupResources
();
int32_t
vnode
ProcessRead
(
void
*
pVnode
,
SVReadMsg
*
pReadMsg
);
int32_t
vnode
CheckRead
(
void
*
pVnode
);
int32_t
vnode
WriteToRQueue
(
void
*
vparam
,
void
*
pCont
,
int32_t
contLen
,
int8_t
qtype
,
void
*
rparam
);
int32_t
vnode
ProcessRead
(
void
*
pVnode
,
SVReadMsg
*
pRead
);
#ifdef __cplusplus
}
...
...
src/vnode/src/vnodeMain.c
浏览文件 @
c1d7a1a7
...
...
@@ -468,21 +468,6 @@ void *vnodeAcquire(int32_t vgId) {
return
*
ppVnode
;
}
void
*
vnodeAcquireRqueue
(
int32_t
vgId
)
{
SVnodeObj
*
pVnode
=
vnodeAcquire
(
vgId
);
if
(
pVnode
==
NULL
)
return
NULL
;
int32_t
code
=
vnodeCheckRead
(
pVnode
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
terrno
=
code
;
vInfo
(
"vgId:%d, can not provide read service, status is %s"
,
vgId
,
vnodeStatus
[
pVnode
->
status
]);
vnodeRelease
(
pVnode
);
return
NULL
;
}
return
pVnode
->
rqueue
;
}
void
*
vnodeGetWal
(
void
*
pVnode
)
{
return
((
SVnodeObj
*
)
pVnode
)
->
wal
;
}
...
...
src/vnode/src/vnodeRead.c
浏览文件 @
c1d7a1a7
...
...
@@ -46,7 +46,7 @@ void vnodeInitReadFp(void) {
//
int32_t
vnodeProcessRead
(
void
*
param
,
SVReadMsg
*
pReadMsg
)
{
SVnodeObj
*
pVnode
=
(
SVnodeObj
*
)
param
;
int
msgType
=
pReadMsg
->
rpcMsg
.
msgType
;
int
32_t
msgType
=
pReadMsg
->
msgType
;
if
(
vnodeProcessReadMsgFp
[
msgType
]
==
NULL
)
{
vDebug
(
"vgId:%d, msgType:%s not processed, no handle"
,
pVnode
->
vgId
,
taosMsg
[
msgType
]);
...
...
@@ -56,7 +56,7 @@ int32_t vnodeProcessRead(void *param, SVReadMsg *pReadMsg) {
return
(
*
vnodeProcessReadMsgFp
[
msgType
])(
pVnode
,
pReadMsg
);
}
int32_t
vnodeCheckRead
(
void
*
param
)
{
static
int32_t
vnodeCheckRead
(
void
*
param
)
{
SVnodeObj
*
pVnode
=
param
;
if
(
pVnode
->
status
!=
TAOS_VN_STATUS_READY
)
{
vDebug
(
"vgId:%d, vnode status is %s, recCount:%d pVnode:%p"
,
pVnode
->
vgId
,
vnodeStatus
[
pVnode
->
status
],
...
...
@@ -78,24 +78,58 @@ int32_t vnodeCheckRead(void *param) {
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
vnodePutItemIntoReadQueue
(
SVnodeObj
*
pVnode
,
void
**
qhandle
,
void
*
ahandle
)
{
int32_t
code
=
vnodeCheckRead
(
pVnode
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
return
code
;
SVReadMsg
*
pRead
=
(
SVReadMsg
*
)
taosAllocateQitem
(
sizeof
(
SVReadMsg
));
pRead
->
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_QUERY
;
pRead
->
pCont
=
qhandle
;
pRead
->
contLen
=
0
;
pRead
->
rpcMsg
.
ahandle
=
ahandle
;
int32_t
vnodeWriteToRQueue
(
void
*
vparam
,
void
*
pCont
,
int32_t
contLen
,
int8_t
qtype
,
void
*
rparam
)
{
SVnodeObj
*
pVnode
=
vparam
;
atomic_add_fetch_32
(
&
pVnode
->
refCount
,
1
);
if
(
qtype
==
TAOS_QTYPE_RPC
||
qtype
==
TAOS_QTYPE_QUERY
)
{
int32_t
code
=
vnodeCheckRead
(
pVnode
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
return
code
;
}
int32_t
size
=
sizeof
(
SVReadMsg
)
+
contLen
;
SVReadMsg
*
pRead
=
taosAllocateQitem
(
size
);
if
(
pRead
==
NULL
)
{
return
TSDB_CODE_VND_OUT_OF_MEMORY
;
}
if
(
rparam
!=
NULL
)
{
SRpcMsg
*
pRpcMsg
=
rparam
;
pRead
->
rpcHandle
=
pRpcMsg
->
handle
;
pRead
->
rpcAhandle
=
pRpcMsg
->
ahandle
;
pRead
->
msgType
=
pRpcMsg
->
msgType
;
pRead
->
code
=
pRpcMsg
->
code
;
}
if
(
contLen
!=
0
)
{
pRead
->
contLen
=
contLen
;
memcpy
(
pRead
->
pCont
,
pCont
,
contLen
);
}
else
{
pRead
->
qhandle
=
pCont
;
}
pRead
->
qtype
=
qtype
;
vDebug
(
"QInfo:%p add to vread queue for exec query, msg:%p"
,
*
qhandle
,
pRead
);
taosWriteQitem
(
pVnode
->
rqueue
,
TAOS_QTYPE_QUERY
,
pRead
);
atomic_add_fetch_32
(
&
pVnode
->
refCount
,
1
);
vTrace
(
"vgId:%d, get vnode rqueue, refCount:%d pVnode:%p"
,
pVnode
->
vgId
,
pVnode
->
refCount
,
pVnode
);
taosWriteQitem
(
pVnode
->
rqueue
,
qtype
,
pRead
);
return
TSDB_CODE_SUCCESS
;
}
static
int32_t
vnodePutItemIntoReadQueue
(
SVnodeObj
*
pVnode
,
void
**
qhandle
,
void
*
ahandle
)
{
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
msgType
=
TSDB_MSG_TYPE_QUERY
;
rpcMsg
.
ahandle
=
ahandle
;
int32_t
code
=
vnodeWriteToRQueue
(
pVnode
,
qhandle
,
0
,
TAOS_QTYPE_QUERY
,
&
rpcMsg
);
if
(
code
==
TSDB_CODE_SUCCESS
)
{
vDebug
(
"QInfo:%p add to vread queue for exec query"
,
*
qhandle
);
}
return
code
;
}
/**
*
* @param pRet response message object
...
...
@@ -155,18 +189,18 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SVReadMsg *pReadMsg) {
memset
(
pRet
,
0
,
sizeof
(
SRspRet
));
// qHandle needs to be freed correctly
if
(
pReadMsg
->
rpcMsg
.
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
)
{
if
(
pReadMsg
->
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
)
{
SRetrieveTableMsg
*
killQueryMsg
=
(
SRetrieveTableMsg
*
)
pReadMsg
->
pCont
;
killQueryMsg
->
free
=
htons
(
killQueryMsg
->
free
);
killQueryMsg
->
qhandle
=
htobe64
(
killQueryMsg
->
qhandle
);
vWarn
(
"QInfo:%p connection %p broken, kill query"
,
(
void
*
)
killQueryMsg
->
qhandle
,
pReadMsg
->
rpc
Msg
.
h
andle
);
assert
(
pReadMsg
->
rpcMsg
.
contLen
>
0
&&
killQueryMsg
->
free
==
1
);
vWarn
(
"QInfo:%p connection %p broken, kill query"
,
(
void
*
)
killQueryMsg
->
qhandle
,
pReadMsg
->
rpc
H
andle
);
assert
(
pReadMsg
->
contLen
>
0
&&
killQueryMsg
->
free
==
1
);
void
**
qhandle
=
qAcquireQInfo
(
pVnode
->
qMgmt
,
(
uint64_t
)
killQueryMsg
->
qhandle
);
if
(
qhandle
==
NULL
||
*
qhandle
==
NULL
)
{
vWarn
(
"QInfo:%p invalid qhandle, no matched query handle, conn:%p"
,
(
void
*
)
killQueryMsg
->
qhandle
,
pReadMsg
->
rpc
Msg
.
h
andle
);
pReadMsg
->
rpc
H
andle
);
}
else
{
assert
(
*
qhandle
==
(
void
*
)
killQueryMsg
->
qhandle
);
...
...
@@ -208,9 +242,9 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SVReadMsg *pReadMsg) {
}
if
(
handle
!=
NULL
&&
vnodeNotifyCurrentQhandle
(
pReadMsg
->
rpc
Msg
.
h
andle
,
*
handle
,
pVnode
->
vgId
)
!=
TSDB_CODE_SUCCESS
)
{
vnodeNotifyCurrentQhandle
(
pReadMsg
->
rpc
H
andle
,
*
handle
,
pVnode
->
vgId
)
!=
TSDB_CODE_SUCCESS
)
{
vError
(
"vgId:%d, QInfo:%p, query discarded since link is broken, %p"
,
pVnode
->
vgId
,
*
handle
,
pReadMsg
->
rpc
Msg
.
h
andle
);
pReadMsg
->
rpc
H
andle
);
pRsp
->
code
=
TSDB_CODE_RPC_NETWORK_UNAVAIL
;
qReleaseQInfo
(
pVnode
->
qMgmt
,
(
void
**
)
&
handle
,
true
);
return
pRsp
->
code
;
...
...
@@ -221,7 +255,7 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SVReadMsg *pReadMsg) {
if
(
handle
!=
NULL
)
{
vDebug
(
"vgId:%d, QInfo:%p, dnode query msg disposed, create qhandle and returns to app"
,
vgId
,
*
handle
);
code
=
vnodePutItemIntoReadQueue
(
pVnode
,
handle
,
pReadMsg
->
rpc
Msg
.
ah
andle
);
code
=
vnodePutItemIntoReadQueue
(
pVnode
,
handle
,
pReadMsg
->
rpc
H
andle
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
pRsp
->
code
=
code
;
qReleaseQInfo
(
pVnode
->
qMgmt
,
(
void
**
)
&
handle
,
true
);
...
...
@@ -230,7 +264,7 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SVReadMsg *pReadMsg) {
}
}
else
{
assert
(
pCont
!=
NULL
);
void
**
qhandle
=
(
void
**
)
p
Cont
;
void
**
qhandle
=
(
void
**
)
p
ReadMsg
->
qhandle
;
vDebug
(
"vgId:%d, QInfo:%p, dnode continues to exec query"
,
pVnode
->
vgId
,
*
qhandle
);
...
...
@@ -242,14 +276,14 @@ static int32_t vnodeProcessQueryMsg(SVnodeObj *pVnode, SVReadMsg *pReadMsg) {
// build query rsp, the retrieve request has reached here already
if
(
buildRes
)
{
// update the connection info according to the retrieve connection
pReadMsg
->
rpc
Msg
.
h
andle
=
qGetResultRetrieveMsg
(
*
qhandle
);
assert
(
pReadMsg
->
rpc
Msg
.
h
andle
!=
NULL
);
pReadMsg
->
rpc
H
andle
=
qGetResultRetrieveMsg
(
*
qhandle
);
assert
(
pReadMsg
->
rpc
H
andle
!=
NULL
);
vDebug
(
"vgId:%d, QInfo:%p, start to build retrieval rsp after query paused, %p"
,
pVnode
->
vgId
,
*
qhandle
,
pReadMsg
->
rpc
Msg
.
h
andle
);
pReadMsg
->
rpc
H
andle
);
// set the real rsp error code
pReadMsg
->
rpcMsg
.
code
=
vnodeDumpQueryResult
(
&
pReadMsg
->
rspRet
,
pVnode
,
qhandle
,
&
freehandle
,
pReadMsg
->
rpcMsg
.
ah
andle
);
pReadMsg
->
code
=
vnodeDumpQueryResult
(
&
pRead
->
rspRet
,
pVnode
,
qhandle
,
&
freehandle
,
pReadMsg
->
rpcH
andle
);
// NOTE: set return code to be TSDB_CODE_QRY_HAS_RSP to notify dnode to return msg to client
code
=
TSDB_CODE_QRY_HAS_RSP
;
...
...
@@ -283,7 +317,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SVReadMsg *pReadMsg) {
pRetrieve
->
qhandle
=
htobe64
(
pRetrieve
->
qhandle
);
vDebug
(
"vgId:%d, QInfo:%p, retrieve msg is disposed, free:%d, conn:%p"
,
pVnode
->
vgId
,
(
void
*
)
pRetrieve
->
qhandle
,
pRetrieve
->
free
,
pReadMsg
->
rpc
Msg
.
h
andle
);
pRetrieve
->
free
,
pReadMsg
->
rpc
H
andle
);
memset
(
pRet
,
0
,
sizeof
(
SRspRet
));
...
...
@@ -314,9 +348,8 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SVReadMsg *pReadMsg) {
}
// register the qhandle to connect to quit query immediate if connection is broken
if
(
vnodeNotifyCurrentQhandle
(
pReadMsg
->
rpcMsg
.
handle
,
*
handle
,
pVnode
->
vgId
)
!=
TSDB_CODE_SUCCESS
)
{
vError
(
"vgId:%d, QInfo:%p, retrieve discarded since link is broken, %p"
,
pVnode
->
vgId
,
*
handle
,
pReadMsg
->
rpcMsg
.
handle
);
if
(
vnodeNotifyCurrentQhandle
(
pReadMsg
->
rpcHandle
,
*
handle
,
pVnode
->
vgId
)
!=
TSDB_CODE_SUCCESS
)
{
vError
(
"vgId:%d, QInfo:%p, retrieve discarded since link is broken, %p"
,
pVnode
->
vgId
,
*
handle
,
pReadMsg
->
rpcHandle
);
code
=
TSDB_CODE_RPC_NETWORK_UNAVAIL
;
qKillQuery
(
*
handle
);
qReleaseQInfo
(
pVnode
->
qMgmt
,
(
void
**
)
&
handle
,
true
);
...
...
@@ -326,7 +359,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SVReadMsg *pReadMsg) {
bool
freeHandle
=
true
;
bool
buildRes
=
false
;
code
=
qRetrieveQueryResultInfo
(
*
handle
,
&
buildRes
,
pReadMsg
->
rpc
Msg
.
h
andle
);
code
=
qRetrieveQueryResultInfo
(
*
handle
,
&
buildRes
,
pReadMsg
->
rpc
H
andle
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
// TODO handle malloc failure
pRet
->
rsp
=
(
SRetrieveTableRsp
*
)
rpcMallocCont
(
sizeof
(
SRetrieveTableRsp
));
...
...
@@ -337,7 +370,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SVReadMsg *pReadMsg) {
assert
(
buildRes
==
true
);
#if _NON_BLOCKING_RETRIEVE
if
(
!
buildRes
)
{
assert
(
pReadMsg
->
rpc
Msg
.
h
andle
!=
NULL
);
assert
(
pReadMsg
->
rpc
H
andle
!=
NULL
);
qReleaseQInfo
(
pVnode
->
qMgmt
,
(
void
**
)
&
handle
,
false
);
return
TSDB_CODE_QRY_NOT_READY
;
...
...
@@ -345,7 +378,7 @@ static int32_t vnodeProcessFetchMsg(SVnodeObj *pVnode, SVReadMsg *pReadMsg) {
#endif
// ahandle is the sqlObj pointer
code
=
vnodeDumpQueryResult
(
pRet
,
pVnode
,
handle
,
&
freeHandle
,
pReadMsg
->
rpc
Msg
.
ah
andle
);
code
=
vnodeDumpQueryResult
(
pRet
,
pVnode
,
handle
,
&
freeHandle
,
pReadMsg
->
rpc
H
andle
);
}
// If qhandle is not added into vread queue, the query should be completed already or paused with error.
...
...
src/vnode/src/vnodeWrite.c
浏览文件 @
c1d7a1a7
...
...
@@ -97,7 +97,7 @@ int32_t vnodeProcessWrite(void *vparam, void *wparam, int32_t qtype, void *rpara
return
syncCode
;
}
int32_t
vnodeCheckWrite
(
void
*
param
)
{
static
int32_t
vnodeCheckWrite
(
void
*
param
)
{
SVnodeObj
*
pVnode
=
param
;
if
(
!
(
pVnode
->
accessState
&
TSDB_VN_WRITE_ACCCESS
))
{
vDebug
(
"vgId:%d, no write auth, recCount:%d pVnode:%p"
,
pVnode
->
vgId
,
pVnode
->
refCount
,
pVnode
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录