[pgpool-hackers: 4283] Re: Proposal: notice_per_node_statement
Tatsuo Ishii
ishii at sraoss.co.jp
Mon Feb 6 11:32:40 JST 2023
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: notice_per_node_statement-v2.patch
Type: text/x-patch
Size: 10213 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20230206/e6a6df5c/attachment.bin>
More information about the pgpool-hackers
mailing list