Skip to content

Conversation

localvar
Copy link
Contributor

@localvar localvar commented Sep 5, 2025

Description

implement show ssmigrate and kill ssmigrate command

Checklist

Please check the items in the checklist if applicable.

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

@CLAassistant
Copy link

CLAassistant commented Sep 8, 2025

CLA assistant check
All committers have signed the CLA.


int32_t vgId = *(int32_t*)taosArrayGet(pSsMigrate->vgroups, pSsMigrate->vgIdx);
while (1) {
pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 fetch 之后需要 release 掉吧。

Copy link
Contributor

@cadem cadem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要做些修改

Comment on lines 619 to 628
while (1) {
pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup);
if (pIter == NULL) {
return mndDropSsMigrate(pMnode, pSsMigrate);
}
if (pVgroup->vgId == vgId) {
sdbCancelFetch(pSdb, pIter);
break;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这段while,实现的是mndAcquireVgroup这个功能吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


_OVER:
if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) {
mError("failed to kill ssmigrate %" PRId32 " since %s", killReq.ssMigrateId, terrstr());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

应该用tstrerror(code)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

int32_t contLen = reqLen + sizeof(SMsgHead);
SMsgHead *pHead = rpcMallocCont(contLen);
if (pHead == NULL) {
return mndDropSsMigrate(pMnode, pSsMigrate);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不执行dropSsMigrate吧?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这几个 drop 都没有问题,mnode drop 过程中向 vnode 发送消息只是为了加速 vnode 端的 drop 操作。但只要 mnode 端没有了,不再进行信息同步,vnode 端就会因为超时而失败。

pHead->vgId = htonl(vgId);
int32_t ret = 0;
if ((ret = tSerializeSVnodeKillSsMigrateReq((char *)pHead + sizeof(SMsgHead), reqLen, &req)) < 0) {
return mndDropSsMigrate(pMnode, pSsMigrate);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不执行dropSsMigrate吧?

mInfo("ssmigrate:%d, vgId:%d, kill ssmigrate request was sent to vnode", req.ssMigrateId, vgId);
}

return mndDropSsMigrate(pMnode, pSsMigrate);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果send失了,应该也不执行这dropSsMigrate吧?

@guanshengliang guanshengliang merged commit 67bd099 into 3.0 Sep 12, 2025
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants