Fix bug #303.
authorTatsuo Ishii <ishii@postgresql.org>
Thu, 3 Aug 2017 02:52:24 +0000 (11:52 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Thu, 3 Aug 2017 02:52:24 +0000 (11:52 +0900)
commit2c54c4b6f3fc4f36ceda528ec8ab00ad723030d4
tree8f483fd4fe041f41cd3163ee87552e4976e45903
parent8e984d1a78e9837d1a253fc050bd984dbbb835ff
Fix bug #303.

When failover is triggered by worker process, it is possible that
wrong DB node could failover. This is due to the db_node_id member in
the POLL_CONNECTION structure is not initialized in the process (in
child process the member is properly initialized). To solve the
problem, add new function pool_set_db_node_id() to set the structure
member variable and call it inside
make_persistent_db_connection(). For this purpose also the new
parameter "db_node_id" is added to make_persistent_db_connection and
friends.
src/include/pool.h
src/include/utils/pool_stream.h
src/main/health_check.c
src/main/pgpool_main.c
src/protocol/child.c
src/streaming_replication/pool_worker_child.c
src/utils/pool_stream.c