Commit Graph

632 Commits

Author SHA1 Message Date
Magnus Hagander d9bae53173 Implement streaming xlog for backup tools
Add option for parallel streaming of the transaction log while a
base backup is running, to get the logfiles before the server has
removed them.

Also add a tool called pg_receivexlog, which streams the transaction
log into files, creating a log archive without having to wait for
segments to complete, thus decreasing the window of data loss without
having to waste space using archive_timeout. This works best in
combination with archive_command - suggested usage docs etc coming later.
2011-10-26 20:13:33 +02:00
Peter Eisentraut 1bf80041e3 Translation updates 2011-08-17 14:07:46 +03:00
Peter Eisentraut 7f699804b1 Move \r out of translatable strings
The translation tools are very unhappy about seeing \r in translatable
strings, so move it to a separate fprintf call.
2011-08-17 10:52:35 +03:00
Magnus Hagander 1bb69245ab Adjust total size in pg_basebackup progress report when reality changes
When streaming including WAL, the size estimate will always be incorrect,
since we don't know how much WAL is included. To make sure the output doesn't
look completely unreasonable, this patch increases the total size whenever we
go past the estimate, to make sure we never go above 100%.
2011-08-16 16:58:58 +02:00
Peter Eisentraut 3b3f09351b Make pg_basebackup progress report translatable
Also fix a potential portability bug, because INT64_FORMAT is only
guaranteed to be available with snprintf, not fprintf.
2011-08-16 11:24:08 +03:00
Peter Eisentraut 005e5c30d1 Use less cryptic variable names 2011-08-16 11:19:50 +03:00
Peter Eisentraut ce8d7bb644 Replace printf format %i by %d
They are identical, but the overwhelming majority of the code uses %d,
so standardize on that.
2011-07-26 22:54:29 +03:00
Peter Eisentraut c6ef139376 Make _ be automatically included in GETTEXT_TRIGGERS
Since it's globally defined in c.h, it should be treated as a gettext
trigger everywhere.
2011-06-26 23:05:30 +03:00
Peter Eisentraut 1b11e239ca Replace := by = in nls.mk files
It currently doesn't make a difference, but it's inconsistent with
most other usage, and it might interfere with a future patch, so I'll
change it all in a separate commit.

Also, replace tabs with spaces for alignment.
2011-06-26 20:08:38 +03:00
Tom Lane 31156ce8b9 Fix oversights in pg_basebackup's -z (compression) option.
The short-form -z switch didn't work, for lack of telling getopt_long
about it; and even if specified long-form, it failed to do anything,
because the various tests elsewhere in the file would take
Z_DEFAULT_COMPRESSION (which is -1) as meaning "don't compress".

Per bug #6060 from Shigehiro Honda, though I editorialized on his patch
a bit.
2011-06-15 13:15:05 -04:00
Peter Eisentraut 74b1d29dd1 Translation updates for 9.1beta2 2011-06-09 23:02:48 +03:00
Bruce Momjian 6560407c7d Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
Alvaro Herrera 5177dfefc5 Make message more consistent 2011-05-30 12:43:14 -04:00
Peter Eisentraut 6fa79755bd Add pg_basebackup -z option for compression with default level 2011-05-30 01:02:02 +03:00
Peter Eisentraut d68714b29c Allow pg_basebackup compressed tar output to stdout 2011-05-29 01:18:17 +03:00
Peter Eisentraut c8d45152fa Message improvements 2011-05-24 21:35:06 +03:00
Peter Eisentraut 7f1f1bfdbb Remove redundant port number check
pg_basebackup doesn't need to police the format of port numbers.
libpq already does that.
2011-05-04 21:02:02 +03:00
Peter Eisentraut bff074b1ab Message style cleanup 2011-05-04 20:56:52 +03:00
Magnus Hagander 6693eb72c0 timeline is not needed in BaseBackup()
This code was accidentally part of the patch, it's only
needed for the code that's for 9.2. Not needing the timeline
also removes the need to call IDENTIFY_SYSTEM.

Noted by Peter E.
2011-04-27 20:39:20 +02:00
Bruce Momjian bf50caf105 pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
Greg Stark 7b66e2c086 fix up a couple non-prototypes of the form foo() to be foo(void) -- found using -Wstrict-prototypes 2011-03-27 21:31:41 +01:00
Magnus Hagander 4a0014806d Properly clear the verbose output of pg_basebackup
Don't leave partial filename information on the last status or
dangling characters if the previous filename was longer than
the current one.
2011-03-19 16:38:50 +01:00
Magnus Hagander a2e61ec319 Use NOWAIT when including WAL in base backup
Avoids warning and waiting for the last segment to be
archived, which isn't necessary when we're including the
required WAL in the backup itself.
2011-02-10 12:11:23 +01:00
Magnus Hagander 76129e7f14 Include more status information in walsender results
Add the current xlog insert location to the response of
IDENTIFY_SYSTEM, and adds result sets containing start
and stop location of backups to BASE_BACKUP responses.
2011-02-03 13:46:23 +01:00
Heikki Linnakangas 32866837f0 Fix typo 2011-01-31 18:29:38 +02:00
Magnus Hagander 507069de6d Add option to include WAL in base backup
When included, this makes the base backup a complete working
"clone" of the initial database, ready to have a postmaster
started against it without the need to set up any log archiving
or similar.

Magnus Hagander, reviewed by Fujii Masao and Heikki Linnakangas
2011-01-30 21:30:09 +01:00
Tom Lane f36920796e Fix another portability issue in pg_basebackup.
The target of sscanf with a %o format had better be of integer width,
but "mode_t" conceivably isn't that.  Another compiler warning seen
only on some platforms; this one I think is potentially a real bug
and not just a warning.
2011-01-23 14:26:51 -05:00
Tom Lane 10e99f15d4 Add .gitignore file to silence complaints about pg_basebackup. 2011-01-23 13:07:34 -05:00
Tom Lane b3cfcdaad2 Suppress uninitialized-variable warning. 2011-01-23 13:06:38 -05:00
Magnus Hagander d13e0975c9 Use pg_strcasecmp instead of strcasecmp for portability
Per buildfarm.
2011-01-23 17:35:02 +01:00
Magnus Hagander fe12263c9f filemode is parsed on win32 even if never used
Per buildfarm failure.
2011-01-23 14:45:23 +01:00
Magnus Hagander 048d148fe6 Add pg_basebackup tool for streaming base backups
This tool makes it possible to do the pg_start_backup/
copy files/pg_stop_backup step in a single command.

There are still some steps to be done before this is a
complete backup solution, such as the ability to stream
the required WAL logs, but it's still usable, and
could do with some buildfarm coverage.

In passing, make the checkpoint request optionally
fast instead of hardcoding it.

Magnus Hagander, reviewed by Fujii Masao and Dimitri Fontaine
2011-01-23 12:21:23 +01:00