Commit 25a623c1 authored by Marco Nenciarini's avatar Marco Nenciarini

New upstream version 2.4

parent 54261906
2018-05-23 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Update the ChangeLog file
Set version to 2.4
2018-05-23 Gabriele Bartolini <gabriele.bartolini@2ndQuadrant.it>
Fix doc about RPM/APT repositories
2018-05-18 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Update the ChangeLog file
2018-05-15 Giulio Calacoci <giulio.calacoci@2ndquadrant.it>
Fix invalid "Last Archived WAL" for Postgres < 9.4
Closes #110 #113
2018-05-14 Gabriele Bartolini <gabriele.bartolini@2ndQuadrant.it>
Fix links syntax for Markdown in documentation
Add 2ndQuadrant public repositories info
Prepared release notes for 2.4 with tentative release date
2018-05-11 Gabriele Bartolini <gabriele.bartolini@2ndQuadrant.it>
Downgraded sync standby names messages to debug
Fixes #89
2018-05-10 Leonardo Cecchi <leonardo.cecchi@2ndquadrant.com>
Ensure CommandWrapper has an unicode output
Depending on the version of Python and on the usage, the CommandWrapper
was collecting the output of the wrapper command as a byte string or as
an unicode string.
This patch makes the `out` and the `err` properties of the
CommandWrapper be always an unicode string.
Closes #150
Closes #143
2018-05-09 Leonardo Cecchi <leonardo.cecchi@2ndquadrant.com>
Treat slot names as lowercase
PostgreSQL replication slot names can contain only lowercase letters,
numbers and the underscore character.
This patch makes Barman treating the slot names as lowercase and
reporting configuration errors when invalid characters (beside uppercase
letters) are used.
Closes: #170
2018-05-09 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Improve usability of point-in-time recovery
Add a check to stop the recovery immediately if the recovery time is
before the backup end time.
If the timezone is not specified, the target recovery time is
interpreted according to the Barman server timezone. This is a
behavior change, because previously the specified time was simply
passed to PostgreSQL and thus interpreted according the PostgreSQL
settings.
2018-05-10 Leonardo Cecchi <leonardo.cecchi@2ndquadrant.com>
Fix target_action handling when not specified
2018-05-10 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Make DataTransferFailure.from_command_error() more resilient
Closes: #86
2018-05-09 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Remove workaround for gforcada/flake8-isort#9
Fix remote get_file_content method
Recover was always failing to pull .barman-recover.info because of a
typo in remote get_file_content method.
Closes: #151
2018-05-09 Leonardo Cecchi <leonardo.cecchi@2ndquadrant.com>
Ensure item_class is specified for resources to copy
Add an assertion to the RsyncCopyController item preventing the code to
create items without item_class set.
2018-05-08 Gabriele Bartolini <gabriele.bartolini@2ndQuadrant.it>
Suggest stricter `archive_command` in documentation
Add an example of stricter `archive_command` that checks that
it is executed only on a specific server. Suggested by
Florent Xicluna (https://github.com/florentx)
Closes #11
2018-05-08 Leonardo Cecchi <leonardo.cecchi@2ndquadrant.com>
Add '--standby-mode' option to barman recover
This option is only available for PostgreSQL older than 9.0 and will
make 'barman recover' generate the recovery.conf file even if the
get-wal and PITR are not active.
2018-01-12 Todd Seidelmann <seidelma@wharton.upenn.edu>
Add hook script for recovery
The list of new hook scripts is:
* pre_recovery_script
* pre_recovery_retry_script
* post_recovery_retry_script
* post_recovery_script
Closes GitHub #137
2018-05-08 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Add hook script for wal deletion
The list of new hook scripts is:
* pre_wal_delete_script
* pre_wal_delete_retry_script
* post_wal_delete_retry_script
* post_wal_delete_script
2018-05-07 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Add hook script for delete command
The list of new hook scripts is:
* pre_delete_script
* pre_delete_retry_script
* post_delete_retry_script
* post_delete_script
2018-05-08 Leonardo Cecchi <leonardo.cecchi@2ndquadrant.com>
Add '--target-action' option to barman recover
The option is only active when Barman creates a recovery.conf suitable
for PITR. Possible values are:
- None (default, for back portability)
- shutdown (for PostgreSQL 9.5+)
- pause (for PostgreSQL 9.1+)
- promote (for PostgreSQL 9.5+)
2017-08-06 Reto Zingg <g.d0b3rm4n@gmail.com>
rename command() to barman_command()
Fixes #118
2017-07-22 Matthew Hawn <steamraven@yahoo.com>
Initialise synchronous standby names list if not set
Fixes #111
2018-05-07 Gabriele Bartolini <gabriele.bartolini@2ndQuadrant.it>
Documentation: add limitations about .partial files and recovery
Closes Github #79
Documentation: remind that recovery requires a shutdown Postgres
Closes GitHub #96
2018-01-15 Feike Steenbergen <feike.steenbergen@adyen.com>
Correct placeholders ordering
The number of backups on disk and the configured redundancy
were reported in the wrong order, causing some confusion.
Closes GitHub #138
2017-06-28 Ian Barwick <ian@2ndquadrant.com>
Add recovery completed message
2016-10-21 Christoph Moench-Tegeder <christoph@2ndquadrant.de>
force the datestyle to iso for replication connections
this works around a bug in some psycopg2 versions
2018-05-07 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Drop support for Python 3.3
Python 3.3 is EOL since 2017-09-29.
2018-05-04 Giulio Calacoci <giulio.calacoci@2ndquadrant.it>
Fix 2.6 compatibility
Fix version of pyton-dateutils to version < 2.7.0, as more recent
versions dropped support for py 2.6
2018-05-04 Gabriele Bartolini <gabriele.bartolini@2ndQuadrant.it>
Fix misleading message about PITR when having just `get-wal`
Returns error if `delete` command does not remove the backup
2018-03-18 Gabriele Bartolini <gabriele.bartolini@2ndQuadrant.it>
Improve max_wal_senders documentation
2018-03-02 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Enable more flake8 tests and update the copyright year
2018-02-13 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Better way to pin wheel package to support testing on python 2.6
Using setup_requires instead of install_requires we avoid depending
on wheel at runtime
2018-02-09 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Fix missing documentation in MANIFEST.in
2017-12-19 Gabriele Bartolini <gabriele.bartolini@2ndQuadrant.it>
Improve documentation for pg_receivewal/pg_receivexlog
2018-02-06 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Pin wheel package on python 2.6 to avoid build failures
Fix error reported by latest version of flake8-isort
2018-02-02 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Split manpages generation code to ease the management.
With this patch we also support using pandoc 2.x to generate the
documentation.
2018-01-15 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Ignore vanished files in streaming directory
A file could get renamed by pg_receivewal while Barman
reads the content of the streaming directory, resulting in an error
message in the logs. With this patch, Barman stops treating it as an
error, and ignores it instead.
2018-01-10 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Disable minimal tox env in travis-ci
The minimal tox env requires psycopg2==2.4.2, but that version does
not compile anymore in the travis-ci environment because it does not
understand the libpq version returned by PostgreSQL 10.
2017-12-12 Jonathan Battiato <jonathan.battiato@2ndquadrant.it>
Fix exception when calling is_power_of_two(None)
The function `is_power_of_two(number)` must return None
if the `number` argument is None, instead of
printing a Traceback.
2017-12-04 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Safer handling of types in FieldListFile class
2017-11-29 Giulio Calacoci <giulio.calacoci@2ndquadrant.it>
Require pytest < 3.3.0 as we are still support Python 2.6
2017-11-29 Gabriele Bartolini <gabriele.bartolini@2ndQuadrant.it>
Add '--wal-method=none' when pg_basebackup >= 10
Fixes #133
2017-10-03 Flavio Curella <flavio.curella@gmail.com>
fix typo in hooks docs
2017-11-15 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Stop process manager module from ovewriting lock files content
Previously a bug in the process manager code was writing its own PID
in all the existing lock files which didn't have an owner.
Due to a bug, the content of all the lock files without owner
was overwritten with the PID of every barman command interacting with
a server object.
Because of this barman cron was wrongly identifying other commands
as a running `receive-wal` process and then terminating them.
The code has now changed to avoid modifying the content of the lock
file when accessed by the process manager.
2017-10-26 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Fix some stylistic issues raised by flake8
2017-10-18 Gabriele Bartolini <gabriele.bartolini@2ndQuadrant.it>
Add Postgres 10 to feature matrix (docs)
2017-09-27 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Relax the rules for rsync output parsing
In rare cases the rsync error message about vanished files is emitted
from the receiver process instead of from the generator.
Furthermore recent versions of rsync have changed the capitalization
of error messages, so the regular expression Barman uses to parse the
output has been generalized and made case insensitive.
Set version to 2.4a1
2017-09-04 Marco Nenciarini <marco.nenciarini@2ndquadrant.it>
Update the ChangeLog file
......
Barman INSTALL instructions
Copyright (C) 2011-2017 2ndQuadrant Limited
Copyright (C) 2011-2018 2ndQuadrant Limited
For further information, see the "Installation" section in the
official manual of Barman or the Markdown source file:
......
recursive-include barman *.py
recursive-include rpm *
recursive-include doc *.md
recursive-include doc/barman.d *
include doc/Makefile doc/barman.1 doc/barman.5 doc/barman.conf
recursive-include doc *
include scripts/barman.bash_completion
include AUTHORS NEWS ChangeLog LICENSE MANIFEST.in setup.py INSTALL README.rst
Barman News - History of user-visible changes
Copyright (C) 2011-2017 2ndQuadrant Limited
Copyright (C) 2011-2018 2ndQuadrant Limited
Version 2.4 - 25 May 2018
- Add standard and retry hook scripts for backup deletion (pre/post)
- Add standard and retry hook scripts for recovery (pre/post)
- Add standard and retry hook scripts for WAL deletion (pre/post)
- Add --standby-mode option to barman recover to add standby_mode = on
in pre-generated recovery.conf
- Add --target-action option to barman recover, allowing users to add
shutdown, pause or promote to the pre-generated recovery.conf file
- Improve usability of point-in-time recovery with consistency checks
(e.g. recovery time is after end time of backup)
- Minor documentation improvements
- Drop support for Python 3.3
Relevant bug fixes:
- Fix remote get_file_content method (Github #151), preventing
incremental recovery from happening
- Unicode issues with command (Github #143 and #150)
- Add --wal-method=none when pg_basebackup >= 10 (Github #133)
Minor bug fixes:
- Stop process manager module from ovewriting lock files content
- Relax the rules for rsync output parsing
- Ignore vanished files in streaming directory
- Case insensitive slot names (Github #170)
- Make DataTransferFailure.from_command_error() more resilient
(Github #86)
- Rename command() to barman_command() (Github #118)
- Initialise synchronous standby names list if not set (Github #111)
- Correct placeholders ordering (GitHub #138)
- Force datestyle to iso for replication connections
- Returns error if delete command does not remove the backup
- Fix exception when calling is_power_of_two(None)
- Downgraded sync standby names messages to debug (Github #89)
Version 2.3 - 5 Sep 2017
......
Metadata-Version: 1.1
Name: barman
Version: 2.3
Version: 2.4
Summary: Backup and Recovery Manager for PostgreSQL
Home-page: http://www.pgbarman.org/
Author: 2ndQuadrant Limited
......@@ -26,7 +26,6 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (G
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
......@@ -44,7 +44,7 @@ Web resources
Licence
-------
Copyright (C) 2011-2017 2ndQuadrant Limited
Copyright (C) 2011-2018 2ndQuadrant Limited
Barman is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
......
Metadata-Version: 1.1
Name: barman
Version: 2.3
Version: 2.4
Summary: Backup and Recovery Manager for PostgreSQL
Home-page: http://www.pgbarman.org/
Author: 2ndQuadrant Limited
......@@ -26,7 +26,6 @@ Classifier: License :: OSI Approved :: GNU General Public License v3 or later (G
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
......@@ -38,14 +38,127 @@ barman.egg-info/dependency_links.txt
barman.egg-info/requires.txt
barman.egg-info/top_level.txt
bin/barman
doc/.gitignore
doc/Makefile
doc/barman.1
doc/barman.1.md
doc/barman.5
doc/barman.5.md
doc/barman.conf
doc/barman.1.d/00-header.md
doc/barman.1.d/05-name.md
doc/barman.1.d/10-synopsis.md
doc/barman.1.d/15-description.md
doc/barman.1.d/20-options.md
doc/barman.1.d/45-commands.md
doc/barman.1.d/50-archive-wal.md
doc/barman.1.d/50-backup.md
doc/barman.1.d/50-check.md
doc/barman.1.d/50-cron.md
doc/barman.1.d/50-delete.md
doc/barman.1.d/50-diagnose.md
doc/barman.1.d/50-get-wal.md
doc/barman.1.d/50-list-backup.md
doc/barman.1.d/50-list-files.md
doc/barman.1.d/50-list-server.md
doc/barman.1.d/50-rebuild-xlogdb.md
doc/barman.1.d/50-receive-wal.md
doc/barman.1.d/50-recover.md
doc/barman.1.d/50-replication-status.md
doc/barman.1.d/50-show-backup.md
doc/barman.1.d/50-show-server.md
doc/barman.1.d/50-status.md
doc/barman.1.d/50-switch-wal.md
doc/barman.1.d/50-switch-xlog.md
doc/barman.1.d/70-backup-id-shortcuts.md
doc/barman.1.d/75-exit-status.md
doc/barman.1.d/80-see-also.md
doc/barman.1.d/85-bugs.md
doc/barman.1.d/90-authors.md
doc/barman.1.d/95-resources.md
doc/barman.1.d/99-copying.md
doc/barman.5.d/00-header.md
doc/barman.5.d/05-name.md
doc/barman.5.d/15-description.md
doc/barman.5.d/20-configuration-file-locations.md
doc/barman.5.d/25-configuration-file-syntax.md
doc/barman.5.d/30-configuration-file-directory.md
doc/barman.5.d/45-options.md
doc/barman.5.d/50-active.md
doc/barman.5.d/50-archiver.md
doc/barman.5.d/50-archiver_batch_size.md
doc/barman.5.d/50-backup_directory.md
doc/barman.5.d/50-backup_method.md
doc/barman.5.d/50-backup_options.md
doc/barman.5.d/50-bandwidth_limit.md
doc/barman.5.d/50-barman_home.md
doc/barman.5.d/50-barman_lock_directory.md
doc/barman.5.d/50-basebackup_retry_sleep.md
doc/barman.5.d/50-basebackup_retry_times.md
doc/barman.5.d/50-basebackups_directory.md
doc/barman.5.d/50-check_timeout.md
doc/barman.5.d/50-compression.md
doc/barman.5.d/50-conninfo.md
doc/barman.5.d/50-custom_compression_filter.md
doc/barman.5.d/50-custom_decompression_filter.md
doc/barman.5.d/50-description.md
doc/barman.5.d/50-errors_directory.md
doc/barman.5.d/50-immediate_checkpoint.md
doc/barman.5.d/50-incoming_wals_directory.md
doc/barman.5.d/50-last_backup_maximum_age.md
doc/barman.5.d/50-log_file.md
doc/barman.5.d/50-log_level.md
doc/barman.5.d/50-max_incoming_wals_queue.md
doc/barman.5.d/50-minimum_redundancy.md
doc/barman.5.d/50-network_compression.md
doc/barman.5.d/50-parallel_jobs.md
doc/barman.5.d/50-path_prefix.md
doc/barman.5.d/50-post_archive_retry_script.md
doc/barman.5.d/50-post_archive_script.md
doc/barman.5.d/50-post_backup_retry_script.md
doc/barman.5.d/50-post_backup_script.md
doc/barman.5.d/50-post_delete_retry_script.md
doc/barman.5.d/50-post_delete_script.md
doc/barman.5.d/50-post_recovery_retry_script.md
doc/barman.5.d/50-post_recovery_script.md
doc/barman.5.d/50-post_wal_delete_retry_script.md
doc/barman.5.d/50-post_wal_delete_script.md
doc/barman.5.d/50-pre_archive_retry_script.md
doc/barman.5.d/50-pre_archive_script.md
doc/barman.5.d/50-pre_backup_retry_script.md
doc/barman.5.d/50-pre_backup_script.md
doc/barman.5.d/50-pre_delete_retry_script.md
doc/barman.5.d/50-pre_delete_script.md
doc/barman.5.d/50-pre_recovery_retry_script.md
doc/barman.5.d/50-pre_recovery_script.md
doc/barman.5.d/50-pre_wal_delete_retry_script.md
doc/barman.5.d/50-pre_wal_delete_script.md
doc/barman.5.d/50-recovery_options.md
doc/barman.5.d/50-retention_policy.md
doc/barman.5.d/50-retention_policy_mode.md
doc/barman.5.d/50-reuse_backup.md
doc/barman.5.d/50-slot_name.md
doc/barman.5.d/50-ssh_command.md
doc/barman.5.d/50-streaming_archiver.md
doc/barman.5.d/50-streaming_archiver_batch_size.md
doc/barman.5.d/50-streaming_archiver_name.md
doc/barman.5.d/50-streaming_backup_name.md
doc/barman.5.d/50-streaming_conninfo.md
doc/barman.5.d/50-streaming_wals_directory.md
doc/barman.5.d/50-tablespace_bandwidth_limit.md
doc/barman.5.d/50-wal_retention_policy.md
doc/barman.5.d/50-wals_directory.md
doc/barman.5.d/70-hook-scripts.md
doc/barman.5.d/75-example.md
doc/barman.5.d/80-see-also.md
doc/barman.5.d/90-authors.md
doc/barman.5.d/95-resources.md
doc/barman.5.d/99-copying.md
doc/barman.d/ssh-server.conf-template
doc/barman.d/streaming-server.conf-template
doc/images/barman-architecture-scenario1.png
doc/images/barman-architecture-scenario1b.png
doc/images/barman-architecture-scenario2.png
doc/images/barman-architecture-scenario2b.png
doc/manual/.gitignore
doc/manual/00-head.en.md
doc/manual/01-intro.en.md
doc/manual/02-before_you_start.en.md
......@@ -69,6 +182,7 @@ doc/manual/65-troubleshooting.en.md
doc/manual/66-about.en.md
doc/manual/70-feature-matrix.en.md
doc/manual/99-references.en.md
doc/manual/Makefile
rpm/barman.spec
rpm/rhel5/python-dateutil-1.4.1-remove-embedded-timezone-data.patch
rpm/rhel5/python26-argcomplete.spec
......
psycopg2>=2.4.2
argh<=0.26.2,>=0.21.2
python-dateutil
python-dateutil<2.7.0
argcomplete
# Copyright (C) 2011-2017 2ndQuadrant Limited
# Copyright (C) 2011-2018 2ndQuadrant Limited
#
# This file is part of Barman.
#
......
This diff is collapsed.
# Copyright (C) 2011-2017 2ndQuadrant Limited
# Copyright (C) 2011-2018 2ndQuadrant Limited
#
# This file is part of Barman.
#
......@@ -744,7 +744,7 @@ class SshBackupExecutor(with_metaclass(ABCMeta, BackupExecutor)):
# the begin_wal value is surely known. Doing it twice is safe
# because this function is useful only during the first backup.
self._purge_unused_wal_files(backup_info)
except:
except BaseException:
# we do not need to do anything here besides re-raising the
# exception. It will be handled in the external try block.
output.error("The backup has failed %s", self.current_action)
......
# Copyright (C) 2011-2017 2ndQuadrant Limited
# Copyright (C) 2011-2018 2ndQuadrant Limited
#
# This file is part of Barman.
#
......@@ -32,7 +32,7 @@ import barman.config
import barman.diagnose
from barman import output
from barman.config import RecoveryOptions
from barman.exceptions import BadXlogSegmentName
from barman.exceptions import BadXlogSegmentName, RecoveryException
from barman.infofile import BackupInfo
from barman.server import Server
from barman.utils import configure_logging, drop_privileges, parse_log_level
......@@ -78,6 +78,22 @@ def check_positive(value):
return int_value
def check_target_action(value):
"""
Check the target action option
:param value: str containing the value to check
"""
if value is None:
return None
if value in ('pause', 'shutdown', 'promote'):
return value
raise ArgumentTypeError("'%s' is not a valid recovery target action" %
value)
@named('list-server')
@arg('--minimal', help='machine readable output')
def list_server(minimal=False):
......@@ -379,6 +395,21 @@ def rebuild_xlogdb(args):
dest='network_compression',
action='store_false',
default=SUPPRESS)
@arg('--target-action',
help='Specifies what action the server should take once the '
'recovery target is reached. This option is not allowed for '
'PostgreSQL < 9.1. If PostgreSQL is between 9.1 and 9.4 included '
'the only allowed value is "pause". If PostgreSQL is 9.5 or newer '
'the possible values are "shutdown", "pause", "promote".',
dest='target_action',
type=check_target_action,
default=SUPPRESS)
@arg('--standby-mode',
dest="standby_mode",
action='store_true',
default=SUPPRESS,
help='Enable standby mode when starting '
'the recovered PostgreSQL instance')
@expects_obj
def recover(args):
"""
......@@ -469,17 +500,23 @@ def recover(args):
"you have to use the --remote-ssh-command option")
output.close_and_exit()
server.config.network_compression = args.network_compression
with closing(server):
server.recover(backup_id,
args.destination_directory,
tablespaces=tablespaces,
target_tli=args.target_tli,
target_time=args.target_time,
target_xid=args.target_xid,
target_name=args.target_name,
target_immediate=args.target_immediate,
exclusive=args.exclusive,
remote_command=args.remote_ssh_command)
try:
server.recover(backup_id,
args.destination_directory,
tablespaces=tablespaces,
target_tli=args.target_tli,
target_time=args.target_time,
target_xid=args.target_xid,
target_name=args.target_name,
target_immediate=args.target_immediate,
exclusive=args.exclusive,
remote_command=args.remote_ssh_command,
target_action=getattr(args, 'target_action', None),
standby_mode=getattr(args, 'standby_mode', None))
except RecoveryException as exc:
output.error(str(exc))
output.close_and_exit()
......@@ -684,7 +721,9 @@ def delete(args):
# Retrieves the backup
backup_id = parse_backup_id(server, args)
with closing(server):
server.delete_backup(backup_id)
if not server.delete_backup(backup_id):
output.error("Cannot delete backup (%s %s)"
% (server.config.name, backup_id))
output.close_and_exit()