Suppress unnecessary error message when there's no standby server.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 10 Feb 2020 10:04:48 +0000 (19:04 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Mon, 10 Feb 2020 10:04:48 +0000 (19:04 +0900)
commit6222cb3ad9e29e9d77b8c39ed79322e760fe73e3
tree561f96c5a869679bd80ad9bbb579985471186bac
parentd847702e8d8998ce5f593a3bcc3cbf948fb98260
Suppress unnecessary error message when there's no standby server.

Even of there's no standby server anymore, worker process keeps on
checking result row from pg_stat_replication(). If
pg_stat_replication() returns no row, the worker process complained it
every sr_check_period and the log was flooded by them. To prevent this
get_query_result() is changed to return -2 if there's no row in the
result. Also the error message in get_query_result() is downgraded
from LOG to DEBUG1. If -2 is returned and number of active standby is
less than 1 the caller does not complain any more.
src/streaming_replication/pool_worker_child.c