At recovery time or server reboot time, PostgreSQL finds the last checkpoint record from the pg_control
file and starts recovery from this point.
While replaying the WAL segments from the WAL directory, PostgreSQL syncs data files with WAL records on every checkpoint_timeout
(5 mins) or max_wal_size
boundary.
It updates the pg_control
file on every checkpoint boundary with some LSN setting which is called "restartpoint", so that in case of the next restart recovery, it can start from that point.
Is my understanding correct?
Your understanding is correct. A restart point is pretty much the same as a checkpoint, only it happens during archive recovery. One (minor) difference is that it does not write the LSN of the checkpoint to WAL.
Restartpoints make it possible to shut down the standby server without having to recover from the beginning when the standby is started again.