TD-1832
This commit is contained in:
parent
5b4dc831d6
commit
dab726abe9
|
@ -273,6 +273,8 @@ static void sdbConfirmForward(void *ahandle, void *param, int32_t code) {
|
|||
tstrerror(code));
|
||||
}
|
||||
|
||||
if (((SSdbTable *)pOper->table)->tableId == SDB_TABLE_CTABLE)
|
||||
pOper->retCode = TSDB_CODE_MND_APP_ERROR;
|
||||
// failed to forward, need revert insert
|
||||
if (pOper->retCode != TSDB_CODE_SUCCESS) {
|
||||
SWalHead *pHead = (void *)pOper + sizeof(SSdbOper) + SDB_SYNC_HACK;
|
||||
|
@ -281,7 +283,14 @@ static void sdbConfirmForward(void *ahandle, void *param, int32_t code) {
|
|||
((SSdbTable *)pOper->table)->tableName, pOper->pObj, sdbGetKeyStr(pOper->table, pHead->cont),
|
||||
pHead->version, action, tstrerror(pOper->retCode));
|
||||
if (action == SDB_ACTION_INSERT) {
|
||||
sdbDeleteHash(pOper->table, pOper);
|
||||
// It's better to create a table in two stages, create it first and then set it success
|
||||
//sdbDeleteHash(pOper->table, pOper);
|
||||
SSdbOper oper = {
|
||||
.type = SDB_OPER_GLOBAL,
|
||||
.table = pOper->table,
|
||||
.pObj = pOper->pObj
|
||||
};
|
||||
sdbDeleteRow(&oper);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue