[pgpool-hackers: 4471] [PATCH] printing empty row first in query "show pool_process"
keiseo
keiseo at protonmail.com
Wed Jun 12 10:56:00 JST 2024
Hello, I want to fix a minor thing, which is might not a critical thing.
kashif_zeeshan([kashif.z at bitnine.net](https://www.pgpool.net/mailman/listinfo/pgpool-hackers)) also shared this to me, and I had the same thing.
-- reporting (cutoff)
The problem is "show processes" query showing empty row result first.
postgres at master:/tmp$ psql -h localhost -p 11000 -c "show pool_processes;"
pool_pid | start_time | cl
----------+------------+---
(0 rows)
pool_pid |
----------+----------------
56 | 2024-06-12 09:2
57 | 2024-06-12 09:2
58 | 2024-06-12 09:2
(3 rows)
( tested with pool: 4.4.6 (nurikoboshi), pg: PostgreSQL 15.7 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0, 64-bit )
you can reproduce this since pool V4_2, with pg 15,16.
-- analysis
In short, because of send_row_description calling twice, psql like client showing emptry row result first before actual contents, that are, process informations.
Since branch V4_2, anew function was added which is the send_row_description_and_data_rows().
That function sends these FE/BE protocol data to the destination as properly like this.
RowDescription
DataRow
CommandComplete
ReadyForQuery
But the problem is, since V4_2, process_reporting() function itself sends FE/BE protocol data as a result like this.
RowDescription
RowDescription
DataRow
CommandComplete
ReadyForQuery
First RowDescription called without following Datarow protocol data. So I think, this is the main reason why zero row printed
and the reason why RowDescription is called twice, send_row_description() is still called before send_row_description_and_data_rows().
by the way, V4_1 is fine because calling send_row_description() then sending DataRow.
-- additional reporting.
The one thing confusing my decision is thepg14 does not print empty row first so totally looks fine like this.
postgres at master:/tmp$ psql -h localhost -p 11000 -c "show pool_processes;"
pool_pid | start_time
----------+---------------------
56 | 2024-06-12 09:58:08
58 | 2024-06-12 09:58:08
59 | 2024-06-12 09:58:08
(3 rows)
( tested with pool: 4.4.6 (nurikoboshi), pg: PostgreSQL 14.12 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0, 64-bit )
-- suggestion
Even if it looks like fine, I think that we should following FE/BE protocol properly.
Oh. This is my suggestion, and you can suggest or tell me whatever you want.
anyway, Could you please review my opinion?
-- attachment
I made patch files similarly like others do. well...
- level 5 logs for FE/BE protocol tracking.
- master branch patch
- V4_2 branch patch
- V4_3 branch patch
- V4_4 branch patch
- V4_5 branch patch
Regards
Kwangwon Seo
Bitnine Global Inc.
www.bitnine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20240612/2c2433e7/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug_pool_process.log
Type: text/x-log
Size: 18287 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20240612/2c2433e7/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-pgpool-show-processes-showing-empty-row-first_V4_2_STABLE.patch
Type: text/x-patch
Size: 1102 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20240612/2c2433e7/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-pgpool-show-processes-showing-empty-row-first_master.patch
Type: text/x-patch
Size: 1102 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20240612/2c2433e7/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-pgpool-show-processes-showing-empty-row-first_V4_5_STABLE.patch
Type: text/x-patch
Size: 1102 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20240612/2c2433e7/attachment-0009.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-pgpool-show-processes-showing-empty-row-first_V4_4_STABLE.patch
Type: text/x-patch
Size: 1102 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20240612/2c2433e7/attachment-0010.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-pgpool-show-processes-showing-empty-row-first_V4_3_STABLE.patch
Type: text/x-patch
Size: 1102 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20240612/2c2433e7/attachment-0011.bin>
More information about the pgpool-hackers
mailing list