Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
96257226
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看板
提交
96257226
编写于
7月 25, 2022
作者:
A
Alex Duan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(rpc): add global config and broken link method
上级
f3134e5a
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
58 addition
and
23 deletion
+58
-23
src/client/src/tscServer.c
src/client/src/tscServer.c
+25
-7
src/common/inc/tglobal.h
src/common/inc/tglobal.h
+4
-0
src/common/src/tglobal.c
src/common/src/tglobal.c
+27
-0
src/dnode/inc/dnodeVRead.h
src/dnode/inc/dnodeVRead.h
+0
-2
src/dnode/src/dnodeShell.c
src/dnode/src/dnodeShell.c
+0
-2
src/dnode/src/dnodeVRead.c
src/dnode/src/dnodeVRead.c
+1
-11
src/util/inc/tconfig.h
src/util/inc/tconfig.h
+1
-1
未找到文件。
src/client/src/tscServer.c
浏览文件 @
96257226
...
...
@@ -283,16 +283,34 @@ void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) {
// pSql connection link is broken
bool
dealConnBroken
(
SSqlObj
*
pSql
)
{
// TODO
// check valid
if
(
pSql
==
NULL
||
pSql
->
signature
!=
pSql
)
{
return
false
;
}
if
(
pSql
->
cmd
.
command
>=
TSDB_SQL_LOCAL
)
{
return
false
;
}
// cancel
if
(
pSql
->
rpcRid
>
0
)
{
tscDebug
(
"PROBE 0x%"
PRIx64
" rpc cancel request rpcRid=0x%"
PRIx64
"."
,
pSql
->
self
,
pSql
->
rpcRid
);
rpcCancelRequest
(
pSql
->
rpcRid
);
pSql
->
rpcRid
=
-
1
;
}
// error
tscDebug
(
"PROBE 0x%"
PRIx64
" async result error."
,
pSql
->
self
);
tscAsyncResultOnError
(
pSql
);
return
true
;
}
// if return true, send probe connection msg to sever ok
bool
sendProbeConnMsg
(
SSqlObj
*
pSql
)
{
// check time out
int32_t
probeTimeout
=
1
*
1000
;
// over this value send probe msg
int32_t
killTimeout
=
3
*
60
*
1000
;
// over this value query can be killed
// TEST TODO DELETE
tsProbeSeconds
=
1
;
// over this value send probe msg
tsProbeKillSeconds
=
3
*
60
;
// over this value query can be killed
if
(
pSql
->
stime
==
0
)
{
// not start , no need probe
return
true
;
...
...
@@ -300,12 +318,12 @@ bool sendProbeConnMsg(SSqlObj* pSql) {
int64_t
stime
=
MAX
(
pSql
->
stime
,
pSql
->
lastAlive
);
int32_t
diff
=
(
int32_t
)(
taosGetTimestampMs
()
-
stime
);
if
(
diff
<
probeTimeout
)
{
if
(
diff
<
tsProbeSeconds
*
1000
)
{
// exec time short , need not probe alive
return
true
;
}
if
(
diff
>
killTimeout
)
{
if
(
diff
>
tsProbeKillSeconds
*
1000
)
{
// need kill query
tscDebug
(
"PROBE 0x%"
PRIx64
" need killed, noAckCnt:%d diff=%d"
,
pSql
->
self
,
pSql
->
noAckCnt
,
diff
);
//return false;
...
...
@@ -529,7 +547,7 @@ void tscProcessMsgFromServer(SRpcMsg *rpcMsg, SRpcEpSet *pEpSet) {
if
(
rpcMsg
->
msgType
==
TSDB_MSG_TYPE_PROBE_CONN_RSP
)
{
pSql
->
noAckCnt
=
0
;
pSql
->
lastAlive
=
taosGetTimestampMs
();
tsc
Info
(
" recv sql probe msg. sql=%s"
,
pSql
->
sqlstr
);
tsc
Debug
(
" PROBE %p recv probe msg. sql=%s"
,
pSql
->
self
,
pSql
->
sqlstr
);
return
;
}
...
...
src/common/inc/tglobal.h
浏览文件 @
96257226
...
...
@@ -218,6 +218,10 @@ extern int32_t debugFlag;
extern
int8_t
tsClientMerge
;
// probe alive connection
extern
int32_t
tsProbeSeconds
;
extern
int32_t
tsProbeKillSeconds
;
#ifdef TD_TSZ
// lossy
extern
char
lossyColumns
[];
...
...
src/common/src/tglobal.c
浏览文件 @
96257226
...
...
@@ -268,6 +268,11 @@ int32_t fsDebugFlag = 135;
int8_t
tsClientMerge
=
0
;
// probe alive connection
int32_t
tsProbeSeconds
=
10
*
60
;
// start probe link alive after tsProbeSeconds from starting query
int32_t
tsProbeKillSeconds
=
30
*
60
;
// start kill query after tsProbeKillSeconds from starting query
#ifdef TD_TSZ
//
// lossy compress 6
...
...
@@ -1733,6 +1738,28 @@ static void doInitGlobalConfig(void) {
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
// probeSeconds
cfg
.
option
=
"probeSeconds"
;
cfg
.
ptr
=
&
tsProbeSeconds
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
|
TSDB_CFG_CTYPE_B_CLIENT
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
0
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
// probeKillSeconds
cfg
.
option
=
"probeKillSeconds"
;
cfg
.
ptr
=
&
tsProbeKillSeconds
;
cfg
.
valType
=
TAOS_CFG_VTYPE_INT32
;
cfg
.
cfgType
=
TSDB_CFG_CTYPE_B_CONFIG
|
TSDB_CFG_CTYPE_B_SHOW
|
TSDB_CFG_CTYPE_B_CLIENT
;
cfg
.
minValue
=
0
;
cfg
.
maxValue
=
0
;
cfg
.
ptrLength
=
0
;
cfg
.
unitType
=
TAOS_CFG_UTYPE_NONE
;
taosInitConfigOption
(
cfg
);
#ifdef TD_TSZ
// lossy compress
cfg
.
option
=
"lossyColumns"
;
...
...
src/dnode/inc/dnodeVRead.h
浏览文件 @
96257226
...
...
@@ -28,8 +28,6 @@ void * dnodeAllocVQueryQueue(void *pVnode);
void
*
dnodeAllocVFetchQueue
(
void
*
pVnode
);
void
dnodeFreeVQueryQueue
(
void
*
pQqueue
);
void
dnodeFreeVFetchQueue
(
void
*
pFqueue
);
// reponse probe connection msg
void
dnodeResponseProbeMsg
(
SRpcMsg
*
pMsg
);
...
...
src/dnode/src/dnodeShell.c
浏览文件 @
96257226
...
...
@@ -78,8 +78,6 @@ int32_t dnodeInitShell() {
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_NETWORK_TEST
]
=
dnodeSendStartupStep
;
dnodeProcessShellMsgFp
[
TSDB_MSG_TYPE_PROBE_CONN
]
=
dnodeResponseProbeMsg
;
int32_t
numOfThreads
=
(
int32_t
)((
tsNumOfCores
*
tsNumOfThreadsPerCore
)
/
2
.
0
);
if
(
numOfThreads
<
1
)
{
numOfThreads
=
1
;
...
...
src/dnode/src/dnodeVRead.c
浏览文件 @
96257226
...
...
@@ -155,14 +155,4 @@ static void *dnodeProcessReadQueue(void *wparam) {
}
return
NULL
;
}
// reponse probe connection msg
void
dnodeResponseProbeMsg
(
SRpcMsg
*
pMsg
)
{
// check probe conn msg
if
(
pMsg
->
msgType
==
TSDB_MSG_TYPE_PROBE_CONN
)
{
SRpcMsg
rpcRsp
=
{.
handle
=
pMsg
->
handle
,
.
code
=
0
,
.
msgType
=
TSDB_MSG_TYPE_PROBE_CONN_RSP
};
rpcSendResponse
(
&
rpcRsp
);
return
;
}
}
}
\ No newline at end of file
src/util/inc/tconfig.h
浏览文件 @
96257226
...
...
@@ -20,7 +20,7 @@
extern
"C"
{
#endif
#define TSDB_CFG_MAX_NUM 13
1
#define TSDB_CFG_MAX_NUM 13
3
#define TSDB_CFG_PRINT_LEN 23
#define TSDB_CFG_OPTION_LEN 24
#define TSDB_CFG_VALUE_LEN 41
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录