<div dir="ltr"><div>Hi,</div><div>So long story short, I'm migrating a PG13 cluster from RHEL to Ubuntu 24.04. In the process, the pgpool version is also being upgraded to 4.6 (from 4.2). There is also repmgr running on this 4 node cluster, 1 primary and 3 replicas.  All the migration seems to have completed successfully, but I've ran into a weird problem with pgpool.  I have quite a few errors that look like the below entries, and it seems to "come and go" when checking pgpool log.  The process itself, seems to work (I think), but every now and then, these errors (warnings?) show up:</div><div><br></div><div>2025-06-01 09:11:00: pid 628043: DEBUG:  watchdog heartbeat: send heartbeat signal to db-replica3-priv:9694<br>2025-06-01 09:11:00: pid 628043: LOCATION:  wd_heartbeat.c:771<br>2025-06-01 09:11:00: pid 627958: LOG:  exit handler called (signal: 2)<br>2025-06-01 09:11:00: pid 627958: LOCATION:  pgpool_main.c:1272<br><b>2025-06-01 09:11:00: pid 627958: WARNING:  failed to lock semaphore<br>2025-06-01 09:11:00: pid 627958: DETAIL:  Invalid argument<br></b>2025-06-01 09:11:00: pid 627958: LOCATION:  pool_sema.c:129<br>2025-06-01 09:11:00: pid 627958: WARNING:  failed to unlock semaphore<br>2025-06-01 09:11:00: pid 627958: DETAIL:  Invalid argument<br>2025-06-01 09:11:00: pid 627958: LOCATION:  pool_sema.c:202<br>2025-06-01 09:11:00: pid 627958: LOG:  shutting down by signal 2<br>2025-06-01 09:11:00: pid 627958: LOCATION:  pgpool_main.c:1324<br>2025-06-01 09:11:00: pid 627958: LOG:  terminating all child processes<br>2025-06-01 09:11:00: pid 627958: LOCATION:  pgpool_main.c:1334<br>2025-06-01 09:11:00: pid 628047: WARNING:  failed to lock semaphore<br>2025-06-01 09:11:00: pid 628047: DETAIL:  Invalid argument<br>2025-06-01 09:11:00: pid 628047: LOCATION:  pool_sema.c:129<br>2025-06-01 09:11:00: pid 628042: WARNING:  failed to lock semaphore<br>2025-06-01 09:11:00: pid 628042: DETAIL:  Invalid argument<br>2025-06-01 09:11:00: pid 628042: LOCATION:  pool_sema.c:129<br>2025-06-01 09:11:00: pid 628039: WARNING:  failed to lock semaphore<br>2025-06-01 09:11:00: pid 628039: DETAIL:  Invalid argument<br></div><div><br></div><div><br></div><div>Also, earlier in the log, I see errors about being unable to create a socket, for some reason it's trying (and failing) to create socket on localhost (<a href="http://127.0.0.1:9694">127.0.0.1:9694</a>) and  "creating socket on ::1:9694".  Are these "ok to ignore"?</div><div><br></div><div>2025-06-01 09:11:23: pid 634772: DETAIL:  creating socket on <a href="http://127.0.0.1:9694">127.0.0.1:9694</a><br>2025-06-01 09:11:23: pid 634772: LOCATION:  wd_heartbeat.c:385<br>2025-06-01 09:11:23: pid 634772: LOG:  set SO_REUSEPORT option to the socket<br>2025-06-01 09:11:23: pid 634772: LOCATION:  wd_heartbeat.c:891<br>2025-06-01 09:11:23: pid 634772: LOG:  creating watchdog heartbeat receive socket.<br>2025-06-01 09:11:23: pid 634772: DETAIL:  creating socket on ::1:9694<br>2025-06-01 09:11:23: pid 634772: LOCATION:  wd_heartbeat.c:385<br>2025-06-01 09:11:23: pid 634772: LOG:  failed to create watchdog heartbeat receive socket. retrying...<br>2025-06-01 09:11:23: pid 634772: DETAIL:  bind failed with reason: "Cannot assign requested address"<br>2025-06-01 09:11:23: pid 634772: LOCATION:  wd_heartbeat.c:394<br><br></div><div><br></div><div>2025-06-01 09:11:22: pid 635274: DEBUG:  verify_backend_node_status: true_primary 0<br>2025-06-01 09:11:22: pid 635274: LOCATION:  pgpool_main.c:2704<br>2025-06-01 09:11:22: pid 635274: DEBUG:  node status[0]: 1<br>2025-06-01 09:11:22: pid 635274: LOCATION:  pool_worker_child.c:267<br>2025-06-01 09:11:22: pid 635274: DEBUG:  node status[1]: 2<br>2025-06-01 09:11:22: pid 635274: LOCATION:  pool_worker_child.c:267<br>2025-06-01 09:11:22: pid 635274: DEBUG:  node status[2]: 2<br>2025-06-01 09:11:22: pid 635274: LOCATION:  pool_worker_child.c:267<br>2025-06-01 09:11:22: pid 635274: DEBUG:  node status[3]: 2<br>2025-06-01 09:11:22: pid 635274: LOCATION:  pool_worker_child.c:267<br>2025-06-01 09:11:22: pid 635274: DEBUG:  pool_release_follow_primary_lock called<br>2025-06-01 09:11:22: pid 635274: LOCATION:  pgpool_main.c:4106<br>2025-06-01 09:11:23: pid 634765: LOG:  set SO_REUSEPORT option to the socket<br>2025-06-01 09:11:23: pid 634765: LOCATION:  wd_heartbeat.c:891<br>2025-06-01 09:11:23: pid 634765: LOG:  creating watchdog heartbeat receive socket.<br>2025-06-01 09:11:23: pid 634765: DETAIL:  creating socket on <a href="http://127.0.0.1:9694">127.0.0.1:9694</a><br>2025-06-01 09:11:23: pid 634765: LOCATION:  wd_heartbeat.c:385<br>2025-06-01 09:11:23: pid 634765: LOG:  set SO_REUSEPORT option to the socket<br>2025-06-01 09:11:23: pid 634765: LOCATION:  wd_heartbeat.c:891<br>2025-06-01 09:11:23: pid 634765: LOG:  creating watchdog heartbeat receive socket.<br><b>2025-06-01 09:11:23: pid 634765: DETAIL:  creating socket on ::1:9694<br>2025-06-01 09:11:23: pid 634765: LOCATION:  wd_heartbeat.c:385<br>2025-06-01 09:11:23: pid 634765: LOG:  failed to create watchdog heartbeat receive socket. retrying...<br></b>2025-06-01 09:11:23: pid 634765: DETAIL:  bind failed with reason: "Cannot assign requested address"<br>2025-06-01 09:11:23: pid 634765: LOCATION:  wd_heartbeat.c:394<br>2025-06-01 09:11:23: pid 634767: LOG:  set SO_REUSEPORT option to the socket<br>2025-06-01 09:11:23: pid 634767: LOCATION:  wd_heartbeat.c:891<br>2025-06-01 09:11:23: pid 634767: LOG:  creating socket for sending heartbeat<br>2025-06-01 09:11:23: pid 634767: DETAIL:  set SO_REUSEPORT</div><div><br></div><div><br></div><div>Other odd errors I see in the logs later on are when pgpool tries to run escalation script - can't quite find where it's failing to find ipv4 address:</div><div><br></div><div>2025-06-01 00:07:15: pid 395780: LOG:  Pgpool-II parent process received SIGUSR1<br>2025-06-01 00:07:15: pid 395780: LOG:  Pgpool-II parent process received watchdog quorum change signal from watchdog<br>2025-06-01 00:07:15: pid 396973: LOG:  watchdog: escalation started<br>2025-06-01 00:07:15: pid 395786: LOG:  Setting failover command timeout to 135<br>2025-06-01 00:07:15: pid 395780: LOG:  watchdog cluster now holds the quorum<br>2025-06-01 00:07:15: pid 395780: DETAIL:  updating the state of quarantine backend nodes<br>Sun Jun  1 12:07:15 AM CEST 2025 <br><b>escalation.sh: - remove VIP IP from all nodes<br>Node: db-primary-priv<br>Error: ipv4: Address not found.<br>Node: db-replica1-priv<br>Error: ipv4: Address not found.<br>Node: db-replica2-priv<br>Error: ipv4: Address not found.<br>Node: db-replica3-priv<br>Error: ipv4: Address not found.<br></b>2025-06-01 00:07:20: pid 396973: LOG:  watchdog escalation successful<br>2025-06-01 00:07:23: pid 396973: LOG:  successfully acquired the delegate IP:"192.168.77.130"<br>2025-06-01 00:07:23: pid 396973: DETAIL:  'if_up_cmd' returned with success<br>2025-06-01 00:07:23: pid 395786: LOG:  watchdog escalation process with pid: 396973 exit with SUCCESS.<br>2025-06-01 00:07:27: pid 395962: WARNING:  failed to lock semaphore<br>2025-06-01 00:07:27: pid 395962: DETAIL:  Invalid argument<br>2025-06-01 00:07:27: pid 395962: WARNING:  failed to unlock semaphore <br>2025-06-01 00:07:27: pid 395962: DETAIL:  Invalid argument <br>2025-06-01 00:07:28: pid 396924: WARNING:  failed to lock semaphore<br>2025-06-01 00:07:28: pid 396924: DETAIL:  Invalid argument<br></div><div><br></div><div>The way I started was I copied pgpool.conf from the "old" and working pgpool 4.2 configuration and modified it slightly, though nothing major,changed hostnames and i.e. delegate_ip variable name was changed from delegate_IP.  Also added this variable as without it, I didn't see a socket created for port 9898:</div><div>unix_socket_directories = '/var/run/postgresql'<br></div><div>I had to change network interfaces as well, in the RHEL it was using eth0 where on Ubuntu it's ens18, so I changed lines like:</div><div>/usr/bin/sudo /sbin/ip addr add $_IP_$/23 dev ens18 label ens18:0</div><div>Other thing I had to change was path to arping as on Ubuntu 24 it's in /usr/bin (not sbin)</div><div> arping_cmd = '/usr/bin/sudo /usr/bin/arping -U $_IP_$ -w 1 -I ens18'</div><div><br></div><div>The other thing I'm confused about, I have two network interfaces on each host, i.e.</div><div><a href="http://192.168.77.135/23">192.168.77.135/23</a> brd 192.168.77.255 scope global ens18</div><div>and </div><div>inet <a href="http://192.168.78.135/24">192.168.78.135/24</a> brd 192.168.78.255 scope global ens19<br></div><div><br></div><div>In pgpool.conf, it is referencing the "priv" hosts (i.e. heartbeat_hostname2 = 'db-replica2-priv'), which theoretically should be on ens19 network interface as shown above, but in my old pgpool.conf, it was only referencing eth0 on RHEL, even though "priv" hosts were on eth1.  I'm wondering if that needs to be changed in Ubuntu or it makes no difference here?</div><div><br></div><div> Right now, I can't quite figure out whether it is something with pgpool.conf or with the Ubuntu settings and the semaphore error is quite cryptic.  If you need me to post some parts of my pgpool.conf, please advise which.  I've seen an older version of the FAQ that said repmgr and pgpool don't work together but then I saw mention that this was no longer the case.</div><div><br></div><div><div>I would much appreciate any help you can provide in solving this problem. </div><br></div></div>