Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9ce9d215
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
9ce9d215
编写于
12月 06, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
support fail fast
上级
4be19649
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
5 deletion
+16
-5
source/dnode/mgmt/node_mgmt/src/dmTransport.c
source/dnode/mgmt/node_mgmt/src/dmTransport.c
+9
-0
source/libs/transport/src/transCli.c
source/libs/transport/src/transCli.c
+5
-3
source/os/src/osTime.c
source/os/src/osTime.c
+1
-1
source/util/src/tlog.c
source/util/src/tlog.c
+1
-1
未找到文件。
source/dnode/mgmt/node_mgmt/src/dmTransport.c
浏览文件 @
9ce9d215
...
...
@@ -48,6 +48,11 @@ int32_t dmProcessNodeMsg(SMgmtWrapper *pWrapper, SRpcMsg *pMsg) {
return
(
*
msgFp
)(
pWrapper
->
pMgmt
,
pMsg
);
}
static
bool
dmFailFastFp
(
tmsg_t
msgType
)
{
// add more msg type later
return
msgType
==
TDMT_SYNC_HEARTBEAT
;
}
static
void
dmProcessRpcMsg
(
SDnode
*
pDnode
,
SRpcMsg
*
pRpc
,
SEpSet
*
pEpSet
)
{
SDnodeTrans
*
pTrans
=
&
pDnode
->
trans
;
int32_t
code
=
-
1
;
...
...
@@ -260,6 +265,10 @@ int32_t dmInitClient(SDnode *pDnode) {
rpcInit
.
retryMaxInterval
=
tsRedirectMaxPeriod
;
rpcInit
.
retryMaxTimouet
=
tsMaxRetryWaitTime
;
rpcInit
.
failFastInterval
=
1000
;
// interval threshold(ms)
rpcInit
.
failFastThreshold
=
3
;
// failed threshold
rpcInit
.
ffp
=
dmFailFastFp
;
pTrans
->
clientRpc
=
rpcOpen
(
&
rpcInit
);
if
(
pTrans
->
clientRpc
==
NULL
)
{
dError
(
"failed to init dnode rpc client"
);
...
...
source/libs/transport/src/transCli.c
浏览文件 @
9ce9d215
...
...
@@ -886,7 +886,8 @@ void cliConnCb(uv_connect_t* req, int status) {
tError
(
"%s conn %p failed to connect to %s:%d, reason:%s"
,
CONN_GET_INST_LABEL
(
pConn
),
pConn
,
pConn
->
ip
,
pConn
->
port
,
uv_strerror
(
status
));
SCliMsg
*
pMsg
=
transQueueGet
(
&
pConn
->
cliMsgs
,
0
);
if
(
REQUEST_NO_RESP
(
&
pMsg
->
msg
))
{
STrans
*
pTransInst
=
pThrd
->
pTransInst
;
if
(
REQUEST_NO_RESP
(
&
pMsg
->
msg
)
&&
(
pTransInst
->
failFastFp
!=
NULL
&&
pTransInst
->
failFastFp
(
pMsg
->
msg
.
msgType
)))
{
char
*
ip
=
pConn
->
ip
;
uint32_t
port
=
pConn
->
port
;
char
key
[
TSDB_FQDN_LEN
+
64
]
=
{
0
};
...
...
@@ -895,7 +896,7 @@ void cliConnCb(uv_connect_t* req, int status) {
SFailFastItem
*
item
=
taosHashGet
(
pThrd
->
failFastCache
,
key
,
strlen
(
key
));
int64_t
cTimestamp
=
taosGetTimestampMs
();
if
(
item
!=
NULL
)
{
if
(
cTimestamp
-
item
->
timestamp
<
((
STrans
*
)
pThrd
->
pTransInst
)
->
failFastInterval
)
{
if
(
cTimestamp
-
item
->
timestamp
<
pTransInst
->
failFastInterval
)
{
item
->
count
++
;
}
else
{
item
->
count
=
1
;
...
...
@@ -1057,7 +1058,7 @@ void cliHandleReq(SCliMsg* pMsg, SCliThrd* pThrd) {
return
;
}
if
(
REQUEST_NO_RESP
(
&
pMsg
->
msg
))
{
if
(
REQUEST_NO_RESP
(
&
pMsg
->
msg
)
&&
(
pTransInst
->
failFastFp
!=
NULL
&&
pTransInst
->
failFastFp
(
pMsg
->
msg
.
msgType
))
)
{
char
*
ip
=
EPSET_GET_INUSE_IP
(
&
pCtx
->
epSet
);
uint32_t
port
=
EPSET_GET_INUSE_PORT
(
&
pCtx
->
epSet
);
char
key
[
TSDB_FQDN_LEN
+
64
]
=
{
0
};
...
...
@@ -1376,6 +1377,7 @@ static void destroyThrdObj(SCliThrd* pThrd) {
taosMemoryFree
(
pThrd
->
prepare
);
taosMemoryFree
(
pThrd
->
loop
);
taosHashCleanup
(
pThrd
->
fqdn2ipCache
);
taosHashCleanup
(
pThrd
->
failFastCache
);
taosMemoryFree
(
pThrd
);
}
...
...
source/os/src/osTime.c
浏览文件 @
9ce9d215
...
...
@@ -572,7 +572,7 @@ int32_t taosClockGetTime(int clock_id, struct timespec *pTS) {
offsetInitFinished
=
true
;
}
else
{
while
(
!
offsetInitFinished
)
;
// Ensure initialization is completed.
;
// Ensure initialization is completed.
}
GetSystemTimeAsFileTime
(
&
f
);
...
...
source/util/src/tlog.c
浏览文件 @
9ce9d215
...
...
@@ -496,7 +496,7 @@ void taosPrintLongString(const char *flags, ELogLevel level, int32_t dflag, cons
if
(
!
osLogSpaceAvailable
())
return
;
if
(
!
(
dflag
&
DEBUG_FILE
)
&&
!
(
dflag
&
DEBUG_SCREEN
))
return
;
char
*
buffer
=
taosMemoryMalloc
(
LOG_MAX_LINE_DUMP_BUFFER_SIZE
);
char
*
buffer
=
taosMemoryMalloc
(
LOG_MAX_LINE_DUMP_BUFFER_SIZE
);
int32_t
len
=
taosBuildLogHead
(
buffer
,
flags
);
va_list
argpointer
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录