Merge pull request #22784 from taosdata/fix/xsren/TD-26163/toheap
stack flow
This commit is contained in:
commit
e252e3478d
|
@ -2562,7 +2562,11 @@ int32_t syncNodeRebuildAndCopyIfExist(SSyncNode* ths, int32_t oldtotalReplicaNum
|
||||||
ths->logReplMgrs[i]->matchIndex, ths->logReplMgrs[i]->endIndex);
|
ths->logReplMgrs[i]->matchIndex, ths->logReplMgrs[i]->endIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
SSyncLogReplMgr oldLogReplMgrs[TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA] = {0};
|
SSyncLogReplMgr* oldLogReplMgrs = NULL;
|
||||||
|
int64_t length = sizeof(SSyncLogReplMgr) * (TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA);
|
||||||
|
oldLogReplMgrs = taosMemoryMalloc(length);
|
||||||
|
if (NULL == oldLogReplMgrs) return -1;
|
||||||
|
memset(oldLogReplMgrs, 0, length);
|
||||||
|
|
||||||
for(int i = 0; i < oldtotalReplicaNum; i++){
|
for(int i = 0; i < oldtotalReplicaNum; i++){
|
||||||
oldLogReplMgrs[i] = *(ths->logReplMgrs[i]);
|
oldLogReplMgrs[i] = *(ths->logReplMgrs[i]);
|
||||||
|
@ -2643,6 +2647,8 @@ int32_t syncNodeRebuildAndCopyIfExist(SSyncNode* ths, int32_t oldtotalReplicaNum
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
taosMemoryFree(oldLogReplMgrs);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue