fix:[TD-TD-31308] error code if topic not exist
This commit is contained in:
parent
c9eb3ca2f9
commit
9ee22b17a1
|
@ -1275,7 +1275,7 @@ tmq_t* tmq_consumer_new(tmq_conf_t* conf, char* errstr, int32_t errstrLen) {
|
||||||
|
|
||||||
// init semaphore
|
// init semaphore
|
||||||
if (tsem2_init(&pTmq->rspSem, 0, 0) != 0) {
|
if (tsem2_init(&pTmq->rspSem, 0, 0) != 0) {
|
||||||
tscError("consumer:0x %" PRIx64 " setup failed since %s, consumer group %s", pTmq->consumerId, terrstr(),
|
tscError("consumer:0x %" PRIx64 " setup failed since %s, consumer group %s", pTmq->consumerId, tstrerror(TAOS_SYSTEM_ERROR(errno)),
|
||||||
pTmq->groupId);
|
pTmq->groupId);
|
||||||
SET_ERROR_MSG_TMQ("init t_sem failed")
|
SET_ERROR_MSG_TMQ("init t_sem failed")
|
||||||
goto _failed;
|
goto _failed;
|
||||||
|
|
|
@ -46,7 +46,7 @@ const char *mndConsumerStatusName(int status);
|
||||||
#define MND_TMQ_NULL_CHECK(c) \
|
#define MND_TMQ_NULL_CHECK(c) \
|
||||||
do { \
|
do { \
|
||||||
if (c == NULL) { \
|
if (c == NULL) { \
|
||||||
code = TSDB_CODE_OUT_OF_MEMORY; \
|
code = TAOS_GET_TERRNO(TSDB_CODE_OUT_OF_MEMORY); \
|
||||||
goto END; \
|
goto END; \
|
||||||
} \
|
} \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|
|
@ -882,7 +882,7 @@ static int32_t buildRebOutput(SMnode *pMnode, SMqRebInputObj *rebInput, SMqRebOu
|
||||||
rebInput->oldConsumerNum = 0;
|
rebInput->oldConsumerNum = 0;
|
||||||
code = mndCreateSubscription(pMnode, pTopic, key, &rebOutput->pSub);
|
code = mndCreateSubscription(pMnode, pTopic, key, &rebOutput->pSub);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
mError("[rebalance] mq rebalance %s failed create sub since %s, ignore", key, terrstr());
|
mError("[rebalance] mq rebalance %s failed create sub since %s, ignore", key, tstrerror(code));
|
||||||
taosRUnLockLatch(&pTopic->lock);
|
taosRUnLockLatch(&pTopic->lock);
|
||||||
mndReleaseTopic(pMnode, pTopic);
|
mndReleaseTopic(pMnode, pTopic);
|
||||||
return code;
|
return code;
|
||||||
|
@ -1067,7 +1067,7 @@ static int32_t mndProcessDropCgroupReq(SRpcMsg *pMsg) {
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
code = TSDB_CODE_MND_SUBSCRIBE_NOT_EXIST;
|
code = TSDB_CODE_MND_SUBSCRIBE_NOT_EXIST;
|
||||||
mError("topic:%s, cgroup:%s, failed to drop since %s", dropReq.topic, dropReq.cgroup, terrstr());
|
mError("topic:%s, cgroup:%s, failed to drop since %s", dropReq.topic, dropReq.cgroup, tstrerror(code));
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1075,7 +1075,7 @@ static int32_t mndProcessDropCgroupReq(SRpcMsg *pMsg) {
|
||||||
taosWLockLatch(&pSub->lock);
|
taosWLockLatch(&pSub->lock);
|
||||||
if (taosHashGetSize(pSub->consumerHash) != 0) {
|
if (taosHashGetSize(pSub->consumerHash) != 0) {
|
||||||
code = TSDB_CODE_MND_CGROUP_USED;
|
code = TSDB_CODE_MND_CGROUP_USED;
|
||||||
mError("cgroup:%s on topic:%s, failed to drop since %s", dropReq.cgroup, dropReq.topic, terrstr());
|
mError("cgroup:%s on topic:%s, failed to drop since %s", dropReq.cgroup, dropReq.topic, tstrerror(code));
|
||||||
goto END;
|
goto END;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -574,7 +574,7 @@ static int32_t mndProcessCreateTopicReq(SRpcMsg *pReq) {
|
||||||
|
|
||||||
END:
|
END:
|
||||||
if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) {
|
if (code != 0 && code != TSDB_CODE_ACTION_IN_PROGRESS) {
|
||||||
mError("failed to create topic:%s since %s", createTopicReq.name, terrstr());
|
mError("failed to create topic:%s since %s", createTopicReq.name, tstrerror(code));
|
||||||
}
|
}
|
||||||
|
|
||||||
mndReleaseTopic(pMnode, pTopic);
|
mndReleaseTopic(pMnode, pTopic);
|
||||||
|
@ -699,7 +699,7 @@ static int32_t mndProcessDropTopicReq(SRpcMsg *pReq) {
|
||||||
tFreeSMDropTopicReq(&dropReq);
|
tFreeSMDropTopicReq(&dropReq);
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
mError("topic:%s, failed to drop since %s", dropReq.name, terrstr());
|
mError("topic:%s, failed to drop since %s", dropReq.name, tstrerror(code));
|
||||||
tFreeSMDropTopicReq(&dropReq);
|
tFreeSMDropTopicReq(&dropReq);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
@ -727,7 +727,7 @@ END:
|
||||||
mndReleaseTopic(pMnode, pTopic);
|
mndReleaseTopic(pMnode, pTopic);
|
||||||
mndTransDrop(pTrans);
|
mndTransDrop(pTrans);
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
mError("topic:%s, failed to drop since %s", dropReq.name, terrstr());
|
mError("topic:%s, failed to drop since %s", dropReq.name, tstrerror(code));
|
||||||
tFreeSMDropTopicReq(&dropReq);
|
tFreeSMDropTopicReq(&dropReq);
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue