Merge pull request #2320 from taosdata/hotfix/crash
[TD-669] incomplete update while alter vgroup
This commit is contained in:
commit
5435dc058a
|
@ -182,14 +182,19 @@ static int32_t mnodeChildTableActionUpdate(SSdbOper *pOper) {
|
||||||
SChildTableObj *pNew = pOper->pObj;
|
SChildTableObj *pNew = pOper->pObj;
|
||||||
SChildTableObj *pTable = mnodeGetChildTable(pNew->info.tableId);
|
SChildTableObj *pTable = mnodeGetChildTable(pNew->info.tableId);
|
||||||
if (pTable != pNew) {
|
if (pTable != pNew) {
|
||||||
void *oldTableId = pTable->info.tableId;
|
void *oldTableId = pTable->info.tableId;
|
||||||
void *oldSql = pTable->sql;
|
void *oldSql = pTable->sql;
|
||||||
void *oldSchema = pTable->schema;
|
void *oldSchema = pTable->schema;
|
||||||
|
void *oldSTable = pTable->superTable;
|
||||||
int32_t oldRefCount = pTable->refCount;
|
int32_t oldRefCount = pTable->refCount;
|
||||||
|
|
||||||
memcpy(pTable, pNew, sizeof(SChildTableObj));
|
memcpy(pTable, pNew, sizeof(SChildTableObj));
|
||||||
|
|
||||||
pTable->refCount = oldRefCount;
|
pTable->refCount = oldRefCount;
|
||||||
pTable->sql = pNew->sql;
|
pTable->sql = pNew->sql;
|
||||||
pTable->schema = pNew->schema;
|
pTable->schema = pNew->schema;
|
||||||
|
pTable->superTable = oldSTable;
|
||||||
|
|
||||||
free(pNew);
|
free(pNew);
|
||||||
free(oldSql);
|
free(oldSql);
|
||||||
free(oldSchema);
|
free(oldSchema);
|
||||||
|
|
|
@ -149,17 +149,8 @@ static int32_t mnodeVgroupActionUpdate(SSdbOper *pOper) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void *idPool = pVgroup->idPool;
|
memcpy(pVgroup, pNew, tsVgUpdateSize);
|
||||||
void *tableList = pVgroup->tableList;
|
|
||||||
int32_t oldRefCount = pVgroup->refCount;
|
|
||||||
|
|
||||||
memcpy(pVgroup, pNew, sizeof(SVgObj));
|
|
||||||
|
|
||||||
free(pNew);
|
|
||||||
pVgroup->refCount = oldRefCount;
|
|
||||||
pVgroup->idPool = idPool;
|
|
||||||
pVgroup->tableList = tableList;
|
|
||||||
|
|
||||||
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
|
for (int32_t i = 0; i < pVgroup->numOfVnodes; ++i) {
|
||||||
SDnodeObj *pDnode = mnodeGetDnode(pVgroup->vnodeGid[i].dnodeId);
|
SDnodeObj *pDnode = mnodeGetDnode(pVgroup->vnodeGid[i].dnodeId);
|
||||||
pVgroup->vnodeGid[i].pDnode = pDnode;
|
pVgroup->vnodeGid[i].pDnode = pDnode;
|
||||||
|
|
Loading…
Reference in New Issue