Skip to content

Commit

Permalink
docs(databases): Add section about troubleshooting backups
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Oct 8, 2024
1 parent 5edd732 commit d106506
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
28 changes: 26 additions & 2 deletions docs/maintain/databases.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Maintain PostgreSQL
===================

Troubleshoot
------------
Troubleshoot performance
------------------------

Check the log file – for example, ``/var/log/postgresql/postgresql-15-main.log`` – if debugging an unscheduled restart of the ``postgres`` service, for example.

Expand Down Expand Up @@ -102,6 +102,30 @@ To get the table related to a TOAST table, take the number after ``pg_toast_``,
SELECT '16712'::regclass;
Troubleshoot backups
--------------------

If ``cron`` sends an email like:

.. code-block:: none
ERROR: [082]: WAL segment 00000001000009FD0000000D was not archived before the 60000ms timeout
HINT: check the archive_command to ensure that all options are correct (especially --stanza).
HINT: check the PostgreSQL server log for errors.
HINT: run the 'start' command if the stanza was previously stopped.
(The same message will appear in a log file like ``/var/log/pgbackrest/STANZA-backup.log``.)

This error occurs occasionally (for example, due to a network issue), and is not a concern. To confirm, after 24 hours, view recent backups with:

.. code-block:: bash
sudo -u postgres pgbackrest info --stanza=kingfisher-2023
You should see a "full backup" within one week of the error, an "incr backup" the day before the error, and another the day after. (In other words, an incremental backup failed.)

If a full backup failed, re-run the weekly full backup command listed in the ``/etc/cron.d/postgres_backups`` file.

Check usage
-----------

Expand Down
2 changes: 1 addition & 1 deletion docs/use/databases.rst
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ Improve slow queries

.. seealso::

`PostgreSQL <https://ocp-software-handbook.readthedocs.io/en/latest/services/postgresql.html>`__ in the Software Development Handbook
*Define tables*, *Define indexes* and *Paginate rows* under `PostgreSQL <https://ocp-software-handbook.readthedocs.io/en/latest/services/postgresql.html>`__ in the Software Development Handbook

To see the queries running under your user account, run:

Expand Down

0 comments on commit d106506

Please sign in to comment.