Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4a17f4b9
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4a17f4b9
编写于
6月 28, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:add rows to pSub if rebalance
上级
1fc66469
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
18 deletion
+22
-18
source/dnode/mnode/impl/src/mndConsumer.c
source/dnode/mnode/impl/src/mndConsumer.c
+1
-1
source/dnode/mnode/impl/src/mndSubscribe.c
source/dnode/mnode/impl/src/mndSubscribe.c
+21
-17
未找到文件。
source/dnode/mnode/impl/src/mndConsumer.c
浏览文件 @
4a17f4b9
...
...
@@ -1190,7 +1190,7 @@ static int32_t mndRetrieveConsumer(SRpcMsg *pReq, SShowObj *pShow, SSDataBlock *
tFormatOffset
(
buf
,
TSDB_OFFSET_LEN
,
&
pVal
);
char
parasStr
[
64
+
TSDB_OFFSET_LEN
+
VARSTR_HEADER_SIZE
]
=
{
0
};
sprintf
(
varDataVal
(
parasStr
),
"tbname:%d,commit:%d,interval:%d,reset:%s"
,
pConsumer
->
withTbName
,
pConsumer
->
autoCommit
,
pConsumer
->
autoCommitInterval
,
buf
);
sprintf
(
varDataVal
(
parasStr
),
"tbname:%d,commit:%d,interval:%d
ms
,reset:%s"
,
pConsumer
->
withTbName
,
pConsumer
->
autoCommit
,
pConsumer
->
autoCommitInterval
,
buf
);
varDataSetLen
(
parasStr
,
strlen
(
varDataVal
(
parasStr
)));
pColInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
cols
++
);
...
...
source/dnode/mnode/impl/src/mndSubscribe.c
浏览文件 @
4a17f4b9
...
...
@@ -468,7 +468,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
}
}
if
(
taosHashGetSize
(
pOutput
->
pSub
->
consumerHash
)
==
0
)
{
// if all consumer is removed
//
if(taosHashGetSize(pOutput->pSub->consumerHash) == 0) { // if all consumer is removed
SMqSubscribeObj
*
pSub
=
mndAcquireSubscribeByKey
(
pMnode
,
pInput
->
pRebInfo
->
key
);
// put all offset rows
if
(
pSub
)
{
taosRLockLatch
(
&
pSub
->
lock
);
...
...
@@ -501,7 +501,7 @@ static int32_t mndDoRebalance(SMnode *pMnode, const SMqRebInputObj *pInput, SMqR
}
taosRUnLockLatch
(
&
pSub
->
lock
);
mndReleaseSubscribe
(
pMnode
,
pSub
);
}
//
}
}
// 8. generate logs
...
...
@@ -771,8 +771,10 @@ static int32_t mndProcessRebalanceReq(SRpcMsg *pMsg) {
}
static
int32_t
mndProcessDropCgroupReq
(
SRpcMsg
*
pMsg
)
{
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
SMDropCgroupReq
dropReq
=
{
0
};
SMnode
*
pMnode
=
pMsg
->
info
.
node
;
SMDropCgroupReq
dropReq
=
{
0
};
STrans
*
pTrans
=
NULL
;
int32_t
code
=
TSDB_CODE_ACTION_IN_PROGRESS
;
if
(
tDeserializeSMDropCgroupReq
(
pMsg
->
pCont
,
pMsg
->
contLen
,
&
dropReq
)
!=
0
)
{
terrno
=
TSDB_CODE_INVALID_MSG
;
...
...
@@ -791,38 +793,40 @@ static int32_t mndProcessDropCgroupReq(SRpcMsg *pMsg) {
}
}
taosWLockLatch
(
&
pSub
->
lock
);
if
(
taosHashGetSize
(
pSub
->
consumerHash
)
!=
0
)
{
terrno
=
TSDB_CODE_MND_CGROUP_USED
;
mError
(
"cgroup:%s on topic:%s, failed to drop since %s"
,
dropReq
.
cgroup
,
dropReq
.
topic
,
terrstr
());
mndReleaseSubscribe
(
pMnode
,
pSub
)
;
return
-
1
;
code
=
-
1
;
goto
end
;
}
STrans
*
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_CONFLICT_NOTHING
,
pMsg
,
"drop-cgroup"
);
pTrans
=
mndTransCreate
(
pMnode
,
TRN_POLICY_ROLLBACK
,
TRN_CONFLICT_NOTHING
,
pMsg
,
"drop-cgroup"
);
if
(
pTrans
==
NULL
)
{
mError
(
"cgroup: %s on topic:%s, failed to drop since %s"
,
dropReq
.
cgroup
,
dropReq
.
topic
,
terrstr
());
mndReleaseSubscribe
(
pMnode
,
pSub
);
mndTransDrop
(
pTrans
);
return
-
1
;
code
=
-
1
;
goto
end
;
}
mInfo
(
"trans:%d, used to drop cgroup:%s on topic %s"
,
pTrans
->
id
,
dropReq
.
cgroup
,
dropReq
.
topic
);
if
(
mndSetDropSubCommitLogs
(
pMnode
,
pTrans
,
pSub
)
<
0
)
{
mError
(
"cgroup %s on topic:%s, failed to drop since %s"
,
dropReq
.
cgroup
,
dropReq
.
topic
,
terrstr
());
mndReleaseSubscribe
(
pMnode
,
pSub
);
mndTransDrop
(
pTrans
);
return
-
1
;
code
=
-
1
;
goto
end
;
}
if
(
mndTransPrepare
(
pMnode
,
pTrans
)
<
0
)
{
mndReleaseSubscribe
(
pMnode
,
pSub
);
mndTransDrop
(
pTrans
);
return
-
1
;
code
=
-
1
;
goto
end
;
}
end:
taosWUnLockLatch
(
&
pSub
->
lock
);
mndReleaseSubscribe
(
pMnode
,
pSub
);
mndTransDrop
(
pTrans
);
return
TSDB_CODE_ACTION_IN_PROGRESS
;
return
code
;
}
void
mndCleanupSubscribe
(
SMnode
*
pMnode
)
{}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录