TD-2428
This commit is contained in:
parent
69ce48ad90
commit
cea6df10a9
|
@ -950,8 +950,9 @@ static void syncSendPeersStatusMsgToPeer(SSyncPeer *pPeer, char ack, int8_t type
|
||||||
if (pPeer->peerFd < 0 || pPeer->ip == 0) return;
|
if (pPeer->peerFd < 0 || pPeer->ip == 0) return;
|
||||||
|
|
||||||
SSyncNode * pNode = pPeer->pSyncNode;
|
SSyncNode * pNode = pPeer->pSyncNode;
|
||||||
SPeersStatus msg = {0};
|
SPeersStatus msg;
|
||||||
|
|
||||||
|
memset(&msg, 0, sizeof(SPeersStatus));
|
||||||
syncBuildPeersStatus(&msg, pNode->vgId);
|
syncBuildPeersStatus(&msg, pNode->vgId);
|
||||||
|
|
||||||
msg.role = nodeRole;
|
msg.role = nodeRole;
|
||||||
|
|
|
@ -88,7 +88,6 @@ void syncBuildSyncDataMsg(SSyncMsg *pMsg, int32_t vgId) { syncBuildMsg(pMsg, vgI
|
||||||
void syncBuildSyncSetupMsg(SSyncMsg *pMsg, int32_t vgId) { syncBuildMsg(pMsg, vgId, TAOS_SMSG_SETUP); }
|
void syncBuildSyncSetupMsg(SSyncMsg *pMsg, int32_t vgId) { syncBuildMsg(pMsg, vgId, TAOS_SMSG_SETUP); }
|
||||||
|
|
||||||
void syncBuildPeersStatus(SPeersStatus *pMsg, int32_t vgId) {
|
void syncBuildPeersStatus(SPeersStatus *pMsg, int32_t vgId) {
|
||||||
memset(pMsg, 0, sizeof(SPeersStatus));
|
|
||||||
pMsg->head.type = TAOS_SMSG_STATUS;
|
pMsg->head.type = TAOS_SMSG_STATUS;
|
||||||
pMsg->head.vgId = vgId;
|
pMsg->head.vgId = vgId;
|
||||||
pMsg->head.len = sizeof(SPeersStatus) - sizeof(SSyncHead);
|
pMsg->head.len = sizeof(SPeersStatus) - sizeof(SSyncHead);
|
||||||
|
@ -96,7 +95,6 @@ void syncBuildPeersStatus(SPeersStatus *pMsg, int32_t vgId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void syncBuildFileAck(SFileAck *pMsg, int32_t vgId) {
|
void syncBuildFileAck(SFileAck *pMsg, int32_t vgId) {
|
||||||
memset(pMsg, 0, sizeof(SFileAck));
|
|
||||||
pMsg->head.type = TAOS_SMSG_SYNC_FILE_RSP;
|
pMsg->head.type = TAOS_SMSG_SYNC_FILE_RSP;
|
||||||
pMsg->head.vgId = vgId;
|
pMsg->head.vgId = vgId;
|
||||||
pMsg->head.len = sizeof(SFileAck) - sizeof(SSyncHead);
|
pMsg->head.len = sizeof(SFileAck) - sizeof(SSyncHead);
|
||||||
|
@ -104,7 +102,6 @@ void syncBuildFileAck(SFileAck *pMsg, int32_t vgId) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void syncBuildFileInfo(SFileInfo *pMsg, int32_t vgId) {
|
void syncBuildFileInfo(SFileInfo *pMsg, int32_t vgId) {
|
||||||
memset(pMsg, 0, sizeof(SFileInfo));
|
|
||||||
pMsg->head.type = TAOS_SMSG_SYNC_FILE;
|
pMsg->head.type = TAOS_SMSG_SYNC_FILE;
|
||||||
pMsg->head.vgId = vgId;
|
pMsg->head.vgId = vgId;
|
||||||
pMsg->head.len = sizeof(SFileInfo) - sizeof(SSyncHead);
|
pMsg->head.len = sizeof(SFileInfo) - sizeof(SSyncHead);
|
||||||
|
|
|
@ -100,6 +100,7 @@ static int32_t syncRestoreFile(SSyncPeer *pPeer, uint64_t *fversion) {
|
||||||
&sinfo.fversion);
|
&sinfo.fversion);
|
||||||
|
|
||||||
// if file not there or magic is not the same, file shall be synced
|
// if file not there or magic is not the same, file shall be synced
|
||||||
|
memset(&fileAck, 0, sizeof(SFileAck));
|
||||||
syncBuildFileAck(&fileAck, pNode->vgId);
|
syncBuildFileAck(&fileAck, pNode->vgId);
|
||||||
fileAck.sync = (sinfo.magic != minfo.magic || sinfo.name[0] == 0) ? 1 : 0;
|
fileAck.sync = (sinfo.magic != minfo.magic || sinfo.name[0] == 0) ? 1 : 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue