[pgpool-general: 9153] Re: Pgpool shutdown on terminating a pid in database.

Tatsuo Ishii ishii at sraoss.co.jp
Wed Jun 26 15:51:54 JST 2024


> Hello,
> 
> I have a docker swarm architecture of 2 PostgreSQL nodes in Repmgr and a
> connection pooling method, pgool.
> 
> PostgreSQL Version: 12.4
> PgPool Version: 4.2.5
> Cluster-Management of Database: Repmgr (1 Primary + 1 Standby)
> 
> *Issue:* There was constant increase in CPU Usage by postgresql container.
> On checking docker stats of postgresql primary node, it is consuming 328%.
> On normal days, it is below 50%.
> On investigation, I found one query whose running time was around 20 hours
> and its state was idle in transaction.
> 
> Resolution: To control the CPU Usage, I terminated the pid in database
> using below query:
>>  SELECT pg_terminate_backend(4037086);
> 
> But immediately after the pid was killed. The pgpool container  was shut
> down.

If you sent the query directly to PostgreSQL (not via pgpool), that's an
expected behavior.
See https://www.pgpool.net/docs/42/en/html/restrictions.html
> If you use pg_terminate_backend() to stop a backend, this will trigger a failover.

If you sent the query via pgpool and got the shutdown then it's not
unexpected. Please file a bug report.

Best reagards,
--
Tatsuo Ishii
SRA OSS LLC
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp



More information about the pgpool-general mailing list