Merge pull request #28509 from taosdata/fix/TD-32621-remove-from-hash-when-creating-fail

fix: remove from hash when creating fail
This commit is contained in:
Hongze Cheng 2024-10-28 13:29:59 +08:00 committed by GitHub
commit 3949a0a15f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -442,7 +442,8 @@ _OVER:
dError("vgId:%d, failed to lock since %s", req.vgId, tstrerror(r)); dError("vgId:%d, failed to lock since %s", req.vgId, tstrerror(r));
} }
if (r == 0) { if (r == 0) {
r = taosHashRemove(pMgmt->hash, &pVnode->vgId, sizeof(int32_t)); dInfo("vgId:%d, remove from hash", req.vgId);
r = taosHashRemove(pMgmt->hash, &req.vgId, sizeof(int32_t));
if (r != 0) { if (r != 0) {
dError("vgId:%d, failed to remove vnode since %s", req.vgId, tstrerror(r)); dError("vgId:%d, failed to remove vnode since %s", req.vgId, tstrerror(r));
} }