1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-12 10:04:14 +02:00

Add sleep before/after retrieving timestamp in the user guide.

Adding a sleep before was necessary since only adding a sleep after did not always work. This helps to ensure the backup stop time for the previous backup does not equal time-recovery-timestamp. The sleep after allows enough time between the time retrieval and dropping important_table so PostgreSQL can consistently recover to before the table drop.

Note that these issues were caused by picking a timestamp too close to the restore command or a database operation, not due to any problem in backup selection of the restore command.
This commit is contained in:
Cynthia Shang 2020-02-28 14:30:39 -05:00 committed by David Steele
parent 7d8c0d29fb
commit 089049ec56

View File

@ -1854,11 +1854,19 @@
<execute-list host="{[host-pg1]}">
<title>Get the time from <postgres/></title>
<execute user="postgres" show="n">
<exe-cmd>sleep 1</exe-cmd>
</execute>
<execute user="postgres" output="y" filter="n" variable-key="time-recovery-timestamp">
<exe-cmd>
psql -Atc "select current_timestamp"
</exe-cmd>
</execute>
<execute user="postgres" show="n">
<exe-cmd>sleep 1</exe-cmd>
</execute>
</execute-list>
<p>Now that the time has been recorded the table is dropped. In practice finding the exact time that the table was dropped is a lot harder than in this example. It may not be possible to find the exact time, but some forensic work should be able to get you close.</p>