1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-12-05 11:00:22 +02:00
Commit Graph

2905 Commits

Author SHA1 Message Date
Michael Paquier
a1de8d6145 Remove mention to archive recovery in README 2014-01-30 15:36:22 +09:00
Michael Paquier
4d586dda9c Add a note in README about the origin of pg_arman 2014-01-27 12:19:00 +09:00
Michael Paquier
3fc8d00bb4 Fix regression test failures caused by recent project renaming
Just a configuration file that missed the shot as well as an outdated
output for options.
2014-01-27 12:14:58 +09:00
Michael Paquier
5429f70807 Fix whitespaces and typos in documentation
The output of "show" command was incorrect as well.
2014-01-27 12:10:54 +09:00
Michael Paquier
c8ebcc9c41 Rename project to pg_arman
This is officially a fork!
2014-01-27 12:02:56 +09:00
Michael Paquier
820485d225 Strip off archive backup mode
This mode is not actually necessary if we consider that the core of
pg_rman is the obtention of differential and full backups, the server
being afterwards in charge to recover necessary WAL segments from the
archive.

Regression tests and documentation are updated in accordance to the
changes.
2014-01-24 22:37:55 +09:00
Michael Paquier
5988e6bd10 Remove server backup feature
In order to keep only the core of pg_rman for incremental/differential
backup, this looks necessary and makes the code more simple. Including
server log files in a backup could be subject to discussion as well,
as for example a Postgres base backup does not include them, just
because in this case server instance is not aware of the log files.
2014-01-24 20:37:13 +09:00
Michael Paquier
f9a3d799af Correct some typos and variable placements 2014-01-17 22:46:39 +09:00
Michael Paquier
7eb06cbc64 Add backup option --validate
This permits to validate a backup that has just been taken. Other
backups taken previously are ignored.
2014-01-17 22:42:27 +09:00
Michael Paquier
342496e331 Fix incremental and archive backup removal on delete command
The previous algorithm was smart enough to remove full backups older
than the given number of generations, but not enough to remove
incremental and archive backups. This resulted in keeping in the backup
list a set of incremental and archive backups older than the latest
full backup allowed. As it is useless to keep them, the deletion
algorithm is made smarter to take that into account and remove all of
them cleanly only when necessary.
2014-01-17 22:02:27 +09:00
Michael Paquier
c812fa3953 Refactor code for file list creation
A lot of code in this area was duplicated, so better to remove that.
2014-01-13 13:04:43 +09:00
Michael Paquier
09745505aa Make regression tests pass on OSX
Diffs were generated because of wc that puts some spaces before the
output which is in this case a number of lines. This does not impact
regression tests on Linux/Unix.
2014-01-13 12:46:58 +09:00
Michael Paquier
129b21ca4e Remove show timeline commands in regression tests
"show timeline" has actually been removed.
2014-01-13 12:42:04 +09:00
Michael Paquier
f6cc608c43 Correct installation of pg_rman.1 to $PGINSTALL/share/man/man1
This is to avoid to have to define several paths for MANPATH for a user
or a distribution.
2014-01-13 19:41:59 +09:00
Michael Paquier
4e6dd05628 Add a note about XML_CATALOG_FILES on OSX for doc compilation
Without this parameter correctly set, compilation could fail at xml
validation.
2014-01-11 22:57:48 +09:00
Michael Paquier
1868223c52 Use strong text for option names and underline option values
This makes the whole documentation more readable.
2014-01-12 03:50:13 +09:00
Michael Paquier
26ed2bbe14 Fix typo in documentation 2014-01-12 03:28:33 +09:00
Michael Paquier
c7b758a93f Fix and refactor large parts of the documentation
A couple of issues have been found on the documentation after re-reading
it related mainly to paging.
2014-01-12 03:25:54 +09:00
Michael Paquier
d274d27cfc Remove PHONY option in documentation Makefile
This was kicking all the time a clean up of everything, rather unwelcome.
2014-01-12 03:08:57 +09:00
Michael Paquier
6639785305 Use asciidoc and xmlto to automatic generation of man and html docs
This has the merit to put all the documentation of the project into a
single banner, and to centralize all the project in a single place at
code level.

Compiling documentation can be made by setting the variables ASCIIDOC
and XMLTO. As PostgreSQL extension system is not that smart for doc
generation, some custom Makefile path is used to install man pages into
a folder that could directly by used in MANPATH.
2014-01-12 03:03:30 +09:00
Michael Paquier
1c3512fadf Fix old backup removal for specified number of days
Backups could be removed even if generation number was set to infinite
without caring of the day threashold calculated. Backups are removed
if they either satisfy the generation or the day threshold.
2014-01-10 08:42:54 +09:00
Michael Paquier
3d0a22308c Change output format in documentation for command show
This is to be in-line with modifications of last commit.
2014-01-10 04:18:43 +09:00
Michael Paquier
37c3be1168 Refactor write/read calculation size of backups
This commit simplifies the way backup sizes are saved internally by
reusing the same variable for incremental and full backup, which were
using separated and exclusively used variables, resulted in a couple
of bytes wasted all the time. This was also reflected by a useless
column in the output table of subcommand "show".
2014-01-10 04:11:27 +09:00
Michael Paquier
9cd8e33508 Remove undocumented option "force" for delete command
This was in code, not in the docs...
2014-01-10 02:57:15 +09:00
Michael Paquier
e04426361f Allow only one keep parameter to trigger log and archive deletion
Same as previously, having two satisfy two conditions where most of the
users will just look for one policy usually is kind of awkward.
2014-01-10 02:48:11 +09:00
Michael Paquier
fcaae1a34b Allow only one keep parameter to trigger backup deletion
Having files satisfying both conditions seems somewhat awkward, as users
would usually choose either the number of generations to keep or the
amount of days to keep the files. Hence deletion of a backup is bypassed
only when both parameters are set to infinite.

At the same time correct some typos and incorrections in the deletion
code.
2014-01-10 02:37:33 +09:00
Michael Paquier
cb939f6bef Block backup operations for standbys
Backup from standbys should use a method based on replication protocol
in a way similar to what is done in pg_basebackup, as it cannot use
pg_start/stop_backup. As I am not sure what would be the right approach
by the way, it is better for the time being to block backups taken
from a standby. It does not penalize the functionality though as taking
disk snapshots is not forbidden either, and a user can still recover
from that. This commit removes at the same time some home-made functions
that created custom backup label files, this is not relyable, especially
if Postgres core format for this file changes across versions. Removing
them at least will save from some bugs for sure.
2013-12-26 21:16:01 +09:00
Michael Paquier
85f0c1e802 Block archive backup for a standby node
A standby node only replays WAL, and does not actually archive them so
in this case this mode does not have much sense.
2013-12-25 08:52:38 +09:00
Michael Paquier
a66e683dd4 Improve comment explaining how search_next_wal works with LSN
This makes the explanation a bit clearer, as the LSN in this function
is used with the current timeline to generate the file name.
2013-12-25 08:26:25 +09:00
Michael Paquier
ced83f7703 Fix WAL segment file generation
Name file of WAL segment was generated using the API of xlog_internal.h
called XlogFileName, based on XLogSegNo and not XLogRecPtr as the
previous code assumed. This leaded to backup incorrect, actually too
many WAL files in the archive code path because the analysis was based
on a name completely fucked up. This commit fixes at the same time an
issue in search_next_wal where the function could loop for a too long
amount of time, eating much CPU when looking for the next WAL file.

Regression tests are passing cleanly with this patch.
2013-12-25 08:17:01 +09:00
Michael Paquier
78d92ff8fb Fix typo 2013-12-25 05:33:50 +09:00
Michael Paquier
1bc1f1d1b6 Improve backup mode management
This commit makes mandatory the presence of a full backup when doing
an incremental or archive backup on an existing timeline. In this case
the process will now simply error out and not take any backup. It looks
safer to use that as a default by the way, so as user will be forced
to take a full backup once a recovery has been done.

Database backup also contained the following condition when doing an
incremental backup:
prev_backup->tli != current.tli
This means that an incremental backup cannot be taken if there is not
already a full backup present in the same timeline. The same condition
should also be used for archive backup but it didn't seem to be the
case...
2013-12-25 05:27:25 +09:00
Michael Paquier
26b8870665 Fix archive backup mode due to incorrect timeline assigned
This bug has been introduced by some older code, it looks that it will be
necessary to re-create a battery of regression tests to test all those
things automtically, as former tests contain nothing to test archive
mode directly.
2013-12-25 04:36:07 +09:00
Michael Paquier
e5ab0917cc Fix pg_switch_xlog for archive mode
An additional parenthesis was present in the code.
2013-12-25 03:53:18 +09:00
Michael Paquier
3f79be1789 Add documentation of pg_rman
Documentation is fairly refactored and rewritten, fixing many typos and
many grammar mistakes in the previous version of the docs.
2013-12-25 03:48:36 +09:00
Michael Paquier
8efe5c9da4 Change version number to 1.3dev 2013-12-18 19:25:26 +08:00
Michael Paquier
a8f98e9e27 Update project and bug report URLs
As this project has been forked to github...
2013-12-18 19:24:27 +08:00
Michael Paquier
90c2f645f6 Mention in README platforms supported 2013-12-15 22:07:32 +09:00
Michael Paquier
8acd23c28a Add README to project
This was still missing, and explains the fundamentals of the project.
2013-12-15 22:05:36 +09:00
Michael Paquier
3af0a65383 Fix create_dir not working properly for OSX
This makes pg_rman working normally, caused by some OS-related subtility...
2013-12-15 21:32:02 +09:00
Michael Paquier
ef59f85d0d Remove duplicated definition of Datum and MemoryContext 2013-12-16 01:16:08 +09:00
Michael Paquier
f4cf982e9f Correct typo in comment 2013-12-16 01:10:29 +09:00
Michael Paquier
83f4e80a74 Always return an error in case of incorrect backup mode
Some code paths allowed an invalid backup mode to be passed, something
rather crazy as they directly depended on that...
2013-12-16 00:50:36 +09:00
Michael Paquier
9ecd5acb97 Update comment in pg\rman.h about new file status.c 2013-12-16 00:36:50 +09:00
Michael Paquier
0938c645bb Update regression output after latest commit
Missed that actually...
2013-12-16 00:35:14 +09:00
Michael Paquier
05ce188607 Simplify code related to HAVE_DATABASE, HAVE_ARCLOG, TOTAL_READ_SIZE
Those macros were mainly used in code paths where they didn't make that
much sense, complicating heavily the code. Correct at the same time some
code comments.
2013-12-16 00:30:49 +09:00
Michael Paquier
96cfb3eb13 Simplify code for recovery target identification
Some unnecessary comments are removed and cleaned as well at the same
time.
2013-12-15 23:50:04 +09:00
Michael Paquier
f77d141b7c Simplify beginning of database backup
It was unclear what was being errored out at the beginning of the
process. But it happens that it is just necessary to check if the
backup running is only an archive or not, then return a NULL file
list before continuing process. This should be part of some safety
checks though.
2013-12-15 23:41:42 +09:00
Michael Paquier
4b0f88e4d5 Remove standby-site option
The documentation found on internet is rather unclear about the role
and the goal of this feature, which looks more like a kludge to cover
the fact that most of the system XLOG functions do not work on standby
nodes. Now that this restriction has been removed by using the control
file to look for the current timestamp, this feature is not needed.
2013-12-13 04:14:29 +09:00
Michael Paquier
308d00b80c Obtain timeline ID with control file and not XLOG system function
The system function used up to now was pg_xlogfile_name_offset, which
cannot be used on a node in recovery, and it was the only way present
to fetch the timeline ID of a backup, either incremental or full. So
instead scan the control file of server and fetch the timeline from
that. This also removes the restriction on which a backup could not
be taken on a standby node. The next step being to have the possibility
to take backups from streams.
2013-12-13 03:55:39 +09:00