Merge pull request #7040 from taosdata/fix/TD-5558
[TD-5558]<fix>: fix invalid read memory issue
This commit is contained in:
commit
8a14e175c9
|
@ -110,7 +110,9 @@ void vnodeRelease(void *vparam) {
|
||||||
if (vparam == NULL) return;
|
if (vparam == NULL) return;
|
||||||
|
|
||||||
int32_t refCount = atomic_sub_fetch_32(&pVnode->refCount, 1);
|
int32_t refCount = atomic_sub_fetch_32(&pVnode->refCount, 1);
|
||||||
vTrace("vgId:%d, release vnode, refCount:%d pVnode:%p", pVnode->vgId, refCount, pVnode);
|
int32_t vgId = pVnode->vgId;
|
||||||
|
|
||||||
|
vTrace("vgId:%d, release vnode, refCount:%d pVnode:%p", vgId, refCount, pVnode);
|
||||||
assert(refCount >= 0);
|
assert(refCount >= 0);
|
||||||
|
|
||||||
if (refCount > 0) {
|
if (refCount > 0) {
|
||||||
|
@ -118,10 +120,10 @@ void vnodeRelease(void *vparam) {
|
||||||
tsem_post(&pVnode->sem);
|
tsem_post(&pVnode->sem);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
vDebug("vgId:%d, vnode will be destroyed, refCount:%d pVnode:%p", pVnode->vgId, refCount, pVnode);
|
vDebug("vgId:%d, vnode will be destroyed, refCount:%d pVnode:%p", vgId, refCount, pVnode);
|
||||||
vnodeDestroyInMWorker(pVnode);
|
vnodeDestroyInMWorker(pVnode);
|
||||||
int32_t count = taosHashGetSize(tsVnodesHash);
|
int32_t count = taosHashGetSize(tsVnodesHash);
|
||||||
vDebug("vgId:%d, vnode is destroyed, vnodes:%d", pVnode->vgId, count);
|
vDebug("vgId:%d, vnode is destroyed, vnodes:%d", vgId, count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue