Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
fc3fe9df
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看板
提交
fc3fe9df
编写于
6月 28, 2023
作者:
S
slzhou
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: remove connect to mnode
上级
2f9c8417
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
60 deletion
+0
-60
source/dnode/mnode/impl/src/mndProfile.c
source/dnode/mnode/impl/src/mndProfile.c
+0
-5
source/libs/function/src/udfd.c
source/libs/function/src/udfd.c
+0
-55
未找到文件。
source/dnode/mnode/impl/src/mndProfile.c
浏览文件 @
fc3fe9df
...
...
@@ -243,11 +243,6 @@ static int32_t mndProcessConnectReq(SRpcMsg *pReq) {
mGError
(
"user:%s, failed to login from %s while acquire user since %s"
,
pReq
->
info
.
conn
.
user
,
ip
,
terrstr
());
goto
_OVER
;
}
// if connection is from udfd, no user/password/db check
if
(
strcmp
(
connReq
.
app
,
"udfd"
)
==
0
)
{
goto
_CONNECT
;
}
if
(
strncmp
(
connReq
.
passwd
,
pUser
->
pass
,
TSDB_PASSWORD_LEN
-
1
)
!=
0
)
{
mGError
(
"user:%s, failed to login from %s since invalid pass, input:%s"
,
pReq
->
info
.
conn
.
user
,
ip
,
connReq
.
passwd
);
...
...
source/libs/function/src/udfd.c
浏览文件 @
fc3fe9df
...
...
@@ -965,41 +965,6 @@ int32_t udfdFillUdfInfoFromMNode(void *clientRpc, char *udfName, SUdf *udf) {
return
code
;
}
int32_t
udfdConnectToMnode
()
{
SConnectReq
connReq
=
{
0
};
connReq
.
connType
=
CONN_TYPE__UDFD
;
tstrncpy
(
connReq
.
app
,
"udfd"
,
sizeof
(
connReq
.
app
));
tstrncpy
(
connReq
.
user
,
TSDB_DEFAULT_USER
,
sizeof
(
connReq
.
user
));
// just use default password. this password is not checked by mnode since connection is from udfd
char
pass
[
TSDB_PASSWORD_LEN
+
1
]
=
{
0
};
taosEncryptPass_c
((
uint8_t
*
)(
TSDB_DEFAULT_PASS
),
strlen
(
TSDB_DEFAULT_PASS
),
pass
);
tstrncpy
(
connReq
.
passwd
,
pass
,
sizeof
(
connReq
.
passwd
));
connReq
.
pid
=
taosGetPId
();
connReq
.
startTime
=
taosGetTimestampMs
();
strcpy
(
connReq
.
sVer
,
version
);
int32_t
contLen
=
tSerializeSConnectReq
(
NULL
,
0
,
&
connReq
);
void
*
pReq
=
rpcMallocCont
(
contLen
);
tSerializeSConnectReq
(
pReq
,
contLen
,
&
connReq
);
SUdfdRpcSendRecvInfo
*
msgInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SUdfdRpcSendRecvInfo
));
msgInfo
->
rpcType
=
UDFD_RPC_MNODE_CONNECT
;
uv_sem_init
(
&
msgInfo
->
resultSem
,
0
);
SRpcMsg
rpcMsg
=
{
0
};
rpcMsg
.
msgType
=
TDMT_MND_CONNECT
;
rpcMsg
.
pCont
=
pReq
;
rpcMsg
.
contLen
=
contLen
;
rpcMsg
.
info
.
ahandle
=
msgInfo
;
rpcSendRequest
(
global
.
clientRpc
,
&
global
.
mgmtEp
.
epSet
,
&
rpcMsg
,
NULL
);
uv_sem_wait
(
&
msgInfo
->
resultSem
);
int32_t
code
=
msgInfo
->
code
;
uv_sem_destroy
(
&
msgInfo
->
resultSem
);
taosMemoryFree
(
msgInfo
);
return
code
;
}
static
bool
udfdRpcRfp
(
int32_t
code
,
tmsg_t
msgType
)
{
if
(
code
==
TSDB_CODE_RPC_NETWORK_UNAVAIL
||
code
==
TSDB_CODE_RPC_BROKEN_LINK
||
code
==
TSDB_CODE_SYN_NOT_LEADER
||
code
==
TSDB_CODE_RPC_SOMENODE_NOT_CONNECTED
||
code
==
TSDB_CODE_SYN_RESTORING
||
...
...
@@ -1379,23 +1344,6 @@ static int32_t udfdRun() {
return
0
;
}
void
udfdConnectMnodeThreadFunc
(
void
*
args
)
{
int32_t
retryMnodeTimes
=
0
;
int32_t
code
=
0
;
while
(
retryMnodeTimes
++
<=
TSDB_MAX_REPLICA
)
{
uv_sleep
(
100
*
(
1
<<
retryMnodeTimes
));
code
=
udfdConnectToMnode
();
if
(
code
==
0
)
{
break
;
}
fnError
(
"udfd can not connect to mnode, code: %s. retry"
,
tstrerror
(
code
));
}
if
(
code
!=
0
)
{
fnError
(
"udfd can not connect to mnode"
);
}
}
int32_t
udfdInitResidentFuncs
()
{
if
(
strlen
(
tsUdfdResFuncs
)
==
0
)
{
return
TSDB_CODE_SUCCESS
;
...
...
@@ -1498,9 +1446,6 @@ int main(int argc, char *argv[]) {
udfdInitResidentFuncs
();
uv_thread_t
mnodeConnectThread
;
uv_thread_create
(
&
mnodeConnectThread
,
udfdConnectMnodeThreadFunc
,
NULL
);
udfdRun
();
removeListeningPipe
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录