Re: Attempt to consolidate reading of XLOG page
Alvaro Herrera <alvherre@2ndquadrant.com>
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Antonin Houska <ah@cybertec.at>
Cc: Michael Paquier <michael@paquier.xyz>, Thomas Munro <thomas.munro@gmail.com>, Robert Haas <robertmhaas@gmail.com>, "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2019-11-22T22:56:32Z
Lists: pgsql-hackers
Attachments
- v12-0001-Use-only-xlogreader.c-WALRead.patch (text/x-diff)
On 2019-Nov-22, Antonin Houska wrote: > As I pointed out in > > https://www.postgresql.org/message-id/88183.1574261429%40antos > > seg.ws_off only replaced readOff in XLogReaderState. So we should only update > ws_off where readOff was updated before commit 709d003. This does happen in > ReadPageInternal (see HEAD) and I see no reason for the final patch to update > ws_off anywhere else. Oh you're right. I see no reason to leave ws_off. We can move that to XLogReaderState; I did that here. We also need the offset in WALReadError, though, so I added it there too. Conceptually it seems clearer to me this way. What do you think of the attached? BTW I'm not clear what errors can pread()/pg_pread() report that do not set errno. I think lines 1083/1084 of WALRead are spurious now. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
Commits
-
Remove logical_read_local_xlog_page
- 5d0c2d5eba6b 13.0 landed
-
Refactor WAL file-reading code into WALRead()
- 0dc8ead46363 13.0 landed
-
Rework WAL-reading supporting structs
- 709d003fbd98 13.0 landed
-
Make XLogReaderInvalReadState static
- 25dcc9d35dfe 13.0 landed
-
Use pg_pread() and pg_pwrite() for data files and WAL.
- c24dcd0cfd94 12.0 cited