If both nodes are up and able to communicate with each other then the OS should teardown the connection; why is that not happening? You stated that you’re in the cloud; cloud providers use a software network and all endpoints have ACLs — a.k.a firewall. I would also check to see if iptables is running… it on by default. Have there been changes to how you deploy new ACLs, etc? The fact that WAL sender terminated and WAL receiver did not; points to the WAL receiver not being able to communicate with the upstream server.
Again, if both nodes are up and are able to communicate then the this should get resolved on its own.
It should have reached the timeout and the connection should be torn down. It could be that the send queue is backed up and Postgres is hung on trying to teardown the connection. Again, network related issue. I’ve actually ran into this issue before; where I was unable to terminate an idle session from an application node that had an open transaction. The TCP/IP send queue was backlogged thus it would not terminate; one might consider this a bug or not. The application server was not reachable due to firewall dropping the connection and not sending a reset packet on further attempts to communicate with the application server; I had to get a network admin to drop the connection as bouncing Postgres was not an option on a production system and kill -9 is a bad idea too. Assuming this is going to happen again — I would advise you to get from both nodes the state of connection and tcp/ip queue information from netstat. If you can also to a tcpdump on the connection to see what each of the nodes is doing that would give you more insight. I would also advise looking into TCP/IP keep alive. |