Fix unnecessary degeneration caused by error on commit.
authorTatsuo Ishii <ishii@postgresql.org>
Sun, 2 Jun 2013 11:17:23 +0000 (20:17 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Sun, 2 Jun 2013 11:17:23 +0000 (20:17 +0900)
commit6d8c6d26d52a3b06b6cf33012824a37c0a0913bb
treec39ae7bf6fbaaa8954dd7d11b972eadcf34ae81a
parentc63a92ef6dc4e0bc7bda7eaeb170e1b61c1ffa52
Fix unnecessary degeneration caused by error on commit.

A commit could fail by certain condition including deferred
triggers. If the trigger is related to DML, only the primary fails
because standbys never gets executed such DML in streaming replication
mode. This lead to "kind mismatch error", which causes failover or
session close. This is reported in bug #60, and the reporter claims
that it should not trigger the failover or the session close, rather
continue the session and just report the error on the primary. I think
his complain is fair since in replication mode, such error does not
cause failover or session close. So I make read_kind_from_backend() a
little smarter to not cause failover or session close if only primary
fails on commit in streaming replication mode.
pool_process_query.c