Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6c141398
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6c141398
编写于
3月 05, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'feature/3_liaohj' of github.com:taosdata/tdengine into feature/3_liaohj
上级
22a85734
42ba45e6
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
45 addition
and
26 deletion
+45
-26
include/common/tmsg.h
include/common/tmsg.h
+14
-5
source/client/src/clientEnv.c
source/client/src/clientEnv.c
+2
-2
source/common/src/tglobal.c
source/common/src/tglobal.c
+1
-1
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+28
-18
未找到文件。
include/common/tmsg.h
浏览文件 @
6c141398
...
@@ -66,6 +66,15 @@ extern int32_t tMsgDict[];
...
@@ -66,6 +66,15 @@ extern int32_t tMsgDict[];
typedef
uint16_t
tmsg_t
;
typedef
uint16_t
tmsg_t
;
static
inline
bool
tmsgIsValid
(
tmsg_t
type
)
{
if
(
type
<
TDMT_DND_MAX_MSG
||
type
<
TDMT_MND_MAX_MSG
||
type
<
TDMT_VND_MAX_MSG
||
type
<
TDMT_SCH_MAX_MSG
||
type
<
TDMT_STREAM_MAX_MSG
||
type
<
TDMT_MON_MAX_MSG
||
type
<
TDMT_SYNC_MAX_MSG
||
type
<
TDMT_VND_STREAM_MSG
||
type
<
TDMT_VND_TMQ_MSG
||
type
<
TDMT_VND_TMQ_MAX_MSG
)
{
return
true
;
}
else
{
return
false
;
}
}
static
inline
bool
vnodeIsMsgBlock
(
tmsg_t
type
)
{
static
inline
bool
vnodeIsMsgBlock
(
tmsg_t
type
)
{
return
(
type
==
TDMT_VND_CREATE_TABLE
)
||
(
type
==
TDMT_VND_ALTER_TABLE
)
||
(
type
==
TDMT_VND_DROP_TABLE
)
||
return
(
type
==
TDMT_VND_CREATE_TABLE
)
||
(
type
==
TDMT_VND_ALTER_TABLE
)
||
(
type
==
TDMT_VND_DROP_TABLE
)
||
(
type
==
TDMT_VND_UPDATE_TAG_VAL
)
||
(
type
==
TDMT_VND_ALTER_CONFIRM
);
(
type
==
TDMT_VND_UPDATE_TAG_VAL
)
||
(
type
==
TDMT_VND_ALTER_CONFIRM
);
...
@@ -2691,7 +2700,7 @@ typedef struct {
...
@@ -2691,7 +2700,7 @@ typedef struct {
char
subKey
[
TSDB_SUBSCRIBE_KEY_LEN
];
char
subKey
[
TSDB_SUBSCRIBE_KEY_LEN
];
int8_t
subType
;
int8_t
subType
;
int8_t
withMeta
;
int8_t
withMeta
;
char
*
qmsg
;
//
SubPlanToString
char
*
qmsg
;
//
SubPlanToString
int64_t
suid
;
int64_t
suid
;
}
SMqRebVgReq
;
}
SMqRebVgReq
;
...
...
source/client/src/clientEnv.c
浏览文件 @
6c141398
...
@@ -159,9 +159,9 @@ void *openTransporter(const char *user, const char *auth, int32_t numOfThread) {
...
@@ -159,9 +159,9 @@ void *openTransporter(const char *user, const char *auth, int32_t numOfThread) {
rpcInit
.
retryMaxInterval
=
tsRedirectMaxPeriod
;
rpcInit
.
retryMaxInterval
=
tsRedirectMaxPeriod
;
rpcInit
.
retryMaxTimouet
=
tsMaxRetryWaitTime
;
rpcInit
.
retryMaxTimouet
=
tsMaxRetryWaitTime
;
int32_t
connLimitNum
=
tsNumOfRpcSessions
/
(
tsNumOfRpcThreads
*
5
);
int32_t
connLimitNum
=
tsNumOfRpcSessions
/
(
tsNumOfRpcThreads
*
3
);
connLimitNum
=
TMAX
(
connLimitNum
,
10
);
connLimitNum
=
TMAX
(
connLimitNum
,
10
);
connLimitNum
=
TMIN
(
connLimitNum
,
5
00
);
connLimitNum
=
TMIN
(
connLimitNum
,
10
00
);
rpcInit
.
connLimitNum
=
connLimitNum
;
rpcInit
.
connLimitNum
=
connLimitNum
;
rpcInit
.
timeToGetConn
=
tsTimeToGetAvailableConn
;
rpcInit
.
timeToGetConn
=
tsTimeToGetAvailableConn
;
...
...
source/common/src/tglobal.c
浏览文件 @
6c141398
...
@@ -41,7 +41,7 @@ bool tsPrintAuth = false;
...
@@ -41,7 +41,7 @@ bool tsPrintAuth = false;
// queue & threads
// queue & threads
int32_t
tsNumOfRpcThreads
=
1
;
int32_t
tsNumOfRpcThreads
=
1
;
int32_t
tsNumOfRpcSessions
=
6
000
;
int32_t
tsNumOfRpcSessions
=
10
000
;
int32_t
tsTimeToGetAvailableConn
=
500000
;
int32_t
tsTimeToGetAvailableConn
=
500000
;
int32_t
tsNumOfCommitThreads
=
2
;
int32_t
tsNumOfCommitThreads
=
2
;
int32_t
tsNumOfTaskQueueThreads
=
4
;
int32_t
tsNumOfTaskQueueThreads
=
4
;
...
...
source/libs/transport/src/transCli.c
浏览文件 @
6c141398
...
@@ -692,6 +692,7 @@ static SCliConn* getConnFromPool2(SCliThrd* pThrd, char* key, SCliMsg** pMsg) {
...
@@ -692,6 +692,7 @@ static SCliConn* getConnFromPool2(SCliThrd* pThrd, char* key, SCliMsg** pMsg) {
}
}
list
->
numOfConn
++
;
list
->
numOfConn
++
;
}
}
tTrace
(
"%s numOfConn: %d, limit: %d"
,
pTransInst
->
label
,
list
->
numOfConn
,
pTransInst
->
connLimitNum
);
return
NULL
;
return
NULL
;
}
}
...
@@ -803,7 +804,6 @@ static int32_t specifyConnRef(SCliConn* conn, bool update, int64_t handle) {
...
@@ -803,7 +804,6 @@ static int32_t specifyConnRef(SCliConn* conn, bool update, int64_t handle) {
static
void
cliAllocRecvBufferCb
(
uv_handle_t
*
handle
,
size_t
suggested_size
,
uv_buf_t
*
buf
)
{
static
void
cliAllocRecvBufferCb
(
uv_handle_t
*
handle
,
size_t
suggested_size
,
uv_buf_t
*
buf
)
{
SCliConn
*
conn
=
handle
->
data
;
SCliConn
*
conn
=
handle
->
data
;
SConnBuffer
*
pBuf
=
&
conn
->
readBuf
;
SConnBuffer
*
pBuf
=
&
conn
->
readBuf
;
tTrace
(
"%s conn %p alloc read buf"
,
CONN_GET_INST_LABEL
(
conn
),
conn
);
transAllocBuffer
(
pBuf
,
buf
);
transAllocBuffer
(
pBuf
,
buf
);
}
}
static
void
cliRecvCb
(
uv_stream_t
*
handle
,
ssize_t
nread
,
const
uv_buf_t
*
buf
)
{
static
void
cliRecvCb
(
uv_stream_t
*
handle
,
ssize_t
nread
,
const
uv_buf_t
*
buf
)
{
...
@@ -877,7 +877,7 @@ static SCliConn* cliCreateConn(SCliThrd* pThrd) {
...
@@ -877,7 +877,7 @@ static SCliConn* cliCreateConn(SCliThrd* pThrd) {
static
void
cliDestroyConn
(
SCliConn
*
conn
,
bool
clear
)
{
static
void
cliDestroyConn
(
SCliConn
*
conn
,
bool
clear
)
{
SCliThrd
*
pThrd
=
conn
->
hostThrd
;
SCliThrd
*
pThrd
=
conn
->
hostThrd
;
tTrace
(
"%s conn %p remove from conn pool"
,
CONN_GET_INST_LABEL
(
conn
),
conn
);
tTrace
(
"%s conn %p remove from conn pool"
,
CONN_GET_INST_LABEL
(
conn
),
conn
);
conn
->
broken
=
true
;
QUEUE_REMOVE
(
&
conn
->
q
);
QUEUE_REMOVE
(
&
conn
->
q
);
QUEUE_INIT
(
&
conn
->
q
);
QUEUE_INIT
(
&
conn
->
q
);
...
@@ -1115,19 +1115,18 @@ void cliSend(SCliConn* pConn) {
...
@@ -1115,19 +1115,18 @@ void cliSend(SCliConn* pConn) {
msgLen
=
(
int32_t
)
ntohl
((
uint32_t
)(
pHead
->
msgLen
));
msgLen
=
(
int32_t
)
ntohl
((
uint32_t
)(
pHead
->
msgLen
));
}
}
if
((
pHead
->
msgType
>
TDMT_VND_TMQ_MSG
&&
pHead
->
msgType
<
TDMT_VND_TMQ_MAX_MSG
)
||
// if (tmsgIsValid(pHead->msgType)) {
(
pHead
->
msgType
>
TDMT_MND_MSG
&&
pHead
->
msgType
<
TDMT_MND_MAX_MSG
))
{
// char buf[128] = {0};
char
buf
[
128
]
=
{
0
};
// sprintf(buf, "%s", TMSG_INFO(pHead->msgType));
sprintf
(
buf
,
"%s"
,
TMSG_INFO
(
pHead
->
msgType
));
// int* count = taosHashGet(pThrd->msgCount, buf, sizeof(buf));
int
*
count
=
taosHashGet
(
pThrd
->
msgCount
,
buf
,
sizeof
(
buf
));
// if (NULL == 0) {
if
(
NULL
==
0
)
{
// int localCount = 1;
int
localCount
=
1
;
// taosHashPut(pThrd->msgCount, buf, sizeof(buf), &localCount, sizeof(localCount));
taosHashPut
(
pThrd
->
msgCount
,
buf
,
sizeof
(
buf
),
&
localCount
,
sizeof
(
localCount
));
// } else {
}
else
{
// int localCount = *count + 1;
int
localCount
=
*
count
+
1
;
// taosHashPut(pThrd->msgCount, buf, sizeof(buf), &localCount, sizeof(localCount));
taosHashPut
(
pThrd
->
msgCount
,
buf
,
sizeof
(
buf
),
&
localCount
,
sizeof
(
localCount
));
// }
}
// }
}
tGDebug
(
"%s conn %p %s is sent to %s, local info %s, len:%d"
,
CONN_GET_INST_LABEL
(
pConn
),
pConn
,
tGDebug
(
"%s conn %p %s is sent to %s, local info %s, len:%d"
,
CONN_GET_INST_LABEL
(
pConn
),
pConn
,
TMSG_INFO
(
pHead
->
msgType
),
pConn
->
dst
,
pConn
->
src
,
msgLen
);
TMSG_INFO
(
pHead
->
msgType
),
pConn
->
dst
,
pConn
->
src
,
msgLen
);
...
@@ -1262,7 +1261,7 @@ static void cliSendBatchCb(uv_write_t* req, int status) {
...
@@ -1262,7 +1261,7 @@ static void cliSendBatchCb(uv_write_t* req, int status) {
}
else
{
}
else
{
tDebug
(
"%s conn %p succ to send batch msg, batch size:%d, msgLen:%d"
,
CONN_GET_INST_LABEL
(
conn
),
conn
,
p
->
wLen
,
tDebug
(
"%s conn %p succ to send batch msg, batch size:%d, msgLen:%d"
,
CONN_GET_INST_LABEL
(
conn
),
conn
,
p
->
wLen
,
p
->
batchSize
);
p
->
batchSize
);
if
(
!
uv_is_closing
((
uv_handle_t
*
)
&
conn
->
stream
))
{
if
(
!
uv_is_closing
((
uv_handle_t
*
)
&
conn
->
stream
)
&&
conn
->
broken
==
false
)
{
if
(
nxtBatch
!=
NULL
)
{
if
(
nxtBatch
!=
NULL
)
{
conn
->
pBatch
=
nxtBatch
;
conn
->
pBatch
=
nxtBatch
;
cliSendBatch
(
conn
);
cliSendBatch
(
conn
);
...
@@ -1523,6 +1522,18 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
...
@@ -1523,6 +1522,18 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
destroyCmsg
(
pMsg
);
destroyCmsg
(
pMsg
);
return
;
return
;
}
}
if
(
tmsgIsValid
(
pMsg
->
msg
.
msgType
))
{
char
buf
[
128
]
=
{
0
};
sprintf
(
buf
,
"%s"
,
TMSG_INFO
(
pMsg
->
msg
.
msgType
));
int
*
count
=
taosHashGet
(
pThrd
->
msgCount
,
buf
,
sizeof
(
buf
));
if
(
NULL
==
0
)
{
int
localCount
=
1
;
taosHashPut
(
pThrd
->
msgCount
,
buf
,
sizeof
(
buf
),
&
localCount
,
sizeof
(
localCount
));
}
else
{
int
localCount
=
*
count
+
1
;
taosHashPut
(
pThrd
->
msgCount
,
buf
,
sizeof
(
buf
),
&
localCount
,
sizeof
(
localCount
));
}
}
char
*
fqdn
=
EPSET_GET_INUSE_IP
(
&
pMsg
->
ctx
->
epSet
);
char
*
fqdn
=
EPSET_GET_INUSE_IP
(
&
pMsg
->
ctx
->
epSet
);
uint16_t
port
=
EPSET_GET_INUSE_PORT
(
&
pMsg
->
ctx
->
epSet
);
uint16_t
port
=
EPSET_GET_INUSE_PORT
(
&
pMsg
->
ctx
->
epSet
);
...
@@ -2365,8 +2376,7 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
...
@@ -2365,8 +2376,7 @@ int cliAppCb(SCliConn* pConn, STransMsg* pResp, SCliMsg* pMsg) {
}
}
}
}
if
((
pResp
->
msgType
-
1
>
TDMT_VND_TMQ_MSG
&&
pResp
->
msgType
-
1
<
TDMT_VND_TMQ_MAX_MSG
)
||
if
(
tmsgIsValid
(
pResp
->
msgType
-
1
))
{
(
pResp
->
msgType
-
1
>
TDMT_MND_MSG
&&
pResp
->
msgType
-
1
<
TDMT_MND_MAX_MSG
))
{
char
buf
[
128
]
=
{
0
};
char
buf
[
128
]
=
{
0
};
sprintf
(
buf
,
"%s"
,
TMSG_INFO
(
pResp
->
msgType
-
1
));
sprintf
(
buf
,
"%s"
,
TMSG_INFO
(
pResp
->
msgType
-
1
));
int
*
count
=
taosHashGet
(
pThrd
->
msgCount
,
buf
,
sizeof
(
buf
));
int
*
count
=
taosHashGet
(
pThrd
->
msgCount
,
buf
,
sizeof
(
buf
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录