Abort session if failover/failback is ongoing.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 2 Apr 2019 03:56:01 +0000 (12:56 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Tue, 2 Apr 2019 03:56:01 +0000 (12:56 +0900)
commit66b5aacfcc045ec1485921a5884b637fcfb6fd73
tree63cea9512fd29ac2b7bcf744edbf2d479a11d6ff
parent1099ba610eef06a9dab6f89486cc52de55ff3ebb
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.
src/context/pool_query_context.c