Merge pull request #3691 from taosdata/feature/crash

Invalid Write in the Sync module
This commit is contained in:
Shengliang Guan 2020-09-27 17:48:23 +08:00 committed by GitHub
commit 19947311de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -167,6 +167,8 @@ void *syncStart(const SSyncInfo *pInfo) {
}
}
syncAddNodeRef(pNode);
if (pNode->selfIndex < 0) {
sInfo("vgId:%d, this node is not configured", pNode->vgId);
terrno = TSDB_CODE_SYN_INVALID_CONFIG;
@ -194,7 +196,6 @@ void *syncStart(const SSyncInfo *pInfo) {
}
syncAddArbitrator(pNode);
syncAddNodeRef(pNode);
taosHashPut(vgIdHash, (const char *)&pNode->vgId, sizeof(int32_t), (char *)(&pNode), sizeof(SSyncNode *));
if (pNode->notifyRole) {