fix compile
This commit is contained in:
parent
68f2087f7d
commit
bb7cda6f96
|
@ -1097,9 +1097,9 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion) {
|
||||||
pSyncNode->syncEqCtrlMsg = pSyncInfo->syncEqCtrlMsg;
|
pSyncNode->syncEqCtrlMsg = pSyncInfo->syncEqCtrlMsg;
|
||||||
|
|
||||||
// create raft log ring buffer
|
// create raft log ring buffer
|
||||||
pSyncNode->pLogBuf = syncLogBufferCreate();
|
code = syncLogBufferCreate(&pSyncNode->pLogBuf);
|
||||||
if (pSyncNode->pLogBuf == NULL) {
|
if (pSyncNode->pLogBuf == NULL) {
|
||||||
sError("failed to init sync log buffer since %s. vgId:%d", terrstr(), pSyncNode->vgId);
|
sError("failed to init sync log buffer since %s. vgId:%d", tstrerror(code), pSyncNode->vgId);
|
||||||
goto _error;
|
goto _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1283,7 +1283,7 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// tools
|
// tools
|
||||||
pSyncNode->pSyncRespMgr = syncRespMgrCreate(pSyncNode, SYNC_RESP_TTL_MS);
|
(void)syncRespMgrCreate(pSyncNode, SYNC_RESP_TTL_MS, &pSyncNode->pSyncRespMgr); // TODO: check return value
|
||||||
if (pSyncNode->pSyncRespMgr == NULL) {
|
if (pSyncNode->pSyncRespMgr == NULL) {
|
||||||
sError("vgId:%d, failed to create SyncRespMgr", pSyncNode->vgId);
|
sError("vgId:%d, failed to create SyncRespMgr", pSyncNode->vgId);
|
||||||
goto _error;
|
goto _error;
|
||||||
|
@ -1294,7 +1294,8 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion) {
|
||||||
|
|
||||||
// snapshot senders
|
// snapshot senders
|
||||||
for (int32_t i = 0; i < TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA; ++i) {
|
for (int32_t i = 0; i < TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA; ++i) {
|
||||||
SSyncSnapshotSender* pSender = snapshotSenderCreate(pSyncNode, i);
|
SSyncSnapshotSender* pSender = NULL;
|
||||||
|
code = snapshotSenderCreate(pSyncNode, i, &pSender);
|
||||||
if (pSender == NULL) return NULL;
|
if (pSender == NULL) return NULL;
|
||||||
|
|
||||||
pSyncNode->senders[i] = pSender;
|
pSyncNode->senders[i] = pSender;
|
||||||
|
@ -1302,7 +1303,7 @@ SSyncNode* syncNodeOpen(SSyncInfo* pSyncInfo, int32_t vnodeVersion) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// snapshot receivers
|
// snapshot receivers
|
||||||
pSyncNode->pNewNodeReceiver = snapshotReceiverCreate(pSyncNode, EMPTY_RAFT_ID);
|
code = snapshotReceiverCreate(pSyncNode, EMPTY_RAFT_ID, &pSyncNode->pNewNodeReceiver);
|
||||||
if (pSyncNode->pNewNodeReceiver == NULL) return NULL;
|
if (pSyncNode->pNewNodeReceiver == NULL) return NULL;
|
||||||
sRDebug(pSyncNode->pNewNodeReceiver, "snapshot receiver create while open sync node, data:%p",
|
sRDebug(pSyncNode->pNewNodeReceiver, "snapshot receiver create while open sync node, data:%p",
|
||||||
pSyncNode->pNewNodeReceiver);
|
pSyncNode->pNewNodeReceiver);
|
||||||
|
@ -1887,7 +1888,7 @@ void syncNodeDoConfigChange(SSyncNode* pSyncNode, SSyncCfg* pNewConfig, SyncInde
|
||||||
// create new
|
// create new
|
||||||
for (int32_t i = 0; i < TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA; ++i) {
|
for (int32_t i = 0; i < TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA; ++i) {
|
||||||
if (pSyncNode->senders[i] == NULL) {
|
if (pSyncNode->senders[i] == NULL) {
|
||||||
pSyncNode->senders[i] = snapshotSenderCreate(pSyncNode, i);
|
snapshotSenderCreate(pSyncNode, i, &pSyncNode->senders[i]);
|
||||||
if (pSyncNode->senders[i] == NULL) {
|
if (pSyncNode->senders[i] == NULL) {
|
||||||
// will be created later while send snapshot
|
// will be created later while send snapshot
|
||||||
sSError(pSyncNode->senders[i], "snapshot sender create failed while reconfig");
|
sSError(pSyncNode->senders[i], "snapshot sender create failed while reconfig");
|
||||||
|
@ -2933,13 +2934,9 @@ int32_t syncNodeRebuildAndCopyIfExist(SSyncNode* ths, int32_t oldtotalReplicaNum
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32_t i = 0; i < TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA; ++i) {
|
for (int32_t i = 0; i < TSDB_MAX_REPLICA + TSDB_MAX_LEARNER_REPLICA; ++i) {
|
||||||
SSyncSnapshotSender* pSender = snapshotSenderCreate(ths, i);
|
SSyncSnapshotSender* pSender = NULL;
|
||||||
if (pSender == NULL) {
|
int32_t code = snapshotSenderCreate(ths, i, &pSender);
|
||||||
code = TSDB_CODE_SYN_RETURN_VALUE_NULL;
|
if (pSender == NULL) return terrno = code;
|
||||||
if (terrno != 0) code = terrno;
|
|
||||||
taosMemoryFree(oldLogReplMgrs);
|
|
||||||
TAOS_RETURN(code);
|
|
||||||
}
|
|
||||||
|
|
||||||
ths->senders[i] = pSender;
|
ths->senders[i] = pSender;
|
||||||
sSDebug(pSender, "snapshot sender create while open sync node, data:%p", pSender);
|
sSDebug(pSender, "snapshot sender create while open sync node, data:%p", pSender);
|
||||||
|
|
Loading…
Reference in New Issue