-
Notifications
You must be signed in to change notification settings - Fork 5k
enh[TD-37448][TD-37449]: implement show ssmigrate
and kill ssmigrate
command
#32888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
26425cd
to
76cc115
Compare
15b44a5
to
88c314d
Compare
|
||
int32_t vgId = *(int32_t*)taosArrayGet(pSsMigrate->vgroups, pSsMigrate->vgIdx); | ||
while (1) { | ||
pIter = sdbFetch(pSdb, SDB_VGROUP, pIter, (void **)&pVgroup); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个 fetch 之后需要 release 掉吧。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
需要做些修改
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; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这段while,实现的是mndAcquireVgroup这个功能吧?
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该用tstrerror(code)
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不执行dropSsMigrate吧?
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果send失了,应该也不执行这dropSsMigrate吧?
Description
implement
show ssmigrate
andkill ssmigrate
commandChecklist
Please check the items in the checklist if applicable.