[pgpool-general: 9154] Re: Pgpool shutdown on terminating a pid in database.
Tatsuo Ishii
ishii at sraoss.co.jp
Wed Jun 26 15:53:24 JST 2024
From: Tatsuo Ishii <ishii at sraoss.co.jp>
Subject: [pgpool-general: 9153] Re: Pgpool shutdown on terminating a pid in database.
Date: Wed, 26 Jun 2024 15:51:54 +0900 (JST)
Message-ID: <20240626.155154.823541925168804511.t-ishii at sranhm.sra.co.jp.sranhm>
>> 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.
I meant "expected".
> Best reagards,
> --
> Tatsuo Ishii
> SRA OSS LLC
> English: http://www.sraoss.co.jp/index_en/
> Japanese:http://www.sraoss.co.jp
> _______________________________________________
> pgpool-general mailing list
> pgpool-general at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-general
More information about the pgpool-general
mailing list