TD-2428
This commit is contained in:
parent
69ce48ad90
commit
cea6df10a9
|
@ -949,9 +949,10 @@ static int32_t syncProcessPeerMsg(void *param, void *buffer) {
|
|||
static void syncSendPeersStatusMsgToPeer(SSyncPeer *pPeer, char ack, int8_t type, uint16_t tranId) {
|
||||
if (pPeer->peerFd < 0 || pPeer->ip == 0) return;
|
||||
|
||||
SSyncNode *pNode = pPeer->pSyncNode;
|
||||
SPeersStatus msg = {0};
|
||||
SSyncNode * pNode = pPeer->pSyncNode;
|
||||
SPeersStatus msg;
|
||||
|
||||
memset(&msg, 0, sizeof(SPeersStatus));
|
||||
syncBuildPeersStatus(&msg, pNode->vgId);
|
||||
|
||||
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 syncBuildPeersStatus(SPeersStatus *pMsg, int32_t vgId) {
|
||||
memset(pMsg, 0, sizeof(SPeersStatus));
|
||||
pMsg->head.type = TAOS_SMSG_STATUS;
|
||||
pMsg->head.vgId = vgId;
|
||||
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) {
|
||||
memset(pMsg, 0, sizeof(SFileAck));
|
||||
pMsg->head.type = TAOS_SMSG_SYNC_FILE_RSP;
|
||||
pMsg->head.vgId = vgId;
|
||||
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) {
|
||||
memset(pMsg, 0, sizeof(SFileInfo));
|
||||
pMsg->head.type = TAOS_SMSG_SYNC_FILE;
|
||||
pMsg->head.vgId = vgId;
|
||||
pMsg->head.len = sizeof(SFileInfo) - sizeof(SSyncHead);
|
||||
|
|
|
@ -100,6 +100,7 @@ static int32_t syncRestoreFile(SSyncPeer *pPeer, uint64_t *fversion) {
|
|||
&sinfo.fversion);
|
||||
|
||||
// if file not there or magic is not the same, file shall be synced
|
||||
memset(&fileAck, 0, sizeof(SFileAck));
|
||||
syncBuildFileAck(&fileAck, pNode->vgId);
|
||||
fileAck.sync = (sinfo.magic != minfo.magic || sinfo.name[0] == 0) ? 1 : 0;
|
||||
|
||||
|
|
Loading…
Reference in New Issue