Merge pull request #25629 from taosdata/fix/TD-29893-3.0

fix:[TD-29893]avoid returning 0 if vnode init error
This commit is contained in:
dapan1121 2024-05-12 18:07:08 +08:00 committed by GitHub
commit 05788d25b0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 5 deletions

View File

@ -316,7 +316,7 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
if (vmTsmaAdjustDays(&vnodeCfg, &req) < 0) {
dError("vgId:%d, failed to adjust tsma days since %s", req.vgId, terrstr());
code = terrno;
code = terrno != 0 ? terrno : -1;
goto _OVER;
}
@ -344,21 +344,21 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
dError("vgId:%d, failed to create vnode since %s", req.vgId, terrstr());
vmReleaseVnode(pMgmt, pVnode);
tFreeSCreateVnodeReq(&req);
code = terrno;
code = terrno != 0 ? terrno : -1;
return code;
}
SVnode *pImpl = vnodeOpen(path, diskPrimary, pMgmt->pTfs, pMgmt->msgCb, true);
if (pImpl == NULL) {
dError("vgId:%d, failed to open vnode since %s", req.vgId, terrstr());
code = terrno;
code = terrno != 0 ? terrno : -1;
goto _OVER;
}
code = vmOpenVnode(pMgmt, &wrapperCfg, pImpl);
if (code != 0) {
dError("vgId:%d, failed to open vnode since %s", req.vgId, terrstr());
code = terrno;
code = terrno != 0 ? terrno : code;
goto _OVER;
}
@ -379,7 +379,7 @@ int32_t vmProcessCreateVnodeReq(SVnodeMgmt *pMgmt, SRpcMsg *pMsg) {
code = vmWriteVnodeListToFile(pMgmt);
if (code != 0) {
code = terrno;
code = terrno != 0 ? terrno : code;
goto _OVER;
}