Re: Attempt to consolidate reading of XLOG page
Antonin Houska <ah@cybertec.at>
From: Antonin Houska <ah@cybertec.at>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Date: 2019-05-02T16:17:36Z
Lists: pgsql-hackers
Attachments
- v02_001_Unexport_XLogReaderInvalReadState.patch (text/x-diff) patch v2
- v02_002_Remove_TLI_argument_from_XLR_callback.patch (text/x-diff) patch v2
- v02_003_Introduce_XLogSegment.patch (text/x-diff) patch v2
- v02_004_Use_only_one_implementation_of_XLogRead.patch (text/x-diff) patch v2
- v02_005_Cleanup.patch (text/x-diff) patch v2
Antonin Houska <ah@cybertec.at> wrote: > Alvaro Herrera <alvherre@2ndquadrant.com> wrote: > > > Not sure about the walsize; maybe it can be a member in XLogReadPos, and > > given to XLogReadInitPos()? (Maybe rename XLogReadPos as > > XLogReadContext or something like that, indicating it's not just the > > read position.) > > As pointed out by others, XLogReadPos is not necessary. So if XLogRead() > receives XLogReaderState instead, it can get the segment size from there. Eventually I found out that it's good to have a separate structure for the read position because walsender calls the XLogRead() function directly, not via the XLOG reader. Currently the structure name is XLogSegment (maybe someone can propose better name) and it's a member of XLogReaderState. No field of the new structure is duplicated now. The next version of the patch is attached. -- Antonin Houska Web: https://www.cybertec-postgresql.com
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