[pgpool-committers: 5620] pgpool: Abort session if failover/failback is ongoing.

Tatsuo Ishii ishii at sraoss.co.jp
Fri Apr 5 13:04:54 JST 2019


Abort session if failover/failback is ongoing.

If failover/failback is ongoing, there would be a risk that MASTER
node macro cannot be used. If used, it could raise a segfault because
connection to the master node is NULL or bogus.

There are several reports suspected to be caused by this (see bug 481,
482 for example).

Now the guts of the MASTER* macro (pool_virtual_master_db_node_id())
is modified to check Req_info->switching which is true while
failover/failback is ongoing. If true, emit warning message and exit
the process. There's still a small window I know, but this should
greatly reduce the chance to access bogus MASTER connection without
using any locking.

Branch
------
V4_0_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=816d50860346efc2ae61b574562317bad1742bed

Modified Files
--------------
src/context/pool_query_context.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)



More information about the pgpool-committers mailing list