[TD-570] errno process while create vnode
This commit is contained in:
parent
2a7dfcaa13
commit
70e5284476
|
@ -2067,7 +2067,22 @@ static void mnodeProcessCreateChildTableRsp(SRpcMsg *rpcMsg) {
|
||||||
SChildTableObj *pTable = (SChildTableObj *)mnodeMsg->pTable;
|
SChildTableObj *pTable = (SChildTableObj *)mnodeMsg->pTable;
|
||||||
assert(pTable);
|
assert(pTable);
|
||||||
|
|
||||||
if (!(rpcMsg->code == TSDB_CODE_SUCCESS || rpcMsg->code != TSDB_CODE_TDB_TABLE_ALREADY_EXIST)) {
|
if (rpcMsg->code == TSDB_CODE_SUCCESS || rpcMsg->code == TSDB_CODE_TDB_TABLE_ALREADY_EXIST) {
|
||||||
|
SCMCreateTableMsg *pCreate = mnodeMsg->rpcMsg.pCont;
|
||||||
|
if (pCreate->getMeta) {
|
||||||
|
mTrace("app:%p:%p, table:%s, created in dnode and continue to get meta, thandle:%p result:%s",
|
||||||
|
mnodeMsg->rpcMsg.ahandle, mnodeMsg, pTable->info.tableId, mnodeMsg->rpcMsg.handle,
|
||||||
|
tstrerror(rpcMsg->code));
|
||||||
|
|
||||||
|
mnodeMsg->retry = 0;
|
||||||
|
dnodeReprocessMnodeWriteMsg(mnodeMsg);
|
||||||
|
} else {
|
||||||
|
mTrace("app:%p:%p, table:%s, created in dnode, thandle:%p result:%s", mnodeMsg->rpcMsg.ahandle, mnodeMsg,
|
||||||
|
pTable->info.tableId, mnodeMsg->rpcMsg.handle, tstrerror(rpcMsg->code));
|
||||||
|
|
||||||
|
dnodeSendRpcMnodeWriteRsp(mnodeMsg, TSDB_CODE_SUCCESS);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (mnodeMsg->retry++ < 10) {
|
if (mnodeMsg->retry++ < 10) {
|
||||||
mTrace("app:%p:%p, table:%s, create table rsp received, need retry, times:%d result:%s thandle:%p",
|
mTrace("app:%p:%p, table:%s, create table rsp received, need retry, times:%d result:%s thandle:%p",
|
||||||
mnodeMsg->rpcMsg.ahandle, mnodeMsg, pTable->info.tableId, mnodeMsg->retry, tstrerror(rpcMsg->code),
|
mnodeMsg->rpcMsg.ahandle, mnodeMsg, pTable->info.tableId, mnodeMsg->retry, tstrerror(rpcMsg->code),
|
||||||
|
@ -2078,29 +2093,11 @@ static void mnodeProcessCreateChildTableRsp(SRpcMsg *rpcMsg) {
|
||||||
mError("app:%p:%p, table:%s, failed to create in dnode, result:%s thandle:%p", mnodeMsg->rpcMsg.ahandle, mnodeMsg,
|
mError("app:%p:%p, table:%s, failed to create in dnode, result:%s thandle:%p", mnodeMsg->rpcMsg.ahandle, mnodeMsg,
|
||||||
pTable->info.tableId, tstrerror(rpcMsg->code), mnodeMsg->rpcMsg.handle);
|
pTable->info.tableId, tstrerror(rpcMsg->code), mnodeMsg->rpcMsg.handle);
|
||||||
|
|
||||||
SSdbOper oper = {
|
SSdbOper oper = {.type = SDB_OPER_GLOBAL, .table = tsChildTableSdb, .pObj = pTable};
|
||||||
.type = SDB_OPER_GLOBAL,
|
|
||||||
.table = tsChildTableSdb,
|
|
||||||
.pObj = pTable
|
|
||||||
};
|
|
||||||
sdbDeleteRow(&oper);
|
sdbDeleteRow(&oper);
|
||||||
|
|
||||||
dnodeSendRpcMnodeWriteRsp(mnodeMsg, rpcMsg->code);
|
dnodeSendRpcMnodeWriteRsp(mnodeMsg, rpcMsg->code);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
SCMCreateTableMsg *pCreate = mnodeMsg->rpcMsg.pCont;
|
|
||||||
if (pCreate->getMeta) {
|
|
||||||
mTrace("app:%p:%p, table:%s, created in dnode and continue to get meta, thandle:%p", mnodeMsg->rpcMsg.ahandle,
|
|
||||||
mnodeMsg, pTable->info.tableId, mnodeMsg->rpcMsg.handle);
|
|
||||||
|
|
||||||
mnodeMsg->retry = 0;
|
|
||||||
dnodeReprocessMnodeWriteMsg(mnodeMsg);
|
|
||||||
} else {
|
|
||||||
mTrace("app:%p:%p, table:%s, created in dnode, thandle:%p", mnodeMsg->rpcMsg.ahandle, mnodeMsg,
|
|
||||||
pTable->info.tableId, mnodeMsg->rpcMsg.handle);
|
|
||||||
|
|
||||||
dnodeSendRpcMnodeWriteRsp(mnodeMsg, TSDB_CODE_SUCCESS);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -613,7 +613,6 @@ SRpcIpSet mnodeGetIpSetFromIp(char *ep) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void mnodeSendCreateVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet, void *ahandle) {
|
void mnodeSendCreateVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet, void *ahandle) {
|
||||||
mTrace("vgId:%d, send create vnode:%d msg, ahandle:%p db:%s", pVgroup->vgId, pVgroup->vgId, ahandle, pVgroup->dbName);
|
|
||||||
SMDCreateVnodeMsg *pCreate = mnodeBuildCreateVnodeMsg(pVgroup);
|
SMDCreateVnodeMsg *pCreate = mnodeBuildCreateVnodeMsg(pVgroup);
|
||||||
SRpcMsg rpcMsg = {
|
SRpcMsg rpcMsg = {
|
||||||
.handle = ahandle,
|
.handle = ahandle,
|
||||||
|
@ -626,9 +625,12 @@ void mnodeSendCreateVnodeMsg(SVgObj *pVgroup, SRpcIpSet *ipSet, void *ahandle) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void mnodeSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle) {
|
void mnodeSendCreateVgroupMsg(SVgObj *pVgroup, void *ahandle) {
|
||||||
mTrace("vgId:%d, send create all vnodes msg, ahandle:%p", pVgroup->vgId, ahandle);
|
mTrace("vgId:%d, send create all vnodes msg, numOfVnodes:%d db:%s", pVgroup->vgId, pVgroup->numOfVnodes,
|
||||||
|
pVgroup->dbName);
|
||||||
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
|
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
|
||||||
SRpcIpSet ipSet = mnodeGetIpSetFromIp(pVgroup->vnodeGid[i].pDnode->dnodeEp);
|
SRpcIpSet ipSet = mnodeGetIpSetFromIp(pVgroup->vnodeGid[i].pDnode->dnodeEp);
|
||||||
|
mTrace("vgId:%d, index:%d, send create vnode msg to dnode %s, ahandle:%p", pVgroup->vgId,
|
||||||
|
i, pVgroup->vnodeGid[i].pDnode->dnodeEp, ahandle);
|
||||||
mnodeSendCreateVnodeMsg(pVgroup, &ipSet, ahandle);
|
mnodeSendCreateVnodeMsg(pVgroup, &ipSet, ahandle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -746,6 +748,7 @@ static int32_t mnodeProcessVnodeCfgMsg(SMnodeMsg *pMsg) {
|
||||||
}
|
}
|
||||||
mnodeDecVgroupRef(pVgroup);
|
mnodeDecVgroupRef(pVgroup);
|
||||||
|
|
||||||
|
mTrace("vgId:%d, send create vnode msg to dnode %s for vnode cfg msg", pVgroup->vgId, pDnode->dnodeEp);
|
||||||
SRpcIpSet ipSet = mnodeGetIpSetFromIp(pDnode->dnodeEp);
|
SRpcIpSet ipSet = mnodeGetIpSetFromIp(pDnode->dnodeEp);
|
||||||
mnodeSendCreateVnodeMsg(pVgroup, &ipSet, NULL);
|
mnodeSendCreateVnodeMsg(pVgroup, &ipSet, NULL);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue