[pgpool-hackers: 3157] New feature proposal: Don't load balance after a SELECT having functions specified in black function list and queries specified in black_query_pattern_list
Bo Peng
pengbo at sraoss.co.jp
Thu Nov 29 15:29:49 JST 2018
Here is a proposal for Pgpool-II 4.1.
- Current feature of load balance
If we set "disable_load_balance_on_write = transaction",
when a write query is issued inside an explicit truncation,
subsequent queries should be sent to primary only until the
end of this transactionin in order to avoid the replication
delay.
Example:
----------------------------------------
SELECT 1; -- Load balanced.
BEGIN;
UPDATE ...
SELECT 1; -- Don't be load balanced.
END;
SELECT 1; -- Load balanced.
----------------------------------------
However, in the following cases they are not regarded as a write query
and the subsequent read queries are still load balanced:
1. the SELECT having write functions specified in black_function_list
2. the queries specified in black_query_pattern_list
- Proposal
I think we should change this feature to regard
the SELECT having write functions specified in black_function_list and
the queries specified in black_query_pattern_list
as write queries.
To implement of this feature the following should be considered:
1. For backward compatibility, it's better to add a new parameter to enable this feature.
2. The queries regarded as write queries should not be cached.
What do you think?
--
Bo Peng <pengbo at sraoss.co.jp>
SRA OSS, Inc. Japan
More information about the pgpool-hackers
mailing list