Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
76386b9f
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看板
提交
76386b9f
编写于
4月 10, 2023
作者:
K
kailixu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
enh: assign passVer during taos_connect
上级
8c70dca4
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
23 addition
and
9 deletion
+23
-9
include/client/taos.h
include/client/taos.h
+5
-1
include/common/tmsg.h
include/common/tmsg.h
+1
-0
source/client/src/clientHb.c
source/client/src/clientHb.c
+6
-7
source/client/src/clientMsgHandler.c
source/client/src/clientMsgHandler.c
+1
-0
source/common/src/tmsg.c
source/common/src/tmsg.c
+8
-0
source/dnode/mnode/impl/src/mndProfile.c
source/dnode/mnode/impl/src/mndProfile.c
+1
-0
source/dnode/mnode/impl/src/mndUser.c
source/dnode/mnode/impl/src/mndUser.c
+1
-1
未找到文件。
include/client/taos.h
浏览文件 @
76386b9f
...
...
@@ -101,7 +101,7 @@ typedef struct TAOS_FIELD_E {
#endif
typedef
void
(
*
__taos_async_fn_t
)(
void
*
param
,
TAOS_RES
*
res
,
int
code
);
typedef
void
(
*
__taos_notify_fn_t
)(
void
*
param
);
typedef
void
(
*
__taos_notify_fn_t
)(
void
*
param
,
void
*
ext
,
int
type
);
typedef
struct
TAOS_MULTI_BIND
{
int
buffer_type
;
...
...
@@ -122,6 +122,10 @@ typedef enum {
SET_CONF_RET_ERR_TOO_LONG
=
-
6
}
SET_CONF_RET_CODE
;
typedef
enum
{
TAOS_NOTIFY_PASSVER
=
1
,
}
TAOS_NOTIFY_TYPE
;
#define RET_MSG_LENGTH 1024
typedef
struct
setConfRet
{
SET_CONF_RET_CODE
retCode
;
...
...
include/common/tmsg.h
浏览文件 @
76386b9f
...
...
@@ -629,6 +629,7 @@ typedef struct {
int8_t
connType
;
SEpSet
epSet
;
int32_t
svrTimestamp
;
int32_t
passVer
;
char
sVer
[
TSDB_VERSION_LEN
];
char
sDetailVer
[
128
];
}
SConnectRsp
;
...
...
source/client/src/clientHb.c
浏览文件 @
76386b9f
...
...
@@ -54,15 +54,14 @@ static int32_t hbProcessUserPassInfoRsp(void *value, int32_t valueLen, SClientHb
STscObj
*
pTscObj
=
(
STscObj
*
)
acquireTscObj
(
connKey
->
tscRid
);
if
(
NULL
==
pTscObj
)
{
tscWarn
(
"tscObj rid %"
PRIx64
" not exist"
,
connKey
->
tscRid
);
return
TSDB_CODE_SUCCESS
;
return
code
;
}
SUserPassBatchRsp
batchRsp
=
{
0
};
if
(
tDeserializeSUserPassBatchRsp
(
value
,
valueLen
,
&
batchRsp
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
code
=
TSDB_CODE_INVALID_MSG
;
releaseTscObj
(
connKey
->
tscRid
);
assert
(
0
);
return
-
1
;
return
code
;
}
SPassInfo
*
passInfo
=
&
pTscObj
->
passInfo
;
...
...
@@ -70,11 +69,11 @@ static int32_t hbProcessUserPassInfoRsp(void *value, int32_t valueLen, SClientHb
for
(
int32_t
i
=
0
;
i
<
numOfBatchs
;
++
i
)
{
SGetUserPassRsp
*
rsp
=
taosArrayGet
(
batchRsp
.
pArray
,
i
);
if
(
0
==
strncmp
(
rsp
->
user
,
pTscObj
->
user
,
TSDB_USER_LEN
))
{
tsc
Error
(
"update user:%s passVer
from %d to %d"
,
rsp
->
user
,
passInfo
->
ver
,
rsp
->
version
);
tsc
Debug
(
"update passVer of user %s
from %d to %d"
,
rsp
->
user
,
passInfo
->
ver
,
rsp
->
version
);
if
(
atomic_load_32
(
&
passInfo
->
ver
)
<
rsp
->
version
)
{
atomic_store_32
(
&
passInfo
->
ver
,
rsp
->
version
);
if
(
passInfo
->
fp
)
{
(
*
passInfo
->
fp
)(
NULL
);
(
*
passInfo
->
fp
)(
&
pTscObj
->
id
,
NULL
,
TAOS_NOTIFY_PASSVER
);
}
}
}
...
...
@@ -82,7 +81,7 @@ static int32_t hbProcessUserPassInfoRsp(void *value, int32_t valueLen, SClientHb
taosArrayDestroy
(
batchRsp
.
pArray
);
releaseTscObj
(
connKey
->
tscRid
);
return
TSDB_CODE_SUCCESS
;
return
code
;
}
static
int32_t
hbGenerateVgInfoFromRsp
(
SDBVgInfo
**
pInfo
,
SUseDbRsp
*
rsp
)
{
...
...
source/client/src/clientMsgHandler.c
浏览文件 @
76386b9f
...
...
@@ -130,6 +130,7 @@ int32_t processConnectRsp(void* param, SDataBuf* pMsg, int32_t code) {
lastClusterId
=
connectRsp
.
clusterId
;
pTscObj
->
connType
=
connectRsp
.
connType
;
pTscObj
->
passInfo
.
ver
=
connectRsp
.
passVer
;
hbRegisterConn
(
pTscObj
->
pAppInfo
->
pAppHbMgr
,
pTscObj
->
id
,
connectRsp
.
clusterId
,
connectRsp
.
connType
);
...
...
source/common/src/tmsg.c
浏览文件 @
76386b9f
...
...
@@ -3874,6 +3874,7 @@ int32_t tSerializeSConnectRsp(void *buf, int32_t bufLen, SConnectRsp *pRsp) {
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
svrTimestamp
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pRsp
->
sVer
)
<
0
)
return
-
1
;
if
(
tEncodeCStr
(
&
encoder
,
pRsp
->
sDetailVer
)
<
0
)
return
-
1
;
if
(
tEncodeI32
(
&
encoder
,
pRsp
->
passVer
)
<
0
)
return
-
1
;
tEndEncode
(
&
encoder
);
int32_t
tlen
=
encoder
.
pos
;
...
...
@@ -3897,6 +3898,13 @@ int32_t tDeserializeSConnectRsp(void *buf, int32_t bufLen, SConnectRsp *pRsp) {
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
svrTimestamp
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pRsp
->
sVer
)
<
0
)
return
-
1
;
if
(
tDecodeCStrTo
(
&
decoder
,
pRsp
->
sDetailVer
)
<
0
)
return
-
1
;
if
(
!
tDecodeIsEnd
(
&
decoder
))
{
if
(
tDecodeI32
(
&
decoder
,
&
pRsp
->
passVer
)
<
0
)
return
-
1
;
}
else
{
pRsp
->
passVer
=
0
;
}
tEndDecode
(
&
decoder
);
tDecoderClear
(
&
decoder
);
...
...
source/dnode/mnode/impl/src/mndProfile.c
浏览文件 @
76386b9f
...
...
@@ -283,6 +283,7 @@ static int32_t mndProcessConnectReq(SRpcMsg *pReq) {
connectRsp
.
connType
=
connReq
.
connType
;
connectRsp
.
dnodeNum
=
mndGetDnodeSize
(
pMnode
);
connectRsp
.
svrTimestamp
=
taosGetTimestampSec
();
connectRsp
.
passVer
=
pUser
->
passVersion
;
strcpy
(
connectRsp
.
sVer
,
version
);
snprintf
(
connectRsp
.
sDetailVer
,
sizeof
(
connectRsp
.
sDetailVer
),
"ver:%s
\n
build:%s
\n
gitinfo:%s"
,
version
,
buildinfo
,
...
...
source/dnode/mnode/impl/src/mndUser.c
浏览文件 @
76386b9f
...
...
@@ -1042,7 +1042,7 @@ int32_t mndValidateUserPassInfo(SMnode *pMnode, SUserPassVersion *pUsers, int32_
pUsers
[
i
].
version
=
ntohl
(
pUsers
[
i
].
version
);
if
(
pUser
->
passVersion
<=
pUsers
[
i
].
version
)
{
m
Debug
(
"user:%s, not update since mnd passVer %d <= client passVer %d"
,
pUsers
[
i
].
user
,
pUser
->
passVersion
,
m
Trace
(
"user:%s, not update since mnd passVer %d <= client passVer %d"
,
pUsers
[
i
].
user
,
pUser
->
passVersion
,
pUsers
[
i
].
version
);
mndReleaseUser
(
pMnode
,
pUser
);
continue
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录