Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
6d593fe8
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
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看板
提交
6d593fe8
编写于
4月 10, 2021
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[td-3571]<enhance>: enable update the vgroup info during super table query.
上级
247cf369
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
37 addition
and
10 deletion
+37
-10
src/client/src/tscServer.c
src/client/src/tscServer.c
+37
-10
未找到文件。
src/client/src/tscServer.c
浏览文件 @
6d593fe8
...
...
@@ -34,6 +34,7 @@ int tscKeepConn[TSDB_SQL_MAX] = {0};
TSKEY
tscGetSubscriptionProgress
(
void
*
sub
,
int64_t
uid
,
TSKEY
dflt
);
void
tscUpdateSubscriptionProgress
(
void
*
sub
,
int64_t
uid
,
TSKEY
ts
);
void
tscSaveSubscriptionProgress
(
void
*
sub
);
static
int32_t
extractSTableQueryVgroupId
(
STableMetaInfo
*
pTableMetaInfo
);
static
int32_t
minMsgSize
()
{
return
tsRpcHeadSize
+
100
;
}
static
int32_t
getWaitingTimeInterval
(
int32_t
count
)
{
...
...
@@ -78,7 +79,8 @@ static void tscEpSetHtons(SRpcEpSet *s) {
for
(
int32_t
i
=
0
;
i
<
s
->
numOfEps
;
i
++
)
{
s
->
port
[
i
]
=
htons
(
s
->
port
[
i
]);
}
}
}
bool
tscEpSetIsEqual
(
SRpcEpSet
*
s1
,
SRpcEpSet
*
s2
)
{
if
(
s1
->
numOfEps
!=
s2
->
numOfEps
||
s1
->
inUse
!=
s2
->
inUse
)
{
return
false
;
...
...
@@ -118,12 +120,15 @@ static void tscUpdateVgroupInfo(SSqlObj *pObj, SRpcEpSet *pEpSet) {
return
;
}
int32_t
vgId
=
pTableMetaInfo
->
pTableMeta
->
vgId
;
int32_t
vgId
=
-
1
;
if
(
pTableMetaInfo
->
pTableMeta
->
tableType
==
TSDB_SUPER_TABLE
)
{
assert
(
vgId
==
0
);
return
;
vgId
=
extractSTableQueryVgroupId
(
pTableMetaInfo
);
}
else
{
vgId
=
pTableMetaInfo
->
pTableMeta
->
vgId
;
}
assert
(
vgId
>
0
);
SNewVgroupInfo
vgroupInfo
=
{.
vgId
=
-
1
};
taosHashGetClone
(
tscVgroupMap
,
&
vgId
,
sizeof
(
vgId
),
NULL
,
&
vgroupInfo
,
sizeof
(
SNewVgroupInfo
));
assert
(
vgroupInfo
.
numOfEps
>
0
&&
vgroupInfo
.
vgId
>
0
);
...
...
@@ -140,6 +145,27 @@ static void tscUpdateVgroupInfo(SSqlObj *pObj, SRpcEpSet *pEpSet) {
taosHashPut
(
tscVgroupMap
,
&
vgId
,
sizeof
(
vgId
),
&
vgroupInfo
,
sizeof
(
SNewVgroupInfo
));
}
int32_t
extractSTableQueryVgroupId
(
STableMetaInfo
*
pTableMetaInfo
)
{
assert
(
pTableMetaInfo
!=
NULL
);
int32_t
vgIndex
=
pTableMetaInfo
->
vgroupIndex
;
int32_t
vgId
=
-
1
;
if
(
pTableMetaInfo
->
pVgroupTables
==
NULL
)
{
SVgroupsInfo
*
pVgroupInfo
=
pTableMetaInfo
->
vgroupList
;
assert
(
pVgroupInfo
->
vgroups
[
vgIndex
].
vgId
>
0
&&
vgIndex
<
pTableMetaInfo
->
vgroupList
->
numOfVgroups
);
vgId
=
pVgroupInfo
->
vgroups
[
vgIndex
].
vgId
;
}
else
{
int32_t
numOfVgroups
=
(
int32_t
)
taosArrayGetSize
(
pTableMetaInfo
->
pVgroupTables
);
assert
(
vgIndex
>=
0
&&
vgIndex
<
numOfVgroups
);
SVgroupTableInfo
*
pTableIdList
=
taosArrayGet
(
pTableMetaInfo
->
pVgroupTables
,
vgIndex
);
vgId
=
pTableIdList
->
vgInfo
.
vgId
;
}
return
vgId
;
}
void
tscProcessHeartBeatRsp
(
void
*
param
,
TAOS_RES
*
tres
,
int
code
)
{
STscObj
*
pObj
=
(
STscObj
*
)
param
;
if
(
pObj
==
NULL
)
return
;
...
...
@@ -515,21 +541,22 @@ int tscBuildFetchMsg(SSqlObj *pSql, SSqlInfo *pInfo) {
if
(
UTIL_TABLE_IS_SUPER_TABLE
(
pTableMetaInfo
))
{
int32_t
vgIndex
=
pTableMetaInfo
->
vgroupIndex
;
int32_t
vgId
=
-
1
;
if
(
pTableMetaInfo
->
pVgroupTables
==
NULL
)
{
SVgroupsInfo
*
pVgroupInfo
=
pTableMetaInfo
->
vgroupList
;
assert
(
pVgroupInfo
->
vgroups
[
vgIndex
].
vgId
>
0
&&
vgIndex
<
pTableMetaInfo
->
vgroupList
->
numOfVgroups
);
pRetrieveMsg
->
header
.
vgId
=
htonl
(
pVgroupInfo
->
vgroups
[
vgIndex
].
vgId
);
tscDebug
(
"%p build fetch msg from vgId:%d, vgIndex:%d, qId:%"
PRIu64
,
pSql
,
pVgroupInfo
->
vgroups
[
vgIndex
].
vgId
,
vgIndex
,
pSql
->
res
.
qId
);
vgId
=
pVgroupInfo
->
vgroups
[
vgIndex
].
vgId
;
}
else
{
int32_t
numOfVgroups
=
(
int32_t
)
taosArrayGetSize
(
pTableMetaInfo
->
pVgroupTables
);
assert
(
vgIndex
>=
0
&&
vgIndex
<
numOfVgroups
);
SVgroupTableInfo
*
pTableIdList
=
taosArrayGet
(
pTableMetaInfo
->
pVgroupTables
,
vgIndex
);
pRetrieveMsg
->
header
.
vgId
=
htonl
(
pTableIdList
->
vgInfo
.
vgId
);
tscDebug
(
"%p build fetch msg from vgId:%d, vgIndex:%d, qId:%"
PRIu64
,
pSql
,
pTableIdList
->
vgInfo
.
vgId
,
vgIndex
,
pSql
->
res
.
qId
);
vgId
=
pTableIdList
->
vgInfo
.
vgId
;
}
pRetrieveMsg
->
header
.
vgId
=
htonl
(
vgId
);
tscDebug
(
"%p build fetch msg from vgId:%d, vgIndex:%d, qId:%"
PRIu64
,
pSql
,
vgId
,
vgIndex
,
pSql
->
res
.
qId
);
}
else
{
STableMeta
*
pTableMeta
=
pTableMetaInfo
->
pTableMeta
;
pRetrieveMsg
->
header
.
vgId
=
htonl
(
pTableMeta
->
vgId
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录