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

Tatsuo Ishii ishii at sraoss.co.jp
Wed Feb 1 10:43:58 JST 2023


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: notice_per_node_statement.patch
Type: text/x-patch
Size: 4505 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20230201/bc3038a8/attachment.bin>


More information about the pgpool-hackers mailing list