This function sends a FAILOVER_AUTH_REQUEST message to every node in order to * see if there is the quorum for this slave instance to failover its failing * master. * * Note that we send the failover request to everybody, master and slave nodes, * but only the masters are supposed to reply to our query. */
| 2850 | * Note that we send the failover request to everybody, master and slave nodes, |
| 2851 | * but only the masters are supposed to reply to our query. */ |
| 2852 | void clusterRequestFailoverAuth(void) { |
| 2853 | clusterMsg buf[1]; |
| 2854 | clusterMsg *hdr = (clusterMsg*) buf; |
| 2855 | uint32_t totlen; |
| 2856 | |
| 2857 | clusterBuildMessageHdr(hdr,CLUSTERMSG_TYPE_FAILOVER_AUTH_REQUEST); |
| 2858 | /* If this is a manual failover, set the CLUSTERMSG_FLAG0_FORCEACK bit |
| 2859 | * in the header to communicate the nodes receiving the message that |
| 2860 | * they should authorized the failover even if the master is working. */ |
| 2861 | if (server.cluster->mf_end) hdr->mflags[0] |= CLUSTERMSG_FLAG0_FORCEACK; |
| 2862 | totlen = sizeof(clusterMsg)-sizeof(union clusterMsgData); |
| 2863 | hdr->totlen = htonl(totlen); |
| 2864 | clusterBroadcastMessage(buf,totlen); |
| 2865 | } |
| 2866 | |
| 2867 | /* Send a FAILOVER_AUTH_ACK message to the specified node. */ |
| 2868 | void clusterSendFailoverAuth(clusterNode *node) { |
no test coverage detected