Add undo log manager.
Add a new subsystem to manage undo logs. Undo logs allow data to be appended
efficiently, like logs. They also allow data to be discarded efficiently from
the other end, like a queue. Thirdly, they allow efficient buffered random
access, like a relation.
Undo logs physically consist of a set of 1MB segment files under
$PGDATA/base/undo (or per-tablespace equivalent) that are created, deleted or
renamed as required, similarly to the way that WAL segments are managed.
Meta-data about the set of undo logs is stored in shared memory, and written
to per-checkpoint files under $PGDATA/pg_undo.
Provide access to the undo files managed by undolog.c through bufmgr.c.
A new SMGR implementation allows bufmgr.c to access files created by
undolog.c.
Author: Thomas Munro, with contributions from Dilip Kumar, Rafia Sabih,
Robert Haas and Amit Kapila
Reviewed-by:
Discussion: https://postgr.es/m/CAEepm%3D2EqROYJ_xYz4v5kfr4b0qw_Lq_6Pe8RTEC8rx3upWsSQ%40mail.gmail.com