Fix inappropriate ereport call in VALID_BACKEND.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 4 Oct 2019 04:52:19 +0000 (13:52 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 4 Oct 2019 05:05:03 +0000 (14:05 +0900)
commit58790a8f48f426f6ee424f76a53d118e14d4fcc8
tree8923655b8fdc1ff28b2766c635260da535d009ea
parent268021bbcc21454ed580809d1c0b355891687942
Fix inappropriate ereport call in VALID_BACKEND.

VALID_BACKEND (more precisely pool_virtual_master_db_node_id) macro
emitted message if pgpool is performing failover/failback:

ereport(WARNING,
(errmsg("failover/failback is in progress"),
errdetail("executing failover or failback on backend"),
 errhint("In a moment you should be able to reconnect to the database")));

This could be called within signal handlers and
POOL_SETMASK(&BlockSig)/POOL_SETMASK(&UnBlockSig) was called to block
an interrupt because ereport is not reentrant. However it is possible
that callers have already called POOL_SETMASK, and this could result
unwanted signal unblock.

Fix is, removing ereport and POOL_SETAMASK all together. This results
in removing the message above but we have no choice.

I found the problem while investigating regression
055.backend_all_down failure but of course the bug could have bitten
users in other places.
src/context/pool_query_context.c