Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
~笨蛋陪你哭
TDengine
提交
236c4654
T
TDengine
项目概览
~笨蛋陪你哭
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
236c4654
编写于
1月 22, 2021
作者:
Y
yihaoDeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix case failure
上级
a1b81053
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
15 deletion
+18
-15
src/client/inc/tsclient.h
src/client/inc/tsclient.h
+2
-2
src/client/src/tscServer.c
src/client/src/tscServer.c
+3
-3
src/client/src/tscSql.c
src/client/src/tscSql.c
+11
-1
src/client/src/tscSystem.c
src/client/src/tscSystem.c
+1
-9
src/client/src/tscUtil.c
src/client/src/tscUtil.c
+1
-0
未找到文件。
src/client/inc/tsclient.h
浏览文件 @
236c4654
...
...
@@ -299,7 +299,6 @@ typedef struct {
typedef
struct
{
char
key
[
512
];
SRpcCorEpSet
*
tscCorMgmtEpSet
;
void
*
pDnodeConn
;
}
SRpcObj
;
...
...
@@ -319,6 +318,7 @@ typedef struct STscObj {
struct
SSqlObj
*
sqlList
;
struct
SSqlStream
*
streamList
;
SRpcObj
*
pRpcObj
;
SRpcCorEpSet
*
tscCorMgmtEpSet
;
pthread_mutex_t
mutex
;
int32_t
numOfObj
;
// number of sqlObj from this tscObj
}
STscObj
;
...
...
@@ -396,7 +396,7 @@ typedef struct SSqlStream {
void
tscSetStreamDestTable
(
SSqlStream
*
pStream
,
const
char
*
dstTable
);
int
tscAcquireRpc
(
const
char
*
key
,
const
char
*
user
,
const
char
*
secret
,
SRpcCorEpSet
*
corMgmtEpSet
,
void
**
pRpcObj
);
int
tscAcquireRpc
(
const
char
*
key
,
const
char
*
user
,
const
char
*
secret
,
void
**
pRpcObj
);
void
tscReleaseRpc
(
void
*
param
);
void
tscInitMsgsFp
();
...
...
src/client/src/tscServer.c
浏览文件 @
236c4654
...
...
@@ -69,7 +69,7 @@ static void tscSetDnodeEpSet(SRpcEpSet* pEpSet, SVgroupInfo* pVgroupInfo) {
}
static
void
tscDumpMgmtEpSet
(
SSqlObj
*
pSql
)
{
SRpcCorEpSet
*
pCorEpSet
=
pSql
->
pTscObj
->
pRpcObj
->
tscCorMgmtEpSet
;
SRpcCorEpSet
*
pCorEpSet
=
pSql
->
pTscObj
->
tscCorMgmtEpSet
;
taosCorBeginRead
(
&
pCorEpSet
->
version
);
pSql
->
epSet
=
pCorEpSet
->
epSet
;
taosCorEndRead
(
&
pCorEpSet
->
version
);
...
...
@@ -94,7 +94,7 @@ bool tscEpSetIsEqual(SRpcEpSet *s1, SRpcEpSet *s2) {
void
tscUpdateMgmtEpSet
(
SSqlObj
*
pSql
,
SRpcEpSet
*
pEpSet
)
{
// no need to update if equal
SRpcCorEpSet
*
pCorEpSet
=
pSql
->
pTscObj
->
pRpcObj
->
tscCorMgmtEpSet
;
SRpcCorEpSet
*
pCorEpSet
=
pSql
->
pTscObj
->
tscCorMgmtEpSet
;
taosCorBeginWrite
(
&
pCorEpSet
->
version
);
pCorEpSet
->
epSet
=
*
pEpSet
;
taosCorEndWrite
(
&
pCorEpSet
->
version
);
...
...
@@ -158,7 +158,7 @@ void tscProcessHeartBeatRsp(void *param, TAOS_RES *tres, int code) {
if
(
epSet
->
numOfEps
>
0
)
{
tscEpSetHtons
(
epSet
);
//SRpcCorEpSet *pCorEpSet = pSql->pTscObj->
pRpcObj->
tscCorMgmtEpSet;
//SRpcCorEpSet *pCorEpSet = pSql->pTscObj->tscCorMgmtEpSet;
//if (!tscEpSetIsEqual(&pCorEpSet->epSet, epSet)) {
// tscTrace("%p updating epset: numOfEps: %d, inUse: %d", pSql, epSet->numOfEps, epSet->inUse);
// for (int8_t i = 0; i < epSet->numOfEps; i++) {
...
...
src/client/src/tscSql.c
浏览文件 @
236c4654
...
...
@@ -94,7 +94,7 @@ static SSqlObj *taosConnectImpl(const char *ip, const char *user, const char *pa
snprintf
(
rpcKey
,
sizeof
(
rpcKey
),
"%s:%s:%s:%d"
,
user
,
pass
,
ip
,
port
);
void
*
pRpcObj
=
NULL
;
if
(
tscAcquireRpc
(
rpcKey
,
user
,
secretEncrypt
,
&
corMgmtEpSet
,
&
pRpcObj
)
!=
0
)
{
if
(
tscAcquireRpc
(
rpcKey
,
user
,
secretEncrypt
,
&
pRpcObj
)
!=
0
)
{
terrno
=
TSDB_CODE_RPC_NETWORK_UNAVAIL
;
return
NULL
;
}
...
...
@@ -105,6 +105,16 @@ static SSqlObj *taosConnectImpl(const char *ip, const char *user, const char *pa
tscReleaseRpc
(
pRpcObj
);
return
NULL
;
}
pObj
->
tscCorMgmtEpSet
=
malloc
(
sizeof
(
SRpcCorEpSet
));
if
(
pObj
->
tscCorMgmtEpSet
==
NULL
)
{
terrno
=
TSDB_CODE_TSC_OUT_OF_MEMORY
;
tscReleaseRpc
(
pRpcObj
);
free
(
pObj
);
return
NULL
;
}
memcpy
(
pObj
->
tscCorMgmtEpSet
,
&
corMgmtEpSet
,
sizeof
(
corMgmtEpSet
));
pObj
->
signature
=
pObj
;
pObj
->
pRpcObj
=
(
SRpcObj
*
)
pRpcObj
;
tstrncpy
(
pObj
->
user
,
user
,
sizeof
(
pObj
->
user
));
...
...
src/client/src/tscSystem.c
浏览文件 @
236c4654
...
...
@@ -58,7 +58,6 @@ void tscFreeRpcObj(void *param) {
SRpcObj
*
pRpcObj
=
(
SRpcObj
*
)(
param
);
tscDebug
(
"free rpcObj:%p and free pDnodeConn: %p"
,
pRpcObj
,
pRpcObj
->
pDnodeConn
);
rpcClose
(
pRpcObj
->
pDnodeConn
);
tfree
(
pRpcObj
->
tscCorMgmtEpSet
);
}
void
tscReleaseRpc
(
void
*
param
)
{
...
...
@@ -70,7 +69,7 @@ void tscReleaseRpc(void *param) {
pthread_mutex_unlock
(
&
rpcObjMutex
);
}
int32_t
tscAcquireRpc
(
const
char
*
key
,
const
char
*
user
,
const
char
*
secretEncrypt
,
SRpcCorEpSet
*
corMgmtEpSet
,
void
**
ppRpcObj
)
{
int32_t
tscAcquireRpc
(
const
char
*
key
,
const
char
*
user
,
const
char
*
secretEncrypt
,
void
**
ppRpcObj
)
{
pthread_mutex_lock
(
&
rpcObjMutex
);
SRpcObj
*
pRpcObj
=
(
SRpcObj
*
)
taosCacheAcquireByKey
(
tscRpcCache
,
key
,
strlen
(
key
));
...
...
@@ -109,13 +108,6 @@ int32_t tscAcquireRpc(const char *key, const char *user, const char *secretEncry
pthread_mutex_unlock
(
&
rpcObjMutex
);
return
-
1
;
}
pRpcObj
->
tscCorMgmtEpSet
=
malloc
(
sizeof
(
SRpcCorEpSet
));
if
(
pRpcObj
->
tscCorMgmtEpSet
==
NULL
)
{
rpcClose
(
rpcObj
.
pDnodeConn
);
pthread_mutex_unlock
(
&
rpcObjMutex
);
return
-
1
;
}
memcpy
(
pRpcObj
->
tscCorMgmtEpSet
,
corMgmtEpSet
,
sizeof
(
*
corMgmtEpSet
));
*
ppRpcObj
=
pRpcObj
;
pthread_mutex_unlock
(
&
rpcObjMutex
);
...
...
src/client/src/tscUtil.c
浏览文件 @
236c4654
...
...
@@ -897,6 +897,7 @@ void tscCloseTscObj(void *param) {
pObj
->
signature
=
NULL
;
taosTmrStopA
(
&
(
pObj
->
pTimer
));
tfree
(
pObj
->
tscCorMgmtEpSet
);
tscReleaseRpc
(
pObj
->
pRpcObj
);
pthread_mutex_destroy
(
&
pObj
->
mutex
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录