Suggest two small improvements for PITR.

From: Yura Sokolov <y(dot)sokolov(at)postgrespro(dot)ru>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Suggest two small improvements for PITR.
Date: 2024-01-11 16:58:50
Message-ID: d1a1e766-4669-42a4-b15a-1545479e3f21@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Good day, hackers.

Here I am to suggest two small improvements to Point In Time Recovery.

First is ability to recover recovery-target-time with timestamp stored
in XLOG_RESTORE_POINT. Looks like historically this ability did exist
and were removed unintentionally during refactoring at commit [1]
c945af80 "Refactor checking whether we've reached the recovery target."

Second is extending XLOG_BACKUP_END record with timestamp, therefore
backup will have its own timestamp as well. It is backward compatible
change since there were no record length check before.

Both changes slightly helps in mostly idle systems, when between several
backups may happens no commits at all, so there's no timestamp to
recover to.

Attached sample patches are made in reverse order:
- XLOG_BACKUP_END then XLOG_RESTORE_POINT.
Second patch made by colleague by my idea.
Publishing for both is permitted.

If idea is accepted, patches for tests will be applied as well.

[1]
https://git.postgresql.org/gitweb/?p=postgresql.git;a=patch;h=c945af80

---

Yura Sokolov.

Attachment Content-Type Size
v1-0001-Add-timestamp-to-xlog-backup-end.patch text/x-patch 4.6 KB
v1-0002-Restore-timestamp-handling-in-recovery-point.patch text/x-patch 1.9 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2024-01-11 17:00:42 Re: Compile warnings in dbcommands.c building with meson
Previous Message Nathan Bossart 2024-01-11 16:56:33 Re: recovery modules