1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-11-28 09:33:54 +02:00
Commit Graph

47 Commits

Author SHA1 Message Date
stalkerg
a9040229a5 Get current timeline from wal dir.
Also add recovery_target = 'immediate' for some case.
2016-11-16 15:14:50 +03:00
stalkerg
b9be223a4f Don't add immediate to recovery.conf. Also if last backup is stream kind
start create recovery.conf (but not if we restore by id)
2016-11-15 11:44:57 +03:00
stalkerg
ed3e7a5551 Small fix restore logic. 2016-11-08 15:53:45 +03:00
stalkerg
78362a52d6 Move all backups to "backups" subdir. 2016-11-07 17:35:53 +03:00
stalkerg
bd01446a9d Try fixing restore command. 2016-11-02 21:04:24 +03:00
stalkerg
24c840392f Use --stream option only for backup. Add STREAM to show command. 2016-11-01 17:25:46 +03:00
stalkerg
9f2ad9d822 Remove date range and start use base36 from start_time as backup ID. 2016-10-31 18:19:11 +03:00
stalkerg
f0703e527c Remove ARCLOG_PATH option. 2016-10-18 20:22:53 +03:00
stalkerg
493de28819 Add new thread model to restore. 2016-09-06 10:48:29 +03:00
stalkerg
356ebd3728 Add checksums database support. 2016-07-07 18:38:56 +03:00
stalkerg
9471875b15 Add stream mode for save WAL during backup process. 2016-05-26 15:56:32 +03:00
stalkerg
e3b0f4485b Add support get ptrack from SQL for atomic. 2016-05-11 19:35:14 +03:00
Zhuravlev Uriy aka stalkerg
4f163d8b86 Make pg_control file optional for restore. 2016-03-02 20:50:33 +03:00
Zhuravlev Uriy aka stalkerg
07d4b8a030 Add threads for restore. 2016-02-29 21:49:53 +03:00
Zhuravlev Uriy aka stalkerg
9c475eccbf First version of ptrack support. 2016-02-27 21:07:55 +03:00
Michael Paquier
5c37daca69 Sanitize error checks
All the ERROR_* fields are removed in favor of a more simple layer
made of ERROR, FATAL, PANIC. The two last ones are not actually used
yet, thought there should be some code paths that would need more
polishing on this matter.

The error message emitted before leaving should be fine to let the
user know what is happening.
2016-01-19 12:41:30 +09:00
Michael Paquier
04834e73c7 Page-level backup using block tracking in WAL records
This commit improves the performance of page-level, or differential
backup, by not having to scan anymore all the pages of a relation file,
something that can be very long on large data sets, but by scanning the
list of blocks changed by WAL records since the last full or differential
backup.

As a restriction and to avoid potential data corruption should hint-bit
updates occur on a page, backups can only be taken from a server that has
wal_log_hints or data checksums enabled.

Base patch by Yury Zhuravlev, heavily modified by me.
2016-01-15 23:47:38 +09:00
Michael Paquier
e2bbf69403 Remove code duplication to get a node's current timeline
The same code was duplicated between restore and backup. At the same
time this commit introduces routines to fetch the control data file.
2016-01-15 14:09:31 +09:00
Michael Paquier
f94c5ab447 Sanitize logging facility
--debug and --verbose had actually the same meaning as they were aimed
at giving to the user information regarding how the process is running,
hence both options are merged into --verbose and use elog(LOG) to decide
if a given message should be printed out depending on the verbosity of
the call. This makes a couple of routines more readable as they do not
depend on any boolean checks.

The "_()" have been removed from the code, those are aimed at being used
for translation but having them mandatorily in each log message is just
useless noise. If needed, pgut.c should be updated in consequence to
have a more portable facility.

At the same time this commit takes care of putting into correct shape
some code paths more in-line with PostgreSQL policy. There are surely
more of this kind of ugly stuff but at this stage things are more simple
and more manageable.
2016-01-14 16:36:39 +09:00
Michael Paquier
3ac6d13329 Remove --compress-data/-Z
Performance of compression is quite questionable on many objects like
that and makes the routines aimed at managing file copy, backup and restore
more complicated than they should be.

This commit results in a largely simplified code in data.c, which will
be helpful when integrating differential backup using WAL file lookup.
2016-01-14 15:19:38 +09:00
Michael Paquier
9f1424bc87 Remove use of xlog_fname in code
Let's rely on Postgres stuff instead.

Based on a patch by YUriy Zhuravlev for the backup part, updated by
me for the restore part.
2016-01-13 16:28:51 +09:00
Michael Paquier
25ebddb02b Update CRC32 algorithm to CRC32C
This is to be compatible with Postgres >= 9.5 that switched to a more
performant algorithm.

Per reminder from Zhuravlev Uriy.
2015-12-07 21:44:33 +09:00
Michael Paquier
db249c800e Replace incremental backup by page-level differential backup
This will allow the introduction of file-level differential backup.
2014-01-30 15:58:55 +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
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
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
cf6ca26ba9 Remove notion of Xlog ID/offset and use XLogRecPtr instead
This simplifies algorithm and APIs a bit, and removes a duplication
function used to generate a file name...
2013-12-12 22:45:57 +09:00
Michael Paquier
8aa6b84b98 Fix history file parsing when fetched from archive
History file format has changed from 9.2 to 9.3 to indicate the WAL record
when timeline branched off. In 9.2, the complete WAL file name was used
while in 9.3 the WAL record is used (like 1/4000090). pg_rman contains a
copy of a function of postgres core code to parse the history file that
was not anymore compatible, leading to errors related to timelines.
2013-12-10 17:27:51 +09:00
Michael Paquier
bd75d08ef3 Rename XLogFileName to XLogFileNameLong
This is a lazy solution to avoid a conflict with the existing API in
xlog_internal.h, and should be corrected to use the one in core.
2013-12-10 03:29:47 +09:00
Michael Paquier
1bc0f9baff Support pg_rman for PG_VERSION_NUM >= 9.3
In Postgres 9.3, XLogRecPtr has been changed to a unique uint64, making
the old structure based on two uint32 obsolete. Note that this makes
pg_rman incompatible with PG <= 9.2.
2013-12-10 03:21:07 +09:00
otsuka.knj@gmail.com
0144cc4fd9 - Fix possible broken backup which is getting from standby.
Use --standby-host and --standby-port, if backup is getting from standby.
- Add --hard-copy restore option.
  The option can be used to copy archive WAL to archive directory instead of symlink.



git-svn-id: http://pg-rman.googlecode.com/svn/trunk@77 182aca00-e38e-11de-a668-6fd11605f5ce
2013-09-09 09:00:13 +00:00
otsuka.knj@gmail.com
068280f4a3 Supporting PostgreSQL 9.2.
Fix a bug about --recovery-target-time.
Fix SPEC files for using normal user. (Reported by Nagayasu-san)
Fix a compiling bug on no LZLib environment.
Add restriction about Incremental backup.


git-svn-id: http://pg-rman.googlecode.com/svn/trunk@71 182aca00-e38e-11de-a668-6fd11605f5ce
2013-01-24 06:49:34 +00:00
otsuka.knj@gmail.com
98b6bac4b9 Convert newline characters from CRLF to LF.
git-svn-id: http://pg-rman.googlecode.com/svn/trunk@70 182aca00-e38e-11de-a668-6fd11605f5ce
2013-01-24 06:35:48 +00:00
t.katsumata1122
78eed96f63 revised for pg_rman1.2.2
git-svn-id: http://pg-rman.googlecode.com/svn/trunk@48 182aca00-e38e-11de-a668-6fd11605f5ce
2011-11-28 04:22:05 +00:00
katsumata.tomonari@oss.ntt.co.jp
566c47a6fc release pg_rman-1.2.0.
git-svn-id: http://pg-rman.googlecode.com/svn/trunk@38 182aca00-e38e-11de-a668-6fd11605f5ce
2011-02-07 01:57:11 +00:00
itagaki.takahiro
4df4b1644f Sync the latest pgut and update copyrights.
git-svn-id: http://pg-rman.googlecode.com/svn/trunk@28 182aca00-e38e-11de-a668-6fd11605f5ce
2010-01-06 02:25:21 +00:00
itagaki.takahiro
e3b9fd4e16 Use join_path_components() if possible.
git-svn-id: http://pg-rman.googlecode.com/svn/trunk@27 182aca00-e38e-11de-a668-6fd11605f5ce
2009-12-27 07:30:55 +00:00
itagaki.takahiro
182444045c Fix typo and cleanup.
git-svn-id: http://pg-rman.googlecode.com/svn/trunk@26 182aca00-e38e-11de-a668-6fd11605f5ce
2009-12-22 22:47:10 +00:00
itagaki.takahiro
59d0911fa7 Fix a critical bug that pg_rman cannot restore database from incremental backup. Backup itself worked correctly, but restore command broke database files.
git-svn-id: http://pg-rman.googlecode.com/svn/trunk@25 182aca00-e38e-11de-a668-6fd11605f5ce
2009-12-22 07:36:31 +00:00
itagaki.takahiro
8863b7944b Adjust to be able to build on 8.3 or older versions.
git-svn-id: http://pg-rman.googlecode.com/svn/trunk@22 182aca00-e38e-11de-a668-6fd11605f5ce
2009-12-18 02:26:19 +00:00
itagaki.takahiro
f0d7a1254e Add missing headers and portable flock() implemented with fcntl() for Solaris.
git-svn-id: http://pg-rman.googlecode.com/svn/trunk@19 182aca00-e38e-11de-a668-6fd11605f5ce
2009-12-17 02:38:48 +00:00
itagaki.takahiro
08063f31f9 Fix typo in comments.
git-svn-id: http://pg-rman.googlecode.com/svn/trunk@13 182aca00-e38e-11de-a668-6fd11605f5ce
2009-12-10 13:16:08 +00:00
itagaki.takahiro
7fbb857d03 First import.
git-svn-id: http://pg-rman.googlecode.com/svn/trunk@2 182aca00-e38e-11de-a668-6fd11605f5ce
2009-12-08 00:21:28 +00:00