diff --git a/docs/maintain/databases.rst b/docs/maintain/databases.rst index 80f8586d..f4daee11 100644 --- a/docs/maintain/databases.rst +++ b/docs/maintain/databases.rst @@ -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. @@ -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 ----------- diff --git a/docs/use/databases.rst b/docs/use/databases.rst index a5a7da86..dc463c1e 100644 --- a/docs/use/databases.rst +++ b/docs/use/databases.rst @@ -144,7 +144,7 @@ Improve slow queries .. seealso:: - `PostgreSQL `__ in the Software Development Handbook + *Define tables*, *Define indexes* and *Paginate rows* under `PostgreSQL `__ in the Software Development Handbook To see the queries running under your user account, run: