Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
46d21aac
T
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
46d21aac
编写于
4月 03, 2022
作者:
dengyihao
提交者:
GitHub
4月 03, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11235 from taosdata/feature/indexUpdate
Feature/index update
上级
a06a605e
ac82b91e
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
34 addition
and
22 deletion
+34
-22
source/libs/transport/src/transSrv.c
source/libs/transport/src/transSrv.c
+3
-1
source/libs/transport/test/rclient.c
source/libs/transport/test/rclient.c
+25
-20
source/libs/transport/test/rserver.c
source/libs/transport/test/rserver.c
+6
-1
未找到文件。
source/libs/transport/src/transSrv.c
浏览文件 @
46d21aac
...
...
@@ -193,6 +193,7 @@ static void uvHandleReq(SSrvConn* pConn) {
transMsg
.
ahandle
=
(
void
*
)
pHead
->
ahandle
;
transMsg
.
handle
=
NULL
;
// transDestroyBuffer(&pConn->readBuf);
transClearBuffer
(
&
pConn
->
readBuf
);
pConn
->
inType
=
pHead
->
msgType
;
if
(
pConn
->
status
==
ConnNormal
)
{
...
...
@@ -249,6 +250,7 @@ void uvOnRecvCb(uv_stream_t* cli, ssize_t nread, const uv_buf_t* buf) {
conn
->
broken
=
true
;
if
(
conn
->
status
==
ConnAcquire
)
{
if
(
conn
->
regArg
.
init
)
{
tTrace
(
"server conn %p broken, notify server app"
,
conn
);
STrans
*
pTransInst
=
conn
->
pTransInst
;
(
*
pTransInst
->
cfp
)(
pTransInst
->
parent
,
&
(
conn
->
regArg
.
msg
),
NULL
);
memset
(
&
conn
->
regArg
,
0
,
sizeof
(
conn
->
regArg
));
...
...
@@ -270,7 +272,7 @@ void uvOnTimeoutCb(uv_timer_t* handle) {
void
uvOnSendCb
(
uv_write_t
*
req
,
int
status
)
{
SSrvConn
*
conn
=
req
->
data
;
transClearBuffer
(
&
conn
->
readBuf
);
//
transClearBuffer(&conn->readBuf);
if
(
status
==
0
)
{
tTrace
(
"server conn %p data already was written on stream"
,
conn
);
if
(
!
transQueueEmpty
(
&
conn
->
srvMsgs
))
{
...
...
source/libs/transport/test/rclient.c
浏览文件 @
46d21aac
...
...
@@ -23,20 +23,20 @@
#include "tutil.h"
typedef
struct
{
int
index
;
SEpSet
epSet
;
int
num
;
int
numOfReqs
;
int
msgSize
;
tsem_t
rspSem
;
tsem_t
*
pOverSem
;
int
index
;
SEpSet
epSet
;
int
num
;
int
numOfReqs
;
int
msgSize
;
tsem_t
rspSem
;
tsem_t
*
pOverSem
;
TdThread
thread
;
void
*
pRpc
;
void
*
pRpc
;
}
SInfo
;
static
void
processResponse
(
void
*
pParent
,
SRpcMsg
*
pMsg
,
SEpSet
*
pEpSet
)
{
SInfo
*
pInfo
=
(
SInfo
*
)
pMsg
->
ahandle
;
tDebug
(
"thread:%d, response is received, type:%d contLen:%d code:0x%x"
,
pInfo
->
index
,
pMsg
->
msgType
,
pMsg
->
contLen
,
pMsg
->
code
);
// tError
("thread:%d, response is received, type:%d contLen:%d code:0x%x", pInfo->index, pMsg->msgType, pMsg->contLen,
//
pMsg->code);
if
(
pEpSet
)
pInfo
->
epSet
=
*
pEpSet
;
...
...
@@ -51,9 +51,9 @@ static void *sendRequest(void *param) {
SInfo
*
pInfo
=
(
SInfo
*
)
param
;
SRpcMsg
rpcMsg
=
{
0
};
t
Debug
(
"thread:%d, start to send request"
,
pInfo
->
index
);
t
Error
(
"thread:%d, start to send request"
,
pInfo
->
index
);
t
Debug
(
"thread:%d, reqs: %d"
,
pInfo
->
index
,
pInfo
->
numOfReqs
);
t
Error
(
"thread:%d, reqs: %d"
,
pInfo
->
index
,
pInfo
->
numOfReqs
);
int
u100
=
0
;
int
u500
=
0
;
int
u1000
=
0
;
...
...
@@ -68,7 +68,7 @@ static void *sendRequest(void *param) {
// tDebug("thread:%d, send request, contLen:%d num:%d", pInfo->index, pInfo->msgSize, pInfo->num);
int64_t
start
=
taosGetTimestampUs
();
rpcSendRequest
(
pInfo
->
pRpc
,
&
pInfo
->
epSet
,
&
rpcMsg
,
NULL
);
if
(
pInfo
->
num
%
20000
==
0
)
t
Info
(
"thread:%d, %d requests have been sent"
,
pInfo
->
index
,
pInfo
->
num
);
if
(
pInfo
->
num
%
20000
==
0
)
t
Error
(
"thread:%d, %d requests have been sent"
,
pInfo
->
index
,
pInfo
->
num
);
// tsem_wait(&pInfo->rspSem);
tsem_wait
(
&
pInfo
->
rspSem
);
int64_t
end
=
taosGetTimestampUs
()
-
start
;
...
...
@@ -88,7 +88,7 @@ static void *sendRequest(void *param) {
}
tError
(
"send and recv sum: %d, %d, %d, %d"
,
u100
,
u500
,
u1000
,
u10000
);
t
Debug
(
"thread:%d, it is over"
,
pInfo
->
index
);
t
Error
(
"thread:%d, it is over"
,
pInfo
->
index
);
tcount
++
;
return
NULL
;
...
...
@@ -104,7 +104,7 @@ int main(int argc, char *argv[]) {
char
secret
[
20
]
=
"mypassword"
;
struct
timeval
systemTime
;
int64_t
startTime
,
endTime
;
TdThreadAttr
thattr
;
TdThreadAttr
thattr
;
// server info
epSet
.
inUse
=
0
;
...
...
@@ -124,7 +124,7 @@ int main(int argc, char *argv[]) {
rpcInit
.
ckey
=
"key"
;
rpcInit
.
spi
=
1
;
rpcInit
.
connType
=
TAOS_CONN_CLIENT
;
rpcDebugFlag
=
1
43
;
rpcDebugFlag
=
1
31
;
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
strcmp
(
argv
[
i
],
"-p"
)
==
0
&&
i
<
argc
-
1
)
{
...
...
@@ -170,6 +170,10 @@ int main(int argc, char *argv[]) {
}
}
const
char
*
path
=
"/tmp/transport/client"
;
taosRemoveDir
(
path
);
taosMkDir
(
path
);
tstrncpy
(
tsLogDir
,
path
,
PATH_MAX
);
taosInitLog
(
"client.log"
,
10
);
void
*
pRpc
=
rpcOpen
(
&
rpcInit
);
...
...
@@ -178,8 +182,8 @@ int main(int argc, char *argv[]) {
return
-
1
;
}
t
Info
(
"client is initialized"
);
t
Info
(
"threads:%d msgSize:%d requests:%d"
,
appThreads
,
msgSize
,
numOfReqs
);
t
Error
(
"client is initialized"
);
t
Error
(
"threads:%d msgSize:%d requests:%d"
,
appThreads
,
msgSize
,
numOfReqs
);
taosGetTimeOfDay
(
&
systemTime
);
startTime
=
systemTime
.
tv_sec
*
1000000
+
systemTime
.
tv_usec
;
...
...
@@ -208,8 +212,9 @@ int main(int argc, char *argv[]) {
endTime
=
systemTime
.
tv_sec
*
1000000
+
systemTime
.
tv_usec
;
float
usedTime
=
(
endTime
-
startTime
)
/
1000
.
0
f
;
// mseconds
tInfo
(
"it takes %.3f mseconds to send %d requests to server"
,
usedTime
,
numOfReqs
*
appThreads
);
tInfo
(
"Performance: %.3f requests per second, msgSize:%d bytes"
,
1000
.
0
*
numOfReqs
*
appThreads
/
usedTime
,
msgSize
);
tError
(
"it takes %.3f mseconds to send %d requests to server"
,
usedTime
,
numOfReqs
*
appThreads
);
tError
(
"Performance: %.3f requests per second, msgSize:%d bytes"
,
1000
.
0
*
numOfReqs
*
appThreads
/
usedTime
,
msgSize
);
int
ch
=
getchar
();
UNUSED
(
ch
);
...
...
source/libs/transport/test/rserver.c
浏览文件 @
46d21aac
...
...
@@ -125,7 +125,7 @@ int main(int argc, char *argv[]) {
rpcInit
.
idleTime
=
2
*
1500
;
rpcInit
.
afp
=
retrieveAuthInfo
;
rpcDebugFlag
=
1
43
;
rpcDebugFlag
=
1
31
;
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
strcmp
(
argv
[
i
],
"-p"
)
==
0
&&
i
<
argc
-
1
)
{
...
...
@@ -160,6 +160,11 @@ int main(int argc, char *argv[]) {
tsAsyncLog
=
0
;
rpcInit
.
connType
=
TAOS_CONN_SERVER
;
const
char
*
path
=
"/tmp/transport/server"
;
taosRemoveDir
(
path
);
taosMkDir
(
path
);
tstrncpy
(
tsLogDir
,
path
,
PATH_MAX
);
taosInitLog
(
"server.log"
,
10
);
void
*
pRpc
=
rpcOpen
(
&
rpcInit
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录