Re: pg_walinspect - a new extension to get raw WAL data and WAL stats
Robert Haas <robertmhaas@gmail.com>
From: Robert Haas <robertmhaas@gmail.com>
To: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
Cc: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>,
Jeff Davis <pgsql@j-davis.com>, Ashutosh Sharma <ashu.coek88@gmail.com>,
Andrew Dunstan <andrew@dunslane.net>, Greg Stark <stark@mit.edu>, Jeremy Schneider <schneider@ardentperf.com>,
Bruce Momjian <bruce@momjian.us>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, SATYANARAYANA NARLAPURAM <satyanarlapuram@gmail.com>, marvin_liang@qq.com,
actyzhang@outlook.com
Date: 2022-03-11T20:39:13Z
Lists: pgsql-hackers
On Thu, Mar 10, 2022 at 9:38 PM Kyotaro Horiguchi <horikyota.ntt@gmail.com> wrote: > It seems to me too rigorous that pg_get_wal_records_info/stats() > reject future LSNs as end-LSN and I think WARNING or INFO and stop at > the real end-of-WAL is more kind to users. I think the same with the > restriction that start and end LSN are required to be different. In his review just yesterday, Jeff suggested this: "Don't issue WARNINGs or other messages for ordinary situations, like when pg_get_wal_records_info() hits the end of WAL." I think he's entirely right, and I don't think any patch that does otherwise should get committed. It is worth remembering that the results of queries are often examined by something other than a human being sitting at a psql terminal. Any tool that uses this is going to want to understand what happened from the result set, not by parsing strings that may show up inside warning messages. I think that the right answer here is to have a function that returns one row per record parsed, and each row should also include the start and end LSN of the record. If for some reason the WAL records return start after the specified start LSN (e.g. because we skip over a page header) or end before the specified end LSN (e.g. because we reach end-of-WAL) the user can figure it out from looking at the LSNs in the output rows and comparing them to the LSNs provided as input. -- Robert Haas EDB: http://www.enterprisedb.com
Commits
-
Doc build fix: remove tab from filelist.sgml.
- 8638c76cc9f4 15.0 landed
-
Add contrib/pg_walinspect.
- 2258e76f90bf 15.0 landed
-
Simplify SRFs using materialize mode in contrib/ modules
- 5b81703787bf 15.0 cited
-
Invent "trusted" extensions, and remove the pg_pltemplate catalog.
- 50fc694e4374 13.0 cited