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.
node_get_local_addr() needs return value initialization. Return value is stored into caller's area and if it is not initialized properly, caller may (due to his own variable settings) regard this as an error.
Somehow, length of the host name embedded in MSG_NODE_REGISTER message is not sent to GTM-ACT correctly.