Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
de5a5152
T
TDengine
项目概览
taosdata
/
TDengine
接近 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
de5a5152
编写于
8月 17, 2022
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(query): add TBOOL type
上级
e99f512e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
9 deletion
+16
-9
src/client/src/tscServer.c
src/client/src/tscServer.c
+1
-1
src/inc/taos.h
src/inc/taos.h
+6
-0
src/inc/trpc.h
src/inc/trpc.h
+1
-1
src/rpc/src/rpcMain.c
src/rpc/src/rpcMain.c
+8
-7
未找到文件。
src/client/src/tscServer.c
浏览文件 @
de5a5152
...
@@ -460,7 +460,7 @@ int tscSendMsgToServer(SSqlObj *pSql) {
...
@@ -460,7 +460,7 @@ int tscSendMsgToServer(SSqlObj *pSql) {
}
}
if
(
rpcSendRequest
(
pObj
->
pRpcObj
->
pDnodeConn
,
&
pSql
->
epSet
,
&
rpcMsg
,
&
pSql
->
rpcRid
))
{
if
(
rpcSendRequest
(
pObj
->
pRpcObj
->
pDnodeConn
,
&
pSql
->
epSet
,
&
rpcMsg
,
&
pSql
->
rpcRid
)
!=
BOOL_FALSE
)
{
if
(
pSql
->
cmd
.
command
==
TSDB_SQL_SELECT
)
if
(
pSql
->
cmd
.
command
==
TSDB_SQL_SELECT
)
rpcSaveSendInfo
(
pSql
->
rpcRid
,
&
pSql
->
pPrevContext
);
rpcSaveSendInfo
(
pSql
->
rpcRid
,
&
pSql
->
pPrevContext
);
return
TSDB_CODE_SUCCESS
;
return
TSDB_CODE_SUCCESS
;
...
...
src/inc/taos.h
浏览文件 @
de5a5152
...
@@ -48,6 +48,12 @@ typedef void **TAOS_ROW;
...
@@ -48,6 +48,12 @@ typedef void **TAOS_ROW;
#define TSDB_DATA_TYPE_UBIGINT 14 // 8 bytes
#define TSDB_DATA_TYPE_UBIGINT 14 // 8 bytes
#define TSDB_DATA_TYPE_JSON 15 // json string
#define TSDB_DATA_TYPE_JSON 15 // json string
typedef
enum
{
BOOL_FALSE
=
0
,
BOOL_TRUE
=
1
,
BOOL_ASYNC
=
2
//request is processed by async for another thread, not now true or false
}
TBOOL
;
typedef
enum
{
typedef
enum
{
TSDB_OPTION_LOCALE
,
TSDB_OPTION_LOCALE
,
TSDB_OPTION_CHARSET
,
TSDB_OPTION_CHARSET
,
...
...
src/inc/trpc.h
浏览文件 @
de5a5152
...
@@ -85,7 +85,7 @@ void rpcClose(void *);
...
@@ -85,7 +85,7 @@ void rpcClose(void *);
void
*
rpcMallocCont
(
int
contLen
);
void
*
rpcMallocCont
(
int
contLen
);
void
rpcFreeCont
(
void
*
pCont
);
void
rpcFreeCont
(
void
*
pCont
);
void
*
rpcReallocCont
(
void
*
ptr
,
int
contLen
);
void
*
rpcReallocCont
(
void
*
ptr
,
int
contLen
);
bool
rpcSendRequest
(
void
*
thandle
,
const
SRpcEpSet
*
pEpSet
,
SRpcMsg
*
pMsg
,
int64_t
*
rid
);
TBOOL
rpcSendRequest
(
void
*
thandle
,
const
SRpcEpSet
*
pEpSet
,
SRpcMsg
*
pMsg
,
int64_t
*
rid
);
void
rpcSendResponse
(
const
SRpcMsg
*
pMsg
);
void
rpcSendResponse
(
const
SRpcMsg
*
pMsg
);
void
rpcSendRedirectRsp
(
void
*
pConn
,
const
SRpcEpSet
*
pEpSet
);
void
rpcSendRedirectRsp
(
void
*
pConn
,
const
SRpcEpSet
*
pEpSet
);
int
rpcGetConnInfo
(
void
*
thandle
,
SRpcConnInfo
*
pInfo
);
int
rpcGetConnInfo
(
void
*
thandle
,
SRpcConnInfo
*
pInfo
);
...
...
src/rpc/src/rpcMain.c
浏览文件 @
de5a5152
...
@@ -202,7 +202,7 @@ static SRpcConn *rpcAllocateClientConn(SRpcInfo *pRpc);
...
@@ -202,7 +202,7 @@ static SRpcConn *rpcAllocateClientConn(SRpcInfo *pRpc);
static
SRpcConn
*
rpcAllocateServerConn
(
SRpcInfo
*
pRpc
,
SRecvInfo
*
pRecv
);
static
SRpcConn
*
rpcAllocateServerConn
(
SRpcInfo
*
pRpc
,
SRecvInfo
*
pRecv
);
static
SRpcConn
*
rpcGetConnObj
(
SRpcInfo
*
pRpc
,
int
sid
,
SRecvInfo
*
pRecv
);
static
SRpcConn
*
rpcGetConnObj
(
SRpcInfo
*
pRpc
,
int
sid
,
SRecvInfo
*
pRecv
);
static
bool
rpcSendReqToServer
(
SRpcInfo
*
pRpc
,
SRpcReqContext
*
pContext
);
static
TBOOL
rpcSendReqToServer
(
SRpcInfo
*
pRpc
,
SRpcReqContext
*
pContext
);
static
void
rpcSendQuickRsp
(
SRpcConn
*
pConn
,
int32_t
code
);
static
void
rpcSendQuickRsp
(
SRpcConn
*
pConn
,
int32_t
code
);
static
void
rpcSendErrorMsgToPeer
(
SRecvInfo
*
pRecv
,
int32_t
code
);
static
void
rpcSendErrorMsgToPeer
(
SRecvInfo
*
pRecv
,
int32_t
code
);
static
bool
rpcSendMsgToPeer
(
SRpcConn
*
pConn
,
void
*
data
,
int
dataLen
);
static
bool
rpcSendMsgToPeer
(
SRpcConn
*
pConn
,
void
*
data
,
int
dataLen
);
...
@@ -394,7 +394,7 @@ void *rpcReallocCont(void *ptr, int contLen) {
...
@@ -394,7 +394,7 @@ void *rpcReallocCont(void *ptr, int contLen) {
return
start
+
sizeof
(
SRpcReqContext
)
+
sizeof
(
SRpcHead
);
return
start
+
sizeof
(
SRpcReqContext
)
+
sizeof
(
SRpcHead
);
}
}
bool
rpcSendRequest
(
void
*
shandle
,
const
SRpcEpSet
*
pEpSet
,
SRpcMsg
*
pMsg
,
int64_t
*
pRid
)
{
TBOOL
rpcSendRequest
(
void
*
shandle
,
const
SRpcEpSet
*
pEpSet
,
SRpcMsg
*
pMsg
,
int64_t
*
pRid
)
{
SRpcInfo
*
pRpc
=
(
SRpcInfo
*
)
shandle
;
SRpcInfo
*
pRpc
=
(
SRpcInfo
*
)
shandle
;
SRpcReqContext
*
pContext
;
SRpcReqContext
*
pContext
;
...
@@ -1384,7 +1384,7 @@ static void rpcSendErrorMsgToPeer(SRecvInfo *pRecv, int32_t code) {
...
@@ -1384,7 +1384,7 @@ static void rpcSendErrorMsgToPeer(SRecvInfo *pRecv, int32_t code) {
return
;
return
;
}
}
static
bool
rpcSendReqToServer
(
SRpcInfo
*
pRpc
,
SRpcReqContext
*
pContext
)
{
static
TBOOL
rpcSendReqToServer
(
SRpcInfo
*
pRpc
,
SRpcReqContext
*
pContext
)
{
SRpcHead
*
pHead
=
rpcHeadFromCont
(
pContext
->
pCont
);
SRpcHead
*
pHead
=
rpcHeadFromCont
(
pContext
->
pCont
);
char
*
msg
=
(
char
*
)
pHead
;
char
*
msg
=
(
char
*
)
pHead
;
int
msgLen
=
rpcMsgLenFromCont
(
pContext
->
contLen
);
int
msgLen
=
rpcMsgLenFromCont
(
pContext
->
contLen
);
...
@@ -1394,8 +1394,9 @@ static bool rpcSendReqToServer(SRpcInfo *pRpc, SRpcReqContext *pContext) {
...
@@ -1394,8 +1394,9 @@ static bool rpcSendReqToServer(SRpcInfo *pRpc, SRpcReqContext *pContext) {
SRpcConn
*
pConn
=
rpcSetupConnToServer
(
pContext
);
SRpcConn
*
pConn
=
rpcSetupConnToServer
(
pContext
);
if
(
pConn
==
NULL
)
{
if
(
pConn
==
NULL
)
{
pContext
->
code
=
terrno
;
pContext
->
code
=
terrno
;
// in rpcProcessConnError if numOfTry over limit, could call rpcNotifyClient to stop query
taosTmrStart
(
rpcProcessConnError
,
1
,
pContext
,
pRpc
->
tmrCtrl
);
taosTmrStart
(
rpcProcessConnError
,
1
,
pContext
,
pRpc
->
tmrCtrl
);
return
false
;
return
BOOL_ASYNC
;
}
}
pContext
->
pConn
=
pConn
;
pContext
->
pConn
=
pConn
;
...
@@ -1436,7 +1437,7 @@ static bool rpcSendReqToServer(SRpcInfo *pRpc, SRpcReqContext *pContext) {
...
@@ -1436,7 +1437,7 @@ static bool rpcSendReqToServer(SRpcInfo *pRpc, SRpcReqContext *pContext) {
taosTmrReset
(
rpcProcessRetryTimer
,
tsRpcTimer
,
pConn
,
pRpc
->
tmrCtrl
,
&
pConn
->
pTimer
);
taosTmrReset
(
rpcProcessRetryTimer
,
tsRpcTimer
,
pConn
,
pRpc
->
tmrCtrl
,
&
pConn
->
pTimer
);
rpcUnlockConn
(
pConn
);
rpcUnlockConn
(
pConn
);
return
ret
;
return
ret
?
BOOL_TRUE
:
BOOL_FALSE
;
}
}
static
bool
rpcSendMsgToPeer
(
SRpcConn
*
pConn
,
void
*
msg
,
int
msgLen
)
{
static
bool
rpcSendMsgToPeer
(
SRpcConn
*
pConn
,
void
*
msg
,
int
msgLen
)
{
...
@@ -1478,8 +1479,6 @@ static void rpcProcessConnError(void *param, void *id) {
...
@@ -1478,8 +1479,6 @@ static void rpcProcessConnError(void *param, void *id) {
return
;
return
;
}
}
tDebug
(
"%s %p, connection error happens"
,
pRpc
->
label
,
pContext
->
ahandle
);
if
(
pContext
->
numOfTry
>=
pContext
->
epSet
.
numOfEps
||
pContext
->
msgType
==
TSDB_MSG_TYPE_FETCH
)
{
if
(
pContext
->
numOfTry
>=
pContext
->
epSet
.
numOfEps
||
pContext
->
msgType
==
TSDB_MSG_TYPE_FETCH
)
{
rpcMsg
.
msgType
=
pContext
->
msgType
+
1
;
rpcMsg
.
msgType
=
pContext
->
msgType
+
1
;
rpcMsg
.
ahandle
=
pContext
->
ahandle
;
rpcMsg
.
ahandle
=
pContext
->
ahandle
;
...
@@ -1487,9 +1486,11 @@ static void rpcProcessConnError(void *param, void *id) {
...
@@ -1487,9 +1486,11 @@ static void rpcProcessConnError(void *param, void *id) {
rpcMsg
.
pCont
=
NULL
;
rpcMsg
.
pCont
=
NULL
;
rpcMsg
.
contLen
=
0
;
rpcMsg
.
contLen
=
0
;
tWarn
(
"%s %p, connection error. notify client query over. numOfTry=%d msgType=%d"
,
pRpc
->
label
,
pContext
->
ahandle
,
pContext
->
numOfTry
,
pContext
->
msgType
);
rpcNotifyClient
(
pContext
,
&
rpcMsg
);
rpcNotifyClient
(
pContext
,
&
rpcMsg
);
}
else
{
}
else
{
// move to next IP
// move to next IP
tWarn
(
"%s %p, connection error. retry to send request again. numOfTry=%d msgType=%d"
,
pRpc
->
label
,
pContext
->
ahandle
,
pContext
->
numOfTry
,
pContext
->
msgType
);
pContext
->
epSet
.
inUse
++
;
pContext
->
epSet
.
inUse
++
;
pContext
->
epSet
.
inUse
=
pContext
->
epSet
.
inUse
%
pContext
->
epSet
.
numOfEps
;
pContext
->
epSet
.
inUse
=
pContext
->
epSet
.
inUse
%
pContext
->
epSet
.
numOfEps
;
rpcSendReqToServer
(
pRpc
,
pContext
);
rpcSendReqToServer
(
pRpc
,
pContext
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录