Обсуждение: Barman backup fails after upgrade to PostgreSQL 10

Поиск
Список
Период
Сортировка

Barman backup fails after upgrade to PostgreSQL 10

От
Marco DE BOOIJ
Дата:
After my upgrade of PostgreSQL 9.6 to 10.3 the backups through barman 
fails. There is not much data change in the database but I still do not 
want to loose the data. I have verified the configuration and all seems 
correct for Barman and PostgreSQL . I have tried to find the answer on 
the internet but I was not able to find it. Both Barman and PostgreSQL 
run on the same server.

PostgreSQL    : 10.3 (Debian 10.3-1.pgdg90+1)
Barman          :  2.3
Debian           :  9.4

Configuration for the database in /etc/barman.d

description = "Productie PostgreSQL Database"
conninfo = host=maat user=barman dbname=postgres
streaming_conninfo = host=maat user=streaming_barman
backup_method = postgres
streaming_archiver = on
slot_name = barman
retention_policy = RECOVERY WINDOW OF 4 WEEKS

When I run 'barman backup all' I get the following output:

ERROR: Backup failed copying files.
DETAILS: data transfer failure on directory '/srv/share/backup/barman/maat/base/20180317T233002/data'
pg_basebackup error:
pg_basebackup: initiating base backup, waiting for checkpoint to complete
pg_basebackup: checkpoint completed
pg_basebackup: write-ahead log start point: 2/B000028 on timeline 1
pg_basebackup: starting background WAL receiver
pg_basebackup: could not connect to server: FATAL:  number of requested standby connections exceeds max_wal_senders
(currently2)
 
pg_basebackup: removing contents of data directory "/srv/share/backup/barman/maat/base/20180317T233002/data"
Starting backup using postgres method for server maat in /srv/share/backup/barman/maat/base/20180317T233002
Backup start at LSN: 2/A1F2CF0 (00000001000000020000000A, 001F2CF0)
Starting backup copy via pg_basebackup for 20180317T233002
maat 20180317T233002 - FAILED

In the barman.log there are the following lines around this message (indicated with ....):

2018-03-17 23:29:02,673 [15604] barman.wal_archiver INFO: No xlog segments found from streaming for maat.
2018-03-17 23:30:02,107 [15646] barman.wal_archiver INFO: Synchronous WAL streaming for barman_receive_wal: False
2018-03-17 23:30:02,326 [15646] barman.server INFO: Ignoring failed check 'backup maximum age' for server 'maat'
2018-03-17 23:30:02,359 [15648] barman.wal_archiver INFO: No xlog segments found from streaming for maat.
2018-03-17 23:30:02,560 [15646] barman.backup INFO: Starting backup using postgres method for server maat in
/srv/share/backup/barman/maat/base/20180317T233002
2018-03-17 23:30:02,662 [15646] barman.backup_executor INFO: Backup start at LSN: 2/A1F2CF0 (00000001000000020000000A,
001F2CF0)
2018-03-17 23:30:02,666 [15646] barman.backup_executor INFO: Starting backup copy via pg_basebackup for
20180317T233002
2018-03-17 23:30:04,069 [15646] barman.backup ERROR: Backup failed copying files.
....
2018-03-17 23:30:04,870 [15646] barman.wal_archiver INFO: No xlog segments found from streaming for maat.
2018-03-17 23:30:05,188 [2390] barman.command_wrappers INFO: maat: pg_receivewal: finished segment at 2/B000000
(timeline1)
 
2018-03-17 23:31:02,041 [15691] barman.wal_archiver INFO: Found 1 xlog segments from streaming for maat. Archive all
segmentsin one run.
 
2018-03-17 23:31:02,042 [15691] barman.wal_archiver INFO: Archiving segment 1 of 1 from streaming:
maat/00000001000000020000000A
2018-03-17 23:32:02,640 [15708] barman.wal_archiver INFO: No xlog segments found from streaming for maat.

The lines with 'INFO: No xlog segments' appear every minute.



Re: Barman backup fails after upgrade to PostgreSQL 10

От
Flavio Henrique Araque Gurgel
Дата:


Em dom, 18 de mar de 2018 12:22, Marco DE BOOIJ <marco.maillist@debooy.eu> escreveu:
After my upgrade of PostgreSQL 9.6 to 10.3 the backups through barman
fails. There is not much data change in the database but I still do not
want to loose the data. I have verified the configuration and all seems
correct for Barman and PostgreSQL . I have tried to find the answer on
the internet but I was not able to find it. Both Barman and PostgreSQL
run on the same server.

PostgreSQL    : 10.3 (Debian 10.3-1.pgdg90+1)
Barman          :  2.3
Debian           :  9.4

Configuration for the database in /etc/barman.d

description = "Productie PostgreSQL Database"
conninfo = host=maat user=barman dbname=postgres
streaming_conninfo = host=maat user=streaming_barman
backup_method = postgres
streaming_archiver = on
slot_name = barman
retention_policy = RECOVERY WINDOW OF 4 WEEKS

When I run 'barman backup all' I get the following output:

ERROR: Backup failed copying files.
DETAILS: data transfer failure on directory '/srv/share/backup/barman/maat/base/20180317T233002/data'
pg_basebackup error:
pg_basebackup: initiating base backup, waiting for checkpoint to complete
pg_basebackup: checkpoint completed
pg_basebackup: write-ahead log start point: 2/B000028 on timeline 1
pg_basebackup: starting background WAL receiver
pg_basebackup: could not connect to server: FATAL:  number of requested standby connections exceeds max_wal_senders (currently 2)
pg_basebackup: removing contents of data directory "/srv/share/backup/barman/maat/base/20180317T233002/data"
Starting backup using postgres method for server maat in /srv/share/backup/barman/maat/base/20180317T233002
Backup start at LSN: 2/A1F2CF0 (00000001000000020000000A, 001F2CF0)
Starting backup copy via pg_basebackup for 20180317T233002
maat 20180317T233002 - FAILED

In the barman.log there are the following lines around this message (indicated with ....):

2018-03-17 23:29:02,673 [15604] barman.wal_archiver INFO: No xlog segments found from streaming for maat.
2018-03-17 23:30:02,107 [15646] barman.wal_archiver INFO: Synchronous WAL streaming for barman_receive_wal: False
2018-03-17 23:30:02,326 [15646] barman.server INFO: Ignoring failed check 'backup maximum age' for server 'maat'
2018-03-17 23:30:02,359 [15648] barman.wal_archiver INFO: No xlog segments found from streaming for maat.
2018-03-17 23:30:02,560 [15646] barman.backup INFO: Starting backup using postgres method for server maat in /srv/share/backup/barman/maat/base/20180317T233002
2018-03-17 23:30:02,662 [15646] barman.backup_executor INFO: Backup start at LSN: 2/A1F2CF0 (00000001000000020000000A, 001F2CF0)
2018-03-17 23:30:02,666 [15646] barman.backup_executor INFO: Starting backup copy via pg_basebackup for 20180317T233002
2018-03-17 23:30:04,069 [15646] barman.backup ERROR: Backup failed copying files.
....
2018-03-17 23:30:04,870 [15646] barman.wal_archiver INFO: No xlog segments found from streaming for maat.
2018-03-17 23:30:05,188 [2390] barman.command_wrappers INFO: maat: pg_receivewal: finished segment at 2/B000000 (timeline 1)
2018-03-17 23:31:02,041 [15691] barman.wal_archiver INFO: Found 1 xlog segments from streaming for maat. Archive all segments in one run.
2018-03-17 23:31:02,042 [15691] barman.wal_archiver INFO: Archiving segment 1 of 1 from streaming: maat/00000001000000020000000A
2018-03-17 23:32:02,640 [15708] barman.wal_archiver INFO: No xlog segments found from streaming for maat.

Upgrade the postgresql-client package on you barman sever. Upgrade barman also to the latest version.

If the error persists, consider removing any files remaining in the server's folder streaming subdirectory and check if your slot exists in the PostgreSQL server.



Re: Barman backup fails after upgrade to PostgreSQL 10

От
"Georg H."
Дата:
Hello Marco,


Am 18.03.2018 um 12:21 schrieb Marco DE BOOIJ:
> After my upgrade of PostgreSQL 9.6 to 10.3 the backups through barman 
> fails. There is not much data change in the database but I still do 
> not want to loose the data. I have verified the configuration and all 
> seems correct for Barman and PostgreSQL . I have tried to find the 
> answer on the internet but I was not able to find it. Both Barman and 
> PostgreSQL run on the same server.
>
...
> When I run 'barman backup all' I get the following output:
>
> ERROR: Backup failed copying files.
> DETAILS: data transfer failure on directory 
> '/srv/share/backup/barman/maat/base/20180317T233002/data'
> pg_basebackup error:
...
> pg_basebackup: could not connect to server: FATAL:  number of 
> requested standby connections exceeds max_wal_senders (currently 2)
....
> maat 20180317T233002 - FAILED
>
Have you tried so set max_wal_senders to a higher value? iirc the 
default value for postgresql10 is max_wal_senders = 10
> In the barman.log there are the following lines around this message 
> (indicated with ....):
>
also worth checking is your servers barman conf file 
(/etc/barman.d/xxx.conf) which has a line at the end pointing to the 
postgres binaries path to use.
What means that you have to have postgresql-client package version 10 on 
your barman server and have to change your config pointing to the new path.

kind regards
Georg


Re: Barman backup fails after upgrade to PostgreSQL 10

От
Marco DE BOOIJ
Дата:
Dear Georg,

Many thanks for your help. I changed the max_wal_senders to 10 and 
restarted the database. Since I have a small server I did not want to 
put it higher then mentioned in the documentation of Barman 2.3. Thought 
I did not need to. Now the backup is made (took 4 minutes).

Kind regards,

Marco


Op 18-03-18 om 12:54 schreef Georg H.:
> Hello Marco,
>
>
> Am 18.03.2018 um 12:21 schrieb Marco DE BOOIJ:
>> After my upgrade of PostgreSQL 9.6 to 10.3 the backups through barman 
>> fails. There is not much data change in the database but I still do 
>> not want to loose the data. I have verified the configuration and all 
>> seems correct for Barman and PostgreSQL . I have tried to find the 
>> answer on the internet but I was not able to find it. Both Barman and 
>> PostgreSQL run on the same server.
>>
> ...
>> When I run 'barman backup all' I get the following output:
>>
>> ERROR: Backup failed copying files.
>> DETAILS: data transfer failure on directory 
>> '/srv/share/backup/barman/maat/base/20180317T233002/data'
>> pg_basebackup error:
> ...
>> pg_basebackup: could not connect to server: FATAL:  number of 
>> requested standby connections exceeds max_wal_senders (currently 2)
> ....
>> maat 20180317T233002 - FAILED
>>
> Have you tried so set max_wal_senders to a higher value? iirc the 
> default value for postgresql10 is max_wal_senders = 10
>> In the barman.log there are the following lines around this message 
>> (indicated with ....):
>>
> also worth checking is your servers barman conf file 
> (/etc/barman.d/xxx.conf) which has a line at the end pointing to the 
> postgres binaries path to use.
> What means that you have to have postgresql-client package version 10 
> on your barman server and have to change your config pointing to the 
> new path.
>
> kind regards
> Georg
>