While running any query that fetches the next/current sequence value, you might encounter the below error message.
"ERROR","58M01","Interconnect Error: Could not connect to seqserver. (seg0 slice1 sdw1:40000 pid=18284)","Network is unreachable (connect errno 101)",,,,,"insert into test_seq (id) select nextval('test_emc') ;",0,,"cdbdisp.c",1475,
When running queries with sequences - the nextval and currval are fetched by connecting to seqserver demon which runs on master, which is in turn controlled by the main postmaster process
gpadmin 23673 23649 0 03:46 ? 00:00:00 postgres: port 48000, seqserver process
If in any case the process demon is not reachable from/by the segments then queries with sequences will not get executed and would fail with similar error mentioned above.
In this scenario, the segment processes were unable to contact the seqserver process because of duplicate entries in master /etc/hosts.
- Check the host file on master server (mdw) for any duplicate entry as shown below:
10.x.x.x mdw-ext1 ec-gp-mas-01 ec-gp-mas-01.local mdw 172.x.x.x mdw mdw-1
- The value associated with ip 172.x.x.x needs to be modified/removed ( might need root access ),modified host file now looks like:
10.x.x.x mdw-ext1 ec-gp-mas-01 ec-gp-mas-01.local mdw 172.x.x.x mdw-1
- Save the file and you should be able to run the queries with sequences now.