Fix unnecessary fsync to pgpool_status file.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 18 Mar 2019 00:34:02 +0000 (09:34 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 18 Mar 2019 00:34:02 +0000 (09:34 +0900)
commitdf068508a1cb97c374328c6ea725b5c8f947ba05
tree2b1c993c950d1fe510f455a1ccfb8e21ed64d08e
parentc70d7d5bd3cb34ac05def078eda3f9145f976a32
Fix unnecessary fsync to pgpool_status file.

Whenever new connections are created to PostgreSQL backend, fsync()
was issued to pgpool_status file, which could generate excessive I/O
in certain conditions, for example num_init_children is large and
connections to backend have certain life time limit.

So reduce the chance of issuing fsync() so that it is issued only when
backend status is changed from CON_CONNECT_WAIT or others to CON_UP.
If the status is already CON_UP, we don't need to write to
pgpool_status.

Discussion: [pgpool-general: 6436] High I/O Usage on PGPool nodes
src/protocol/pool_connection_pool.c