enh: print mnode epSet on sending dnode status failure
This commit is contained in:
parent
dbf8443686
commit
56eba75806
|
@ -61,6 +61,16 @@ static void dmProcessStatusRsp(SDnodeMgmt *pMgmt, SRpcMsg *pRsp) {
|
||||||
rpcFreeCont(pRsp->pCont);
|
rpcFreeCont(pRsp->pCont);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dmEpSetToStr(char *buf, int32_t len, SEpSet *epSet) {
|
||||||
|
int32_t n = 0;
|
||||||
|
n += snprintf(buf + n, len - n, "%s", "{");
|
||||||
|
for (int i = 0; i < epSet->numOfEps; i++) {
|
||||||
|
n += snprintf(buf + n, len - n, "%s:%d%s", epSet->eps[i].fqdn, epSet->eps[i].port,
|
||||||
|
(i + 1 < epSet->numOfEps ? ", " : ""));
|
||||||
|
}
|
||||||
|
n += snprintf(buf + n, len - n, "%s", "}");
|
||||||
|
}
|
||||||
|
|
||||||
void dmSendStatusReq(SDnodeMgmt *pMgmt) {
|
void dmSendStatusReq(SDnodeMgmt *pMgmt) {
|
||||||
SStatusReq req = {0};
|
SStatusReq req = {0};
|
||||||
|
|
||||||
|
@ -119,11 +129,9 @@ void dmSendStatusReq(SDnodeMgmt *pMgmt) {
|
||||||
dmGetMnodeEpSet(pMgmt->pData, &epSet);
|
dmGetMnodeEpSet(pMgmt->pData, &epSet);
|
||||||
rpcSendRecv(pMgmt->msgCb.clientRpc, &epSet, &rpcMsg, &rpcRsp);
|
rpcSendRecv(pMgmt->msgCb.clientRpc, &epSet, &rpcMsg, &rpcRsp);
|
||||||
if (rpcRsp.code != 0) {
|
if (rpcRsp.code != 0) {
|
||||||
dError("failed to send status req since %s, numOfEps:%d inUse:%d", tstrerror(rpcRsp.code), epSet.numOfEps,
|
char tbuf[256];
|
||||||
epSet.inUse);
|
dmEpSetToStr(tbuf, sizeof(tbuf), &epSet);
|
||||||
for (int32_t i = 0; i < epSet.numOfEps; ++i) {
|
dError("failed to send status req since %s, epSet:%s, inUse:%d", tstrerror(rpcRsp.code), tbuf, epSet.inUse);
|
||||||
dDebug("index:%d, mnode ep:%s:%u", i, epSet.eps[i].fqdn, epSet.eps[i].port);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
dmProcessStatusRsp(pMgmt, &rpcRsp);
|
dmProcessStatusRsp(pMgmt, &rpcRsp);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue