[TD-10] fix memery corrupt after tqueue changed
This commit is contained in:
parent
2cf04d23b3
commit
db3bea8f38
|
@ -225,17 +225,17 @@ static int32_t dnodeOpenVnode(int32_t vnode, char *rootDir) {
|
||||||
vnodeObj.status = TSDB_VN_STATUS_NOT_READY;
|
vnodeObj.status = TSDB_VN_STATUS_NOT_READY;
|
||||||
vnodeObj.refCount = 1;
|
vnodeObj.refCount = 1;
|
||||||
vnodeObj.version = 0;
|
vnodeObj.version = 0;
|
||||||
vnodeObj.wworker = dnodeAllocateWriteWorker(&vnodeObj);
|
|
||||||
vnodeObj.rworker = dnodeAllocateReadWorker(&vnodeObj);
|
|
||||||
vnodeObj.wal = NULL;
|
vnodeObj.wal = NULL;
|
||||||
vnodeObj.tsdb = pTsdb;
|
vnodeObj.tsdb = pTsdb;
|
||||||
vnodeObj.replica = NULL;
|
vnodeObj.replica = NULL;
|
||||||
vnodeObj.events = NULL;
|
vnodeObj.events = NULL;
|
||||||
vnodeObj.cq = NULL;
|
vnodeObj.cq = NULL;
|
||||||
|
|
||||||
taosAddIntHash(tsDnodeVnodesHash, vnodeObj.vgId, (char *) (&vnodeObj));
|
SVnodeObj *pVnode = (SVnodeObj *)taosAddIntHash(tsDnodeVnodesHash, vnodeObj.vgId, (char *)(&vnodeObj));
|
||||||
|
pVnode->wworker = dnodeAllocateWriteWorker(pVnode);
|
||||||
|
pVnode->rworker = dnodeAllocateReadWorker(pVnode);
|
||||||
|
|
||||||
dTrace("open vnode:%d in %s", vnodeObj.vgId, rootDir);
|
dTrace("open vnode:%d in %s", pVnode->vgId, rootDir);
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -314,17 +314,17 @@ static int32_t dnodeCreateVnode(SMDCreateVnodeMsg *pVnodeCfg) {
|
||||||
vnodeObj.status = TSDB_VN_STATUS_NOT_READY;
|
vnodeObj.status = TSDB_VN_STATUS_NOT_READY;
|
||||||
vnodeObj.refCount = 1;
|
vnodeObj.refCount = 1;
|
||||||
vnodeObj.version = 0;
|
vnodeObj.version = 0;
|
||||||
vnodeObj.wworker = dnodeAllocateWriteWorker(&vnodeObj);
|
|
||||||
vnodeObj.rworker = dnodeAllocateReadWorker(&vnodeObj);
|
|
||||||
vnodeObj.wal = NULL;
|
vnodeObj.wal = NULL;
|
||||||
vnodeObj.tsdb = pTsdb;
|
vnodeObj.tsdb = pTsdb;
|
||||||
vnodeObj.replica = NULL;
|
vnodeObj.replica = NULL;
|
||||||
vnodeObj.events = NULL;
|
vnodeObj.events = NULL;
|
||||||
vnodeObj.cq = NULL;
|
vnodeObj.cq = NULL;
|
||||||
|
|
||||||
taosAddIntHash(tsDnodeVnodesHash, vnodeObj.vgId, (char *) (&vnodeObj));
|
SVnodeObj *pVnode = (SVnodeObj *)taosAddIntHash(tsDnodeVnodesHash, vnodeObj.vgId, (char *)(&vnodeObj));
|
||||||
|
pVnode->wworker = dnodeAllocateWriteWorker(pVnode);
|
||||||
|
pVnode->rworker = dnodeAllocateReadWorker(pVnode);
|
||||||
|
|
||||||
dPrint("vgroup:%d, vnode:%d is created", vnodeObj.vgId, vnodeObj.vgId);
|
dPrint("vgroup:%d, vnode:%d is created", pVnode->vgId, pVnode->vgId);
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -220,11 +220,15 @@ static void dnodeProcessReadResult(void *pVnode, SReadMsg *pRead) {
|
||||||
code = terrno;
|
code = terrno;
|
||||||
}
|
}
|
||||||
|
|
||||||
SRpcMsg rsp;
|
//TODO: query handle is returned by dnodeProcessQueryMsg
|
||||||
rsp.handle = pRead->rpcMsg.handle;
|
if (0) {
|
||||||
rsp.code = code;
|
SRpcMsg rsp;
|
||||||
rsp.pCont = NULL;
|
rsp.handle = pRead->rpcMsg.handle;
|
||||||
rpcSendResponse(&rsp);
|
rsp.code = code;
|
||||||
|
rsp.pCont = NULL;
|
||||||
|
rpcSendResponse(&rsp);
|
||||||
|
}
|
||||||
|
|
||||||
rpcFreeCont(pRead->rpcMsg.pCont); // free the received message
|
rpcFreeCont(pRead->rpcMsg.pCont); // free the received message
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue