fix:remove tq lock in write thread
This commit is contained in:
parent
f2ee657b62
commit
1b9387b683
|
@ -17,20 +17,16 @@
|
||||||
#include "vnd.h"
|
#include "vnd.h"
|
||||||
|
|
||||||
int32_t tqProcessSubmitReqForSubscribe(STQ* pTq) {
|
int32_t tqProcessSubmitReqForSubscribe(STQ* pTq) {
|
||||||
int32_t vgId = TD_VID(pTq->pVnode);
|
if (taosHashGetSize(pTq->pPushMgr) <= 0) {
|
||||||
|
return 0;
|
||||||
taosWLockLatch(&pTq->lock);
|
}
|
||||||
if (taosHashGetSize(pTq->pPushMgr) > 0) {
|
|
||||||
SRpcMsg msg = {.msgType = TDMT_VND_TMQ_CONSUME_PUSH};
|
SRpcMsg msg = {.msgType = TDMT_VND_TMQ_CONSUME_PUSH};
|
||||||
msg.pCont = rpcMallocCont(sizeof(SMsgHead));
|
msg.pCont = rpcMallocCont(sizeof(SMsgHead));
|
||||||
msg.contLen = sizeof(SMsgHead);
|
msg.contLen = sizeof(SMsgHead);
|
||||||
SMsgHead *pHead = msg.pCont;
|
SMsgHead *pHead = msg.pCont;
|
||||||
pHead->vgId = vgId;
|
pHead->vgId = TD_VID(pTq->pVnode);
|
||||||
pHead->contLen = msg.contLen;
|
pHead->contLen = msg.contLen;
|
||||||
tmsgPutToQueue(&pTq->pVnode->msgCb, QUERY_QUEUE, &msg);
|
tmsgPutToQueue(&pTq->pVnode->msgCb, QUERY_QUEUE, &msg);
|
||||||
}
|
|
||||||
// unlock
|
|
||||||
taosWUnLockLatch(&pTq->lock);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue