Menu

GTM-Standby

Koichi Suzuki
There is a newer version of this page. You can find it here.

Problem

With HA_Support branch, GTM-proxy successfully register itself to the GTM, but datanode fails.

Format of the registration message is as follows:

   if (gtmpqPutMsgStart('C', true, conn) ||
       gtmpqPutInt(MSG_NODE_REGISTER, sizeof (GTM_MessageType), conn) ||
       gtmpqPutnchar((char *)&type, sizeof(GTM_PGXCNodeType), conn) ||
       gtmpqPutnchar((char *)&nodenum, sizeof(GTM_PGXCNodeId), conn) ||
       gtmpqPutInt(strlen(host), sizeof (GTM_StrLen), conn) ||
       gtmpqPutnchar(host, strlen(host), conn) ||
       gtmpqPutnchar((char *)&port, sizeof(GTM_PGXCNodePort), conn) ||
       gtmpqPutnchar((char *)&proxynum, sizeof(GTM_PGXCNodeId), conn) ||
       gtmpqPutInt(strlen(datafolder), sizeof (GTM_StrLen), conn) ||
       gtmpqPutnchar(datafolder, strlen(datafolder), conn) ||
       gtmpqPutInt(status, sizeof(GTM_PGXCNodeStatus), conn))
       goto send_failed;

Compared with GTM-non-standby, two data were added:

1) host, including the length indicator, 2) Status.

Then, in the GTM-Proxy, this is handled by the function ProcessPGXCNodeCommand(). Different from the original version, it then tries to convert the IP address of the other pier (datanode/coordinator) into the host name using getaddrinfo(). Somehow, the host information sent with the above command is not consumed in GTM-Proxy.

Should look into this a bit more in detail.


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.