Fix bug with "SET TRANSACTION READ ONLY".
authorTatsuo Ishii <ishii@postgresql.org>
Wed, 2 Dec 2015 12:48:59 +0000 (21:48 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Wed, 2 Dec 2015 12:48:59 +0000 (21:48 +0900)
commitec3859b3fb7ade62f344c4dd87f48480686b0ec2
treebe0377214f35b3395af436c158e64f96b9039ee9
parent2ce2046a433ef5430a794fd77ebeef15a383d987
Fix bug with "SET TRANSACTION READ ONLY".

Pgpool-II remembers that non read only queries (including SET) were
executed in an explicit transaction and adds a "writing transaction"
mark to the transaction. The mark affects the query routing behavior
of pgpool-II while running in streaming replication mode. Pgpool-II
starts sending queries to the primary after the mark is set. Because
the effect of writing queries may appear on standbys after some delay
in streaming replication mode, it is safer to route read queries to
the primary after the mark is set.

However there's oversight here. "SET TRANSACTION READ ONLY" does no
data modification and should be treated as an exception.

Per bug #157.
pool_proto_modules.c
pool_query_context.c
pool_query_context.h