[pgpool-hackers: 4284] Re: Proposal: notice_per_node_statement

Tatsuo Ishii ishii at sraoss.co.jp
Mon Feb 6 19:21:02 JST 2023


With this patch, some regression tests could become much simpler.
Attached is the patch for 001.loadbalance,  just for an example.
In this case the script becomes 189 lines from 256 lines.

> Documentaions are included. This is the ready-for-committers patch.
> 
> Best reagards,
> --
> Tatsuo Ishii
> SRA OSS LLC
> English: http://www.sraoss.co.jp/index_en/
> Japanese:http://www.sraoss.co.jp
> 
>> Oops. Forgot to attach the patch.
>> 
>> From: Tatsuo Ishii <ishii at sraoss.co.jp>
>> Subject: [pgpool-hackers: 4275] Proposal: notice_per_node_statement
>> Date: Wed, 01 Feb 2023 10:42:23 +0900 (JST)
>> Message-ID: <20230201.104223.2059415724953622797.t-ishii at sranhm.sra.co.jp>
>> 
>>> I would like to add new "notice_per_node_statement" GUC variable to
>>> 4.5.  When this is enabled, clients receive NOTICE messages something
>>> like below.
>>> 
>>> test=# BEGIN;
>>> NOTICE:  DB node id: 0 statement: BEGIN;
>>> NOTICE:  DB node id: 1 statement: BEGIN;
>>> BEGIN
>>> test=*# SELECT 1;
>>> NOTICE:  DB node id: 1 statement: SELECT 1;
>>>  ?column? 
>>> ----------
>>>         1
>>> (1 row)
>>> 
>>> test=*# INSERT INTO t1 VALUES(1);
>>> NOTICE:  DB node id: 0 statement: INSERT INTO t1 VALUES(1);
>>> INSERT 0 1
>>> test=*# END;
>>> NOTICE:  DB node id: 1 statement: END;
>>> NOTICE:  DB node id: 0 statement: END;
>>> COMMIT
>>> 
>>> This will allow users to know which backend the queries are sent on
>>> their terminals.  However, this is not the all of the
>>> objectives. Rather, my main objective is using this for regression
>>> test. Currently we have lots of tests in the regression test to check
>>> which backend receives a query. We do it in a hard way: enable
>>> log_per_node_statement and grep log file. This is not only annoying
>>> but makes us hard to add more test cases.
>>> 
>>> By adding this feature, we can do expected/results-compare-style tests
>>> as PostgreSQL already does.
>>> 
>>> You may think we can achieve that by changing log_min_messages to LOG
>>> too. Actually not. Because pgpool issues lots of internal queries which
>>> makes it hard to create the expected files.
>>> 
>>> Attached is the PoC patch (it still lacks pgpool.conf sample updating,
>>> show pool_status change and manual changes).
>>> 
>>> Comments and suggestions are welcome.
>>> 
>>> Best reagards,
>>> --
>>> Tatsuo Ishii
>>> SRA OSS LLC
>>> English: http://www.sraoss.co.jp/index_en/
>>> Japanese:http://www.sraoss.co.jp
>>> _______________________________________________
>>> pgpool-hackers mailing list
>>> pgpool-hackers at pgpool.net
>>> http://www.pgpool.net/mailman/listinfo/pgpool-hackers
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 001.load_balance.patch
Type: text/x-patch
Size: 8829 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20230206/49deb199/attachment.bin>


More information about the pgpool-hackers mailing list