bareos-fd-plugin: new python PostgreSQL#1541
Conversation
ec25570 to
5c701d5
Compare
5c701d5 to
1611e63
Compare
core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py
Outdated
Show resolved
Hide resolved
core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py
Outdated
Show resolved
Hide resolved
pstorz
left a comment
There was a problem hiding this comment.
Good work! Please see comments.
core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py
Outdated
Show resolved
Hide resolved
core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py
Outdated
Show resolved
Hide resolved
core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py
Outdated
Show resolved
Hide resolved
core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py
Outdated
Show resolved
Hide resolved
core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py
Outdated
Show resolved
Hide resolved
docs/manuals/source/TasksAndConcepts/Plugins/FileDaemonPlugins/PostgreSQLPlugin.rst.inc
Outdated
Show resolved
Hide resolved
docs/manuals/source/TasksAndConcepts/Plugins/FileDaemonPlugins/PostgreSQLPlugin.rst.inc
Outdated
Show resolved
Hide resolved
docs/manuals/source/TasksAndConcepts/Plugins/FileDaemonPlugins/PostgreSQLPlugin.rst.inc
Outdated
Show resolved
Hide resolved
docs/manuals/source/TasksAndConcepts/Plugins/FileDaemonPlugins/PostgreSQLPlugin.rst.inc
Outdated
Show resolved
Hide resolved
core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py
Outdated
Show resolved
Hide resolved
|
Hi , is there any easy way for us to test it? Did the name indeed change to bareos-fd-postgresql (instead of using bareos-fd-postgres) ? |
I believe the easiest way is to start the bareos-fd 23 with the bareos-fd-postgresql plugin setup see packages here and documentation Doing it that way will give you next build of the plugin when changes will occurs during the last steps of development. |
core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py
Outdated
Show resolved
Hide resolved
sebsura
left a comment
There was a problem hiding this comment.
Here is how one could fix the ret naming issue.
ecb4e9d to
31b4089
Compare
31b4089 to
897a86a
Compare
5c84f46 to
1fbf473
Compare
pstorz
left a comment
There was a problem hiding this comment.
Good work. Please see comments!
core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py
Outdated
Show resolved
Hide resolved
core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py
Outdated
Show resolved
Hide resolved
core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py
Outdated
Show resolved
Hide resolved
core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py
Outdated
Show resolved
Hide resolved
core/src/plugins/filed/python/postgresql/bareos-fd-postgresql.py
Outdated
Show resolved
Hide resolved
docs/manuals/source/TasksAndConcepts/Plugins/FileDaemonPlugins/PostgreSQLPlugin.rst.inc
Outdated
Show resolved
Hide resolved
systemtests/tests/py3plug-fd-postgresql/database/make_cluster_activity.sql
Outdated
Show resolved
Hide resolved
systemtests/tests/py3plug-fd-postgresql/database/make_cluster_activity.sql
Show resolved
Hide resolved
- pg8000 may return Decimal('0') when lsn are identical, we now check if
we can remove quote from string before int() conversion.
- improve job log message
- remove no more used functions format_lsn and lsn_to_int
signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
- applied all review suggestions - do formating too long lines - describe difference between ignore_subdirs, and mandatory_subdirs Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
- normalize sql to lowercase - improve message logging in _close_db_connection
- As the old "postgres" plugin was replaced with the new "postresql" plugin, we want to warn everybody using the old plugin to switch to the new plugin.
- do mtime comparision only for WAL in Incremental - replace anxious warning job message by registering a debug message for skipped files - do try to set attribute on symlink in python (tablespace restore case)
Also remove trailing spaces in multiple lines.
Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
Signed-off-by: Bruno Friedmann <bruno.friedmann@bareos.com>
733e561 to
ae2a24a
Compare
|
We just tested but there seems to be a problem with symlinks at first sight... Since the real location of the postgresql data dir can vary from version to version, we had to symlink postgresql data dir to some other location. We then backup the installation trough the symlink. E.g. ln -s /var/lib/postgresql/15/main /var/lib/pgsql_data The backup configuration uses: postgresql_data_dir=/var/lib/pgsql_data Then the backup runs fine , and I believe it takes all data. However when we restore, we end up with just a symlink to pgsql_data In the restore window we see the data should be there, but we cannot find it when restoring. |
|
I checked postgresql restart and it's very well possible all data on the target system inside /var/lib/postgresql/15/main was just overwritten when restoring, even when we restored to /tmp/restore :/ |
|
OK finally I moved the original postgresql data dir, I see indeed it will overwrite the postgres folder immediately, I don't think this is normally what should happen? Also I see some strange errors when effectively restoring the data Which is correct, those files were misssing, e.g. this for example was not found in the backup: cp: cannot stat '/var/lib/pgsql_archive/00000003.history': No such file or directory |
That test case was not used, and unfortunately, your report appear after the merge window. Please open a issue in mantis with those information, joblog and configuration. |



This PR propose a new PostgreSQL plugin for Bareos. It use python 3 (>=3.6), pg8000 (>=1.16) and use the non exclusive backup mode available upstream since version 9.6.
PostgreSQL cluster version >= 10 are supported.
The plugin after the backup create 3 virtual files
backup_label,recovery.signal(orrecovery.conf) andtablespace_mapif needed, which are restored with the cluster. This allow user to just setup the recovery_command after the restore.Documentation has been updated (see all new config option)
This plugin will be packaged into the same package name as the old one,
(which will be still distributed to allow restore of previous backup during lifetime of Bareos 23 version).
Breaking changes: (need to be noticed) the plugin name has changed (postgres-> postgresql) and most of the options have been renamed and need a manual review of existing fileset to make new backup successful.
Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
Make sure you check/merge the PR using
devtools/pr-toolto have some simple automated checks run and a proper changelog record added.General
Source code quality
Tests