Re: Pgpool is crashing when terminating user session

From: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
To: garajamohan(at)gmail(dot)com
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Pgpool is crashing when terminating user session
Date: 2020-05-16 11:55:15
Message-ID: 20200516.205515.2045846881954825697.t-ishii@sraoss.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Hello all,
>
> We are having master-slave setup with pgpool pointing, only to master
> server. Whenever i tried to terminate the long running session on db end
> using SELECT pg_terminate_backend(pid), pgpool is getting crashed. Many
> blogs are saying this is the expected behaviour of pgpool, but my question
> is there anyway to terminate unwanted sessions on db without loosing other
> connections.
>
> Because restarting entire system every time for a single trouble causing
> session is a big hectic for us. Please share you ideas on this.

Those blogs are incorrect. From Pgpool-II 3.6 Pgpool-II supports
pg_terminate_backend(). Are you sure that you use "SELECT
pg_terminate_backend(pid)" from Pgpool-II session, not from a session
directly connecting to PostgreSQL?

Port 11000 is the port Pgpool-II is listening on.

[killing session]

$ psql -p 11000 test
psql (12.2)
Type "help" for help.

test=# select pg_terminate_backend(13877);
pg_terminate_backend
----------------------
t
(1 row)

[killed session]

$ psql -p 11000 test
psql (12.2)
Type "help" for help.

test=# select pg_sleep(600);
FATAL: terminating connection due to administrator command
ERROR: unable to forward message to frontend
DETAIL: FATAL error occured on backend
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
The connection to the server was lost. Attempting reset: Succeeded.
test=#

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rob Sargent 2020-05-16 12:15:22 Re: schema agnostic functions in language sql
Previous Message Rob Sargent 2020-05-16 11:54:40 Re: schema agnostic functions in language sql