commit
1d7f65e1ae
|
@ -118,7 +118,7 @@ typedef struct SsyncPeer {
|
|||
uint32_t ip;
|
||||
uint16_t port;
|
||||
char fqdn[TSDB_FQDN_LEN]; // peer ip string
|
||||
char id[TSDB_EP_LEN+16]; // peer vgId + end point
|
||||
char id[TSDB_EP_LEN + 32]; // peer vgId + end point
|
||||
int8_t role;
|
||||
int8_t sstatus; // sync status
|
||||
uint64_t version;
|
||||
|
|
|
@ -622,7 +622,7 @@ static SSyncPeer *syncCheckMaster(SSyncNode *pNode) {
|
|||
if (onlineNum <= replica * 0.5) {
|
||||
if (nodeRole != TAOS_SYNC_ROLE_UNSYNCED) {
|
||||
nodeRole = TAOS_SYNC_ROLE_UNSYNCED;
|
||||
pNode->peerInfo[pNode->selfIndex]->role = nodeRole;
|
||||
//pNode->peerInfo[pNode->selfIndex]->role = nodeRole;
|
||||
(*pNode->notifyRole)(pNode->ahandle, nodeRole);
|
||||
sInfo("vgId:%d, change to unsynced state, online:%d replica:%d", pNode->vgId, onlineNum, replica);
|
||||
}
|
||||
|
@ -671,7 +671,7 @@ static void syncCheckRole(SSyncPeer *pPeer, SPeerStatus peersStatus[], int8_t ne
|
|||
int8_t selfOldRole = nodeRole;
|
||||
int8_t i, syncRequired = 0;
|
||||
|
||||
pNode->peerInfo[pNode->selfIndex]->version = nodeVersion;
|
||||
//pNode->peerInfo[pNode->selfIndex]->version = nodeVersion;
|
||||
pPeer->role = newRole;
|
||||
|
||||
sDebug("%s, own role:%s, new peer role:%s", pPeer->id, syncRole[nodeRole], syncRole[pPeer->role]);
|
||||
|
@ -923,7 +923,7 @@ static int syncReadPeerMsg(SSyncPeer *pPeer, SSyncHead *pHead, char *cont) {
|
|||
static int syncProcessPeerMsg(void *param, void *buffer) {
|
||||
SSyncPeer *pPeer = param;
|
||||
SSyncHead head;
|
||||
char * cont = (char *)buffer;
|
||||
char * cont = buffer;
|
||||
|
||||
SSyncNode *pNode = pPeer->pSyncNode;
|
||||
pthread_mutex_lock(&(pNode->mutex));
|
||||
|
|
|
@ -108,8 +108,7 @@ int main(int argc, char *argv[]) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void arbProcessIncommingConnection(int connFd, uint32_t sourceIp)
|
||||
{
|
||||
static void arbProcessIncommingConnection(int connFd, uint32_t sourceIp) {
|
||||
char ipstr[24];
|
||||
tinet_ntoa(ipstr, sourceIp);
|
||||
sDebug("peer TCP connection from ip:%s", ipstr);
|
||||
|
@ -128,6 +127,7 @@ static void arbProcessIncommingConnection(int connFd, uint32_t sourceIp)
|
|||
return;
|
||||
}
|
||||
|
||||
firstPkt.fqdn[sizeof(firstPkt.fqdn) - 1] = 0;
|
||||
snprintf(pNode->id, sizeof(pNode->id), "vgId:%d peer:%s:%d", firstPkt.sourceId, firstPkt.fqdn, firstPkt.port);
|
||||
if (firstPkt.syncHead.vgId) {
|
||||
sDebug("%s, vgId in head is not zero, close the connection", pNode->id);
|
||||
|
|
Loading…
Reference in New Issue