[pgpool-hackers: 3348] Re: New feature proposal: Don't load balance after a SELECT having functions specified in black function list

Bo Peng pengbo at sraoss.co.jp
Mon Jul 1 13:00:21 JST 2019


This feature is committed.

https://git.postgresql.org/gitweb/?p=pgpool2.git;a=commit;h=3ddf9aa0b20480b22bb5e8fc6097f2eb7cb56994

This commit will disable load balance after a SELECT having functions
specified in black/white function list.

On Thu, 29 Nov 2018 15:29:49 +0900
Bo Peng <pengbo at sraoss.co.jp> wrote:

> 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
> 
> _______________________________________________
> pgpool-hackers mailing list
> pgpool-hackers at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-hackers
> 


-- 
Bo Peng <pengbo at sraoss.co.jp>
SRA OSS, Inc. Japan



More information about the pgpool-hackers mailing list