[pgpool-hackers: 2803] Re: [New feature] Enable specifying SQL patterns lists that should not be load-balanced.

Bo Peng pengbo at sraoss.co.jp
Wed May 16 17:06:44 JST 2018


Hi Ishii-san

Thank you for reviewing my patch.

I will fix that.

On Tue, 15 May 2018 09:06:34 +0900 (JST)
Tatsuo Ishii <ishii at sraoss.co.jp> wrote:

> Here are some comments for your patch.
> 
> (1) This patch addes some trailing whitespaces. Please remove them.
> 
> $ git apply ~/black_query.diff 
> /home/t-ishii/black_query.diff:27: trailing whitespace.
> SQL のマッチングに正規表現を使うことができます。 
> /home/t-ishii/black_query.diff:146: trailing whitespace.
>             If SQL matches both <xref linkend="guc-black-function-list"> and 
> /home/t-ishii/black_query.diff:147: trailing whitespace.
>             <xref linkend="guc-white-function-list">, <xref linkend="guc-white-function-list"> 
> /home/t-ishii/black_query.diff:148: trailing whitespace.
>             setting is ignored and the SQL should be sent only to the primary node. 
> /home/t-ishii/black_query.diff:440: trailing whitespace.
> 				else 
> warning: squelched 16 whitespace errors
> warning: 21 lines add whitespace errors.
> 
> (2) I suggest to add version number to the patch file so that we can
> easily distinguish each patch version.
> 
> (3) You need to add entries for this to
> src/utils/pool_process_reporting.c.
> 
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
> 
> > Great. I will look into this.
> > 
> > Best regards,
> > --
> > Tatsuo Ishii
> > SRA OSS, Inc. Japan
> > English: http://www.sraoss.co.jp/index_en.php
> > Japanese:http://www.sraoss.co.jp
> > 
> >> Hi All
> >> 
> >> Here is a patch for new feature "Enable specifying 
> >> SQL patterns lists that should not be load-balanced".
> >> 
> >> Even though currently we can do this by adding the 
> >> /*NO LOAD BALANCE*/ comment to queries, this requires 
> >> modifying application codes and this is not always 
> >> possible.
> >> 
> >> This feature enables specifying SQL patterns lists 
> >> that should not be load-balanced.
> >> 
> >> -------------
> >> New parameter
> >> -------------
> >> black_query_pattern_list = ''
> >> 
> >> You can specify a semicolon separated list of SQL patterns 
> >> that should be sent to primary node only. 
> >> 
> >> SQL that matched patterns specified in this list are not load balanced. 
> >> Only Maste Slave mode is supported.
> >> 
> >> You can use regular expression to match SQL patterns, 
> >> to which ^ and $ are automatically added. 
> >> When using characters such as "'", ";" or "*" in SQL patterns, 
> >> you need to escape them using "\". 
> >> 
> >> 
> >> Example: 
> >> 
> >> If the following SQL should be sent to the primary node only,
> >> 
> >>     SELECT * FROM table_name1;
> >> 
> >>     SELECT * FROM table_name2 WHERE col LIKE '%a%';
> >> 
> >>     SQL including table_nama3 
> >> 
> >> You can set the black_query_pattern_list like below:
> >> 
> >> black_query_pattern_list = 'SELECT \* FROM table_name1\;;SELECT col1, col2 FROM table_name2 WHERE col1 LIKE \\'%a%\\'\;;.*table_name3.*'
> >>           
> >> -- 
> >> 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