pgbackrest.git / summary / log / commit / refs

commit    ee8aafb3cadd77682c97bcc74adb457e0723ebee
Author:   David Steele <david@pgmasters.net>
Date:     Sun May 06 23:53:42 2018 +0000

    v2.02: Parallel Asynchronous Archive Get and Configuration Includes
    
    Bug Fixes:
    
    * Fix directory syncs running recursively when only the specified directory should be synced. (Reported by Craig A. James.)
    * Fix archive-copy throwing "path not found" error for incr/diff backups. (Reported by yummyliu, Vitaliy Kukharik.)
    * Fix failure in manifest build when two or more files in PGDATA are linked to the same directory. (Reported by Vitaliy Kukharik.)
    * Fix delta restore failing when a linked file is missing.
    * Fix rendering of key/value and list options in help. (Reported by Clinton Adams.)
    
    Features:
    
    * Add asynchronous, parallel archive-get. This feature maintains a queue of WAL segments to help reduce latency when PostgreSQL requests a WAL segment with restore_command.
    * Add support for additional pgBackRest configuration files in the directory specified by the --config-include-path option. Add --config-path option for overriding the default base path of the --config and --config-include-path option. (Contributed by Cynthia Shang.)
    * Add repo-s3-token option to allow temporary credentials tokens to be configured. pgBackRest currently has no way to request new credentials so the entire command (e.g. backup, restore) must complete before the credentials expire. (Contributed by Yogesh Sharma.)
    
    Improvements:
    
    * Update the archive-push-queue-max, manifest-save-threshold, and buffer-size options to accept values in KB, MB, GB, TB, or PB where the multiplier is a power of 1024. (Contributed by Cynthia Shang.)
    * Make backup/restore path sync more efficient. Scanning the entire directory can be very expensive if there are a lot of small tables. The backup manifest contains the path list so use it to perform syncs instead of scanning the backup/restore path.
    * Show command parameters as well as command options in initial info log message.
    * Rename archive-queue-max option to archive-push-queue-max to avoid confusion with the new archive-get-queue-max option. The old option name will continue to be accepted.


README.md | 14 +- doc/resource/exe.cache | 3495 +++++++++++++++++++++++++++------------ doc/xml/index.xml | 12 +- doc/xml/release.xml | 22 +- lib/pgBackRest/Version.pm | 2 +- libc/lib/pgBackRest/LibCAuto.pm | 2 +- src/version.h | 2 +- test/code-count/file-type.yaml | 144 +- 8 files changed, 2586 insertions(+), 1107 deletions(-) diff --git a/README.md b/README.md index 49c14509a..9e089dd3d 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@ pgBackRest aims to be a simple, reliable backup and restore system that can seam Instead of relying on traditional backup tools like tar and rsync, pgBackRest implements all backup features internally and uses a custom protocol for communicating with remote systems. Removing reliance on tar and rsync allows for better solutions to database-specific backup challenges. The custom remote protocol allows for more flexibility and limits the types of connections that are required to perform a backup which increases security. -pgBackRest [v2.01](https://github.com/pgbackrest/pgbackrest/releases/tag/release/2.01) is the current stable release. Release notes are on the [Releases](http://www.pgbackrest.org/release.html) page. +pgBackRest [v2.02](https://github.com/pgbackrest/pgbackrest/releases/tag/release/2.02) is the current stable release. Release notes are on the [Releases](http://www.pgbackrest.org/release.html) page. -pgBackRest v1 will receive bugs fixes only until EOL. Documentation for v1 can be found [here](http://www.pgbackrest.org/1). +Documentation for v1 can be found [here](http://www.pgbackrest.org/1). No further releases are planned for v1 because v2 is backward-compatible with v1 options and repositories. ## Features @@ -60,13 +60,15 @@ If the repository is on a backup server, compression is performed on the databas The manifest contains checksums for every file in the backup so that during a restore it is possible to use these checksums to speed processing enormously. On a delta restore any files not present in the backup are first removed and then checksums are taken for the remaining files. Files that match the backup are left in place and the rest of the files are restored as usual. Parallel processing can lead to a dramatic reduction in restore times. -### Parallel WAL Archiving +### Parallel, Asynchronous WAL Push & Get -Dedicated commands are included for both pushing WAL to the archive and retrieving WAL from the archive. +Dedicated commands are included for pushing WAL to the archive and getting WAL from the archive. Both commands support parallelism to accelerate processing and run asynchronously to provide the fastest possible response time to PostgreSQL. -The push command automatically detects WAL segments that are pushed multiple times and de-duplicates when the segment is identical, otherwise an error is raised. The push and get commands both ensure that the database and repository match by comparing PostgreSQL versions and system identifiers. This precludes the possibility of misconfiguring the WAL archive location. +WAL push automatically detects WAL segments that are pushed multiple times and de-duplicates when the segment is identical, otherwise an error is raised. Asynchronous WAL push allows transfer to be offloaded to another process which compresses WAL segments in parallel for maximum throughput. This can be a critical feature for databases with extremely high write volume. -Asynchronous archiving allows transfer to be offloaded to another process which compresses WAL segments in parallel for maximum throughput. This can be a critical feature for databases with extremely high write volume. +Asynchronous WAL get maintains a local queue of WAL segments that are decompressed and ready for replay. This reduces the time needed to provide WAL to PostgreSQL which maximizes replay speed. Higher-latency connections and storage (such as S3) benefit the most. + +The push and get commands both ensure that the database and repository match by comparing PostgreSQL versions and system identifiers. This virtually eliminates the possibility of misconfiguring the WAL archive location. ### Tablespace & Link Support diff --git a/doc/resource/exe.cache b/doc/resource/exe.cache index e2ba9272a..619602acb 100644 --- a/doc/resource/exe.cache +++ b/doc/resource/exe.cache @@ -26,6 +26,21 @@ "ip" : "172.17.0.3" } }, + { + "key" : { + "cmd" : [ + "sudo -u postgres perl -V | grep USE_64_BIT_INT" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + " USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES" + ] + } + }, { "key" : { "cmd" : [ @@ -101,7 +116,7 @@ { "key" : { "cmd" : [ - "sudo mkdir /root/pgbackrest-release-2.01" + "sudo mkdir /root/pgbackrest-release-2.02" ], "host" : "pg-primary", "output" : false @@ -111,7 +126,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/build /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/build /root/pgbackrest-release-2.02" ], "host" : "pg-primary", "output" : false @@ -121,7 +136,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/lib /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/lib /root/pgbackrest-release-2.02" ], "host" : "pg-primary", "output" : false @@ -131,7 +146,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/libc /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/libc /root/pgbackrest-release-2.02" ], "host" : "pg-primary", "output" : false @@ -141,7 +156,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/src /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/src /root/pgbackrest-release-2.02" ], "host" : "pg-primary", "output" : false @@ -151,7 +166,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /root/pgbackrest-release-2.01/lib/pgBackRest \\", + "sudo cp -r /root/pgbackrest-release-2.02/lib/pgBackRest \\", " /usr/share/perl5" ], "host" : "pg-primary", @@ -202,7 +217,27 @@ { "key" : { "cmd" : [ - "sudo touch /etc/pgbackrest.conf" + "sudo mkdir /etc/pgbackrest" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo mkdir /etc/pgbackrest/conf.d" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo touch /etc/pgbackrest/pgbackrest.conf" ], "host" : "pg-primary", "output" : false @@ -212,7 +247,7 @@ { "key" : { "cmd" : [ - "sudo chmod 640 /etc/pgbackrest.conf" + "sudo chmod 640 /etc/pgbackrest/pgbackrest.conf" ], "host" : "pg-primary", "output" : false @@ -222,7 +257,7 @@ { "key" : { "cmd" : [ - "sudo chown postgres:postgres /etc/pgbackrest.conf" + "sudo chown postgres:postgres /etc/pgbackrest/pgbackrest.conf" ], "host" : "pg-primary", "output" : false @@ -232,7 +267,7 @@ { "key" : { "cmd" : [ - "sudo sh -c 'cd /root/pgbackrest-release-2.01/libc && \\", + "sudo sh -c 'cd /root/pgbackrest-release-2.02/libc && \\", " perl Makefile.PL INSTALLMAN1DIR=none INSTALLMAN3DIR=none'" ], "host" : "pg-primary", @@ -243,7 +278,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/libc test" + "sudo make -C /root/pgbackrest-release-2.02/libc test" ], "host" : "pg-primary", "output" : false @@ -253,7 +288,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/libc install" + "sudo make -C /root/pgbackrest-release-2.02/libc install" ], "host" : "pg-primary", "output" : false @@ -263,7 +298,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/src" + "sudo make -C /root/pgbackrest-release-2.02/src" ], "host" : "pg-primary", "output" : false @@ -273,7 +308,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/src install" + "sudo make -C /root/pgbackrest-release-2.02/src install" ], "host" : "pg-primary", "output" : false @@ -291,7 +326,7 @@ "type" : "exe", "value" : { "output" : [ - "pgBackRest 2.01 - General help", + "pgBackRest 2.02 - General help", "", "Usage:", " pgbackrest [options] [command]", @@ -383,7 +418,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "demo" : { @@ -412,7 +447,7 @@ { "key" : { "cmd" : [ - "sudo mkdir /var/lib/pgbackrest" + "sudo mkdir -p /var/lib/pgbackrest" ], "host" : "pg-primary", "output" : false @@ -441,7 +476,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -516,7 +551,33 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", + "host" : "pg-primary", + "option" : { + "global:archive-push" : { + "compress-level" : { + "value" : "3" + } + } + } + }, + "type" : "cfg-pgbackrest", + "value" : { + "config" : [ + "[demo]", + "pg1-path=/var/lib/pgsql/9.5/data", + "", + "[global]", + "repo1-path=/var/lib/pgbackrest", + "", + "[global:archive-push]", + "compress-level=3" + ] + } + }, + { + "key" : { + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -534,13 +595,16 @@ "", "[global]", "repo1-path=/var/lib/pgbackrest", - "repo1-retention-full=2" + "repo1-retention-full=2", + "", + "[global:archive-push]", + "compress-level=3" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -563,7 +627,10 @@ "repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO", "repo1-cipher-type=aes-256-cbc", "repo1-path=/var/lib/pgbackrest", - "repo1-retention-full=2" + "repo1-retention-full=2", + "", + "[global:archive-push]", + "compress-level=3" ] } }, @@ -585,7 +652,7 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: stanza-create command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --stanza=demo", + "P00 INFO: stanza-create command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --stanza=demo", "P00 INFO: stanza-create command end: completed successfully" ] } @@ -608,8 +675,8 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: check command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --stanza=demo", - "P00 INFO: WAL segment 000000010000000000000001 successfully stored in the archive at '/var/lib/pgbackrest/archive/demo/9.5-1/0000000100000000/000000010000000000000001-365637d48d5940b3d34658957cc949b77cf38030.gz'", + "P00 INFO: check command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --stanza=demo", + "P00 INFO: WAL segment 000000010000000000000001 successfully stored in the archive at '/var/lib/pgbackrest/archive/demo/9.5-1/0000000100000000/000000010000000000000001-84af42a4edb6ed214a7c92222dc53ba9a24374b8.gz'", "P00 INFO: check command end: completed successfully" ] } @@ -633,9 +700,9 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: backup command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo", + "P00 INFO: backup command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo", "P00 WARN: no prior backup exists, incr backup has been changed to full", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:06:10\": backup begins after the next regular checkpoint completes", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:09:04\": backup begins after the next regular checkpoint completes", "P00 INFO: backup start archive = 000000010000000000000002, lsn = 0/2000028", " [filtered 851 lines of output]", "P01 INFO: backup file /var/lib/pgsql/9.5/data/base/1/12216 (0B, 100%)", @@ -658,7 +725,7 @@ "type" : "exe", "value" : { "output" : [ - "20180320-000610F" + "20180506-150904F" ] } }, @@ -682,8 +749,8 @@ "value" : { "output" : [ " [filtered 4 lines of output]", - "P01 INFO: backup file /var/lib/pgsql/9.5/data/global/pg_control (8KB, 97%) checksum 7e9b3a469439ee054b8a404c20d65d11bc99c22b", - "P01 INFO: backup file /var/lib/pgsql/9.5/data/backup_label (236B, 100%) checksum fc1f53d72c25f867821dd7013a634e05885bb4c7", + "P01 INFO: backup file /var/lib/pgsql/9.5/data/global/pg_control (8KB, 97%) checksum faeb431326ac4bb336c43417b3f85b10e9370068", + "P01 INFO: backup file /var/lib/pgsql/9.5/data/backup_label (236B, 100%) checksum c1792126afe2aec4fd97d3297da51fabaaaf489f", "P00 INFO: diff backup size = 8.2KB", "P00 INFO: execute exclusive pg_stop_backup() and wait for all WAL segments to archive", "P00 INFO: backup stop archive = 000000010000000000000004, lsn = 0/40000F8", @@ -715,18 +782,18 @@ " db (current)", " wal archive min/max (9.5-1): 000000010000000000000002 / 000000010000000000000004", "", - " full backup: 20180320-000610F", - " timestamp start/stop: 2018-03-20 00:06:10 / 2018-03-20 00:06:15", + " full backup: 20180506-150904F", + " timestamp start/stop: 2018-05-06 15:09:04 / 2018-05-06 15:09:10", " wal start/stop: 000000010000000000000002 / 000000010000000000000002", " database size: 20.5MB, backup size: 20.5MB", " repository size: 2.4MB, repository backup size: 2.4MB", "", - " diff backup: 20180320-000610F_20180320-000616D", - " timestamp start/stop: 2018-03-20 00:06:16 / 2018-03-20 00:06:20", + " diff backup: 20180506-150904F_20180506-150910D", + " timestamp start/stop: 2018-05-06 15:09:10 / 2018-05-06 15:09:13", " wal start/stop: 000000010000000000000004 / 000000010000000000000004", " database size: 20.5MB, backup size: 8.2KB", " repository size: 2.4MB, repository backup size: 400B", - " backup reference list: 20180320-000610F" + " backup reference list: 20180506-150904F" ] } }, @@ -864,9 +931,9 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: backup command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --type=incr", - "P00 INFO: last backup label = 20180320-000610F_20180320-000616D, version = 2.01", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:06:35\": backup begins after the next regular checkpoint completes", + "P00 INFO: backup command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --type=incr", + "P00 INFO: last backup label = 20180506-150904F_20180506-150910D, version = 2.02", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:09:28\": backup begins after the next regular checkpoint completes", "P00 INFO: backup start archive = 000000020000000000000006, lsn = 0/6000028", "P01 INFO: backup file /var/lib/pgsql/9.5/data/pg_multixact/offsets/0000 (8KB, 31%) checksum 0631457264ff7f8d5fb1edc2c0211992a67c73e6", " [filtered 11 lines of output]" @@ -875,7 +942,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -896,7 +963,10 @@ "repo1-cipher-type=aes-256-cbc", "repo1-path=/var/lib/pgbackrest", "repo1-retention-full=2", - "start-fast=y" + "start-fast=y", + "", + "[global:archive-push]", + "compress-level=3" ] } }, @@ -919,11 +989,11 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: backup command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --type=incr", - "P00 INFO: last backup label = 20180320-000610F_20180320-000635I, version = 2.01", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:06:39\": backup begins after the requested immediate checkpoint completes", + "P00 INFO: backup command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --type=incr", + "P00 INFO: last backup label = 20180506-150904F_20180506-150928I, version = 2.02", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:09:32\": backup begins after the requested immediate checkpoint completes", "P00 INFO: backup start archive = 000000020000000000000007, lsn = 0/7000028", - "P01 INFO: backup file /var/lib/pgsql/9.5/data/global/pg_control (8KB, 97%) checksum bb387f3c80e51b3a86746433b0fcb51b6c1dc72d", + "P01 INFO: backup file /var/lib/pgsql/9.5/data/global/pg_control (8KB, 97%) checksum ae29ae95dd56aff77170097e01fe4b1c42c90076", " [filtered 8 lines of output]" ] } @@ -959,9 +1029,9 @@ "value" : { "output" : [ " [filtered 2 lines of output]", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:06:44\": backup begins after the requested immediate checkpoint completes", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:09:37\": backup begins after the requested immediate checkpoint completes", "P00 INFO: backup start archive = 000000020000000000000008, lsn = 0/8000028", - "P00 ERROR: [047]: unable to create path '/var/lib/pgbackrest/backup/demo/20180320-000610F_20180320-000644I': Permission denied", + "P00 ERROR: [047]: unable to create path '/var/lib/pgbackrest/backup/demo/20180506-150904F_20180506-150937I': Permission denied", "P00 INFO: backup command end: aborted with exception [047]" ] } @@ -996,18 +1066,18 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: backup command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --type=incr", - "P00 INFO: last backup label = 20180320-000610F_20180320-000639I, version = 2.01", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:06:46\": backup begins after the requested immediate checkpoint completes", + "P00 INFO: backup command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --type=incr", + "P00 INFO: last backup label = 20180506-150904F_20180506-150932I, version = 2.02", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:09:39\": backup begins after the requested immediate checkpoint completes", "P00 ERROR: [057]: ERROR: a backup is already in progress", " HINT: Run pg_stop_backup() and try again.:", - " select to_char(current_timestamp, 'YYYY-MM-DD HH24:MI:SS.US TZ'), pg_xlogfile_name(lsn), lsn::text from pg_start_backup('pgBackRest backup started at 2018-03-20 00:06:46', true) as lsn" + " select to_char(current_timestamp, 'YYYY-MM-DD HH24:MI:SS.US TZ'), pg_xlogfile_name(lsn), lsn::text from pg_start_backup('pgBackRest backup started at 2018-05-06 15:09:39', true) as lsn" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -1029,7 +1099,10 @@ "repo1-path=/var/lib/pgbackrest", "repo1-retention-full=2", "start-fast=y", - "stop-auto=y" + "stop-auto=y", + "", + "[global:archive-push]", + "compress-level=3" ] } }, @@ -1052,20 +1125,345 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: backup command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --stop-auto --type=incr", - "P00 INFO: last backup label = 20180320-000610F_20180320-000639I, version = 2.01", + "P00 INFO: backup command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --stop-auto --type=incr", + "P00 INFO: last backup label = 20180506-150904F_20180506-150932I, version = 2.02", "P00 WARN: the cluster is already in backup mode but no pgBackRest backup process is running. pg_stop_backup() will be called so a new backup can be started.", "P00 INFO: execute exclusive pg_stop_backup() and wait for all WAL segments to archive", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:06:48\": backup begins after the requested immediate checkpoint completes", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:09:41\": backup begins after the requested immediate checkpoint completes", "P00 INFO: backup start archive = 000000020000000000000009, lsn = 0/9000028", - "P01 INFO: backup file /var/lib/pgsql/9.5/data/global/pg_control (8KB, 85%) checksum 780c4dee67fd64882d212825bc18e6ffbc0ee8fb", + "P01 INFO: backup file /var/lib/pgsql/9.5/data/global/pg_control (8KB, 85%) checksum 24f5eaf6d17b422293d58deb4df9a81550344540", " [filtered 9 lines of output]" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "cmd" : [ + "sudo -u postgres pgbackrest --output=json info" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "[", + " {", + " \"archive\" : [", + " {", + " \"database\" : {", + " \"id\" : 1", + " },", + " \"id\" : \"9.5-1\",", + " \"max\" : \"000000020000000000000009\",", + " \"min\" : \"000000010000000000000002\"", + " }", + " ],", + " \"backup\" : [", + " {", + " \"archive\" : {", + " \"start\" : \"000000010000000000000002\",", + " \"stop\" : \"000000010000000000000002\"", + " },", + " \"backrest\" : {", + " \"format\" : 5,", + " \"version\" : \"2.02\"", + " },", + " \"database\" : {", + " \"id\" : 1", + " },", + " \"info\" : {", + " \"delta\" : 21575104,", + " \"repository\" : {", + " \"delta\" : 2530704,", + " \"size\" : 2530704", + " },", + " \"size\" : 21575104", + " },", + " \"label\" : \"20180506-150904F\",", + " \"prior\" : null,", + " \"reference\" : null,", + " \"timestamp\" : {", + " \"start\" : 1525619344,", + " \"stop\" : 1525619350", + " },", + " \"type\" : \"full\"", + " },", + " {", + " \"archive\" : {", + " \"start\" : \"000000010000000000000004\",", + " \"stop\" : \"000000010000000000000004\"", + " },", + " \"backrest\" : {", + " \"format\" : 5,", + " \"version\" : \"2.02\"", + " },", + " \"database\" : {", + " \"id\" : 1", + " },", + " \"info\" : {", + " \"delta\" : 8428,", + " \"repository\" : {", + " \"delta\" : 400,", + " \"size\" : 2530704", + " },", + " \"size\" : 21575104", + " },", + " \"label\" : \"20180506-150904F_20180506-150910D\",", + " \"prior\" : \"20180506-150904F\",", + " \"reference\" : [", + " \"20180506-150904F\"", + " ],", + " \"timestamp\" : {", + " \"start\" : 1525619350,", + " \"stop\" : 1525619353", + " },", + " \"type\" : \"diff\"", + " },", + " {", + " \"archive\" : {", + " \"start\" : \"000000020000000000000006\",", + " \"stop\" : \"000000020000000000000006\"", + " },", + " \"backrest\" : {", + " \"format\" : 5,", + " \"version\" : \"2.02\"", + " },", + " \"database\" : {", + " \"id\" : 1", + " },", + " \"info\" : {", + " \"delta\" : 25732,", + " \"repository\" : {", + " \"delta\" : 976,", + " \"size\" : 2530864", + " },", + " \"size\" : 21575672", + " },", + " \"label\" : \"20180506-150904F_20180506-150928I\",", + " \"prior\" : \"20180506-150904F_20180506-150910D\",", + " \"reference\" : [", + " \"20180506-150904F\"", + " ],", + " \"timestamp\" : {", + " \"start\" : 1525619368,", + " \"stop\" : 1525619371", + " },", + " \"type\" : \"incr\"", + " },", + " {", + " \"archive\" : {", + " \"start\" : \"000000020000000000000007\",", + " \"stop\" : \"000000020000000000000007\"", + " },", + " \"backrest\" : {", + " \"format\" : 5,", + " \"version\" : \"2.02\"", + " },", + " \"database\" : {", + " \"id\" : 1", + " },", + " \"info\" : {", + " \"delta\" : 8428,", + " \"repository\" : {", + " \"delta\" : 400,", + " \"size\" : 2530864", + " },", + " \"size\" : 21575672", + " },", + " \"label\" : \"20180506-150904F_20180506-150932I\",", + " \"prior\" : \"20180506-150904F_20180506-150928I\",", + " \"reference\" : [", + " \"20180506-150904F\",", + " \"20180506-150904F_20180506-150928I\"", + " ],", + " \"timestamp\" : {", + " \"start\" : 1525619372,", + " \"stop\" : 1525619376", + " },", + " \"type\" : \"incr\"", + " },", + " {", + " \"archive\" : {", + " \"start\" : \"000000020000000000000009\",", + " \"stop\" : \"000000020000000000000009\"", + " },", + " \"backrest\" : {", + " \"format\" : 5,", + " \"version\" : \"2.02\"", + " },", + " \"database\" : {", + " \"id\" : 1", + " },", + " \"info\" : {", + " \"delta\" : 9628,", + " \"repository\" : {", + " \"delta\" : 976,", + " \"size\" : 2531008", + " },", + " \"size\" : 21575952", + " },", + " \"label\" : \"20180506-150904F_20180506-150941I\",", + " \"prior\" : \"20180506-150904F_20180506-150932I\",", + " \"reference\" : [", + " \"20180506-150904F\",", + " \"20180506-150904F_20180506-150928I\"", + " ],", + " \"timestamp\" : {", + " \"start\" : 1525619381,", + " \"stop\" : 1525619386", + " },", + " \"type\" : \"incr\"", + " }", + " ],", + " \"db\" : [", + " {", + " \"id\" : 1,", + " \"system-id\" : 6552485122075124594,", + " \"version\" : \"9.5\"", + " }", + " ],", + " \"name\" : \"demo\",", + " \"status\" : {", + " \"code\" : 0,", + " \"message\" : \"ok\"", + " }", + " }", + "]" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres mkdir -p /home/postgres/pgbackrest/doc/example" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres cp -r /backrest/doc/example/* \\", + " /home/postgres/pgbackrest/doc/example" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres cat \\", + " /home/postgres/pgbackrest/doc/example/pgsql-pgbackrest-info.sql" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "-- An example of monitoring pgBackRest from within PostgresSQL", + "--", + "-- Use copy to export data from the pgBackRest info command into the jsonb", + "-- type so it can be queried directly by PostgresSQL.", + "", + "-- Create monitor schema", + "create schema monitor;", + "", + "-- Get pgBackRest info in JSON format", + "create function monitor.pgbackrest_info()", + " returns jsonb AS $$", + "declare", + " data jsonb;", + "begin", + " -- Create a temp table to hold the JSON data", + " create temp table temp_pgbackrest_data (data jsonb);", + "", + " -- Copy data into the table directory from the pgBackRest into command", + " copy temp_pgbackrest_data (data)", + " from program", + " 'pgbackrest --output=json info | tr ''\\n'' '' ''' (format text);", + "", + " select temp_pgbackrest_data.data", + " into data", + " from temp_pgbackrest_data;", + "", + " drop table temp_pgbackrest_data;", + "", + " return data;", + "end $$ language plpgsql;" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres psql -f \\", + " /home/postgres/pgbackrest/doc/example/pgsql-pgbackrest-info.sql" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres cat \\", + " /home/postgres/pgbackrest/doc/example/pgsql-pgbackrest-query.sql" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "-- Get last successful backup for each stanza", + "--", + "-- Requires the monitor.pgbackrest_info function.", + "with stanza as", + "(", + " select data->'name' as name,", + " data->'backup'->(", + " jsonb_array_length(data->'backup') - 1) as last_backup,", + " data->'archive'->(", + " jsonb_array_length(data->'archive') - 1) as current_archive", + " from jsonb_array_elements(monitor.pgbackrest_info()) as data", + ")", + "select name,", + " to_timestamp(", + " (last_backup->'timestamp'->>'stop')::numeric) as last_successful_backup,", + " current_archive->>'max' as last_archived_wal", + " from stanza;" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres psql -f \\", + " /home/postgres/pgbackrest/doc/example/pgsql-pgbackrest-query.sql" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + " name | last_successful_backup | last_archived_wal ", + "--------+------------------------+--------------------------", + " \"demo\" | 2018-05-06 15:09:46+00 | 000000020000000000000009", + "(1 row)" + ] + } + }, + { + "key" : { + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -1087,7 +1485,10 @@ "repo1-path=/var/lib/pgbackrest", "repo1-retention-full=2", "start-fast=y", - "stop-auto=y" + "stop-auto=y", + "", + "[global:archive-push]", + "compress-level=3" ] } }, @@ -1101,7 +1502,7 @@ "filter" : true, "filter-context" : 2, "list" : [ - "archive retention on backup 20180320-000610F|remove archive" + "archive retention on backup 20180506-150904F|remove archive" ] }, "host" : "pg-primary", @@ -1112,8 +1513,8 @@ "output" : [ " [filtered 860 lines of output]", "P00 INFO: backup command end: completed successfully", - "P00 INFO: expire command begin 2.01: --log-level-console=detail --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo", - "P00 DETAIL: archive retention on backup 20180320-000610F, archiveId = 9.5-1, start = 000000010000000000000002", + "P00 INFO: expire command begin", + "P00 DETAIL: archive retention on backup 20180506-150904F, archiveId = 9.5-1, start = 000000010000000000000002", "P00 DETAIL: no archive to remove, archiveId = 9.5-1", "P00 INFO: expire command end: completed successfully" ] @@ -1130,7 +1531,7 @@ "type" : "exe", "value" : { "output" : [ - "20180320-000653F" + "20180506-150948F" ] } }, @@ -1144,7 +1545,7 @@ "filter" : true, "filter-context" : 2, "list" : [ - "expire full backup set\\: 20180320-000610F|archive retention on backup 20180320-000653F|remove archive" + "expire full backup set\\: 20180506-150904F|archive retention on backup 20180506-150948F|remove archive" ] }, "host" : "pg-primary", @@ -1155,17 +1556,17 @@ "output" : [ " [filtered 860 lines of output]", "P00 INFO: backup command end: completed successfully", - "P00 INFO: expire command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo", - "P00 INFO: expire full backup set: 20180320-000610F, 20180320-000610F_20180320-000616D, 20180320-000610F_20180320-000635I, 20180320-000610F_20180320-000639I, 20180320-000610F_20180320-000648I", - "P00 INFO: remove expired backup 20180320-000610F_20180320-000648I", - "P00 INFO: remove expired backup 20180320-000610F_20180320-000639I", + "P00 INFO: expire command begin", + "P00 INFO: expire full backup set: 20180506-150904F, 20180506-150904F_20180506-150910D, 20180506-150904F_20180506-150928I, 20180506-150904F_20180506-150932I, 20180506-150904F_20180506-150941I", + "P00 INFO: remove expired backup 20180506-150904F_20180506-150941I", + "P00 INFO: remove expired backup 20180506-150904F_20180506-150932I", " [filtered 3 lines of output]" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -1188,7 +1589,10 @@ "repo1-retention-diff=1", "repo1-retention-full=2", "start-fast=y", - "stop-auto=y" + "stop-auto=y", + "", + "[global:archive-push]", + "compress-level=3" ] } }, @@ -1213,7 +1617,7 @@ "type" : "exe", "value" : { "output" : [ - "20180320-000701F_20180320-000710D" + "20180506-150955F_20180506-151002D" ] } }, @@ -1237,7 +1641,7 @@ "filter" : true, "filter-context" : 2, "list" : [ - "expire diff backup set: 20180320-000701F_20180320-000710D" + "expire diff backup set: 20180506-150955F_20180506-151002D" ] }, "host" : "pg-primary", @@ -1248,16 +1652,16 @@ "output" : [ " [filtered 10 lines of output]", "P00 INFO: backup command end: completed successfully", - "P00 INFO: expire command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-diff=1 --repo1-retention-full=2 --stanza=demo", - "P00 INFO: expire diff backup set: 20180320-000701F_20180320-000710D, 20180320-000701F_20180320-000714I", - "P00 INFO: remove expired backup 20180320-000701F_20180320-000714I", - "P00 INFO: remove expired backup 20180320-000701F_20180320-000710D" + "P00 INFO: expire command begin", + "P00 INFO: expire diff backup set: 20180506-150955F_20180506-151002D, 20180506-150955F_20180506-151006I", + "P00 INFO: remove expired backup 20180506-150955F_20180506-151006I", + "P00 INFO: remove expired backup 20180506-150955F_20180506-151002D" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -1280,7 +1684,10 @@ "repo1-retention-diff=2", "repo1-retention-full=2", "start-fast=y", - "stop-auto=y" + "stop-auto=y", + "", + "[global:archive-push]", + "compress-level=3" ] } }, @@ -1295,7 +1702,7 @@ "type" : "exe", "value" : { "output" : [ - "20180320-000701F_20180320-000719D" + "20180506-150955F_20180506-151009D" ] } }, @@ -1332,10 +1739,10 @@ "output" : [ " [filtered 8 lines of output]", "P00 INFO: execute exclusive pg_stop_backup() and wait for all WAL segments to archive", - "P00 INFO: backup stop archive = 000000020000000000000012, lsn = 0/120000F8", - "P00 INFO: new backup label = 20180320-000701F_20180320-000724D", + "P00 INFO: backup stop archive = 000000020000000000000014, lsn = 0/140000F8", + "P00 INFO: new backup label = 20180506-150955F_20180506-151015D", "P00 INFO: backup command end: completed successfully", - "P00 INFO: expire command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-diff=2 --repo1-retention-full=2 --stanza=demo" + "P00 INFO: expire command begin" ] } }, @@ -1350,7 +1757,7 @@ "type" : "exe", "value" : { "output" : [ - "20180320-000701F_20180320-000724D" + "20180506-150955F_20180506-151015D" ] } }, @@ -1364,7 +1771,7 @@ "filter" : true, "filter-context" : 2, "list" : [ - "archive retention on backup 20180320-000701F_20180320-000719D|remove archive" + "archive retention on backup 20180506-150955F_20180506-151009D|remove archive" ] }, "host" : "pg-primary", @@ -1373,14 +1780,14 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: expire command begin 2.01: --log-level-console=detail --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-archive=1 --repo1-retention-archive-type=diff --repo1-retention-diff=2 --repo1-retention-full=2 --stanza=demo", - "P00 DETAIL: archive retention on backup 20180320-000653F, archiveId = 9.5-1, start = 00000002000000000000000A, stop = 00000002000000000000000A", - "P00 DETAIL: archive retention on backup 20180320-000701F, archiveId = 9.5-1, start = 00000002000000000000000C, stop = 00000002000000000000000C", - "P00 DETAIL: archive retention on backup 20180320-000701F_20180320-000719D, archiveId = 9.5-1, start = 00000002000000000000000F, stop = 00000002000000000000000F", - "P00 DETAIL: archive retention on backup 20180320-000701F_20180320-000724D, archiveId = 9.5-1, start = 000000020000000000000012", - "P00 DETAIL: remove archive: archiveId = 9.5-1, start = 00000002000000000000000B, stop = 00000002000000000000000B", - "P00 DETAIL: remove archive: archiveId = 9.5-1, start = 00000002000000000000000D, stop = 00000002000000000000000E", - "P00 DETAIL: remove archive: archiveId = 9.5-1, start = 000000020000000000000010, stop = 000000020000000000000011", + "P00 INFO: expire command begin 2.02: --log-level-console=detail --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-archive=1 --repo1-retention-archive-type=diff --repo1-retention-diff=2 --repo1-retention-full=2 --stanza=demo", + "P00 DETAIL: archive retention on backup 20180506-150948F, archiveId = 9.5-1, start = 00000002000000000000000B, stop = 00000002000000000000000B", + "P00 DETAIL: archive retention on backup 20180506-150955F, archiveId = 9.5-1, start = 00000002000000000000000D, stop = 00000002000000000000000D", + "P00 DETAIL: archive retention on backup 20180506-150955F_20180506-151009D, archiveId = 9.5-1, start = 000000020000000000000011, stop = 000000020000000000000011", + "P00 DETAIL: archive retention on backup 20180506-150955F_20180506-151015D, archiveId = 9.5-1, start = 000000020000000000000014", + "P00 DETAIL: remove archive: archiveId = 9.5-1, start = 00000002000000000000000C, stop = 00000002000000000000000C", + "P00 DETAIL: remove archive: archiveId = 9.5-1, start = 00000002000000000000000E, stop = 000000020000000000000010", + "P00 DETAIL: remove archive: archiveId = 9.5-1, start = 000000020000000000000012, stop = 000000020000000000000013", "P00 INFO: expire command end: completed successfully" ] } @@ -1414,7 +1821,7 @@ "type" : "exe", "value" : { "output" : [ - " [filtered 877 lines of output]", + " [filtered 878 lines of output]", "P01 DETAIL: restore file /var/lib/pgsql/9.5/data/base/1/12211 - exists and is zero size (0B, 100%)", "P00 INFO: write /var/lib/pgsql/9.5/data/recovery.conf", "P00 INFO: restore global/pg_control (performed last to ensure aborted restores cannot be started)", @@ -1517,7 +1924,22 @@ { "key" : { "cmd" : [ - "sudo -u postgres du -sh /var/lib/pgsql/9.5/data/base/16384" + "sudo -u postgres psql -Atc \"select oid from pg_database where datname = 'test1'\"" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "24576" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres du -sh /var/lib/pgsql/9.5/data/base/24576" ], "host" : "pg-primary", "output" : true @@ -1525,7 +1947,7 @@ "type" : "exe", "value" : { "output" : [ - "6.9M\t/var/lib/pgsql/9.5/data/base/16384" + "6.9M\t/var/lib/pgsql/9.5/data/base/24576" ] } }, @@ -1607,14 +2029,14 @@ "type" : "exe", "value" : { "output" : [ - "psql: FATAL: relation mapping file \"base/16384/pg_filenode.map\" contains invalid data" + "psql: FATAL: relation mapping file \"base/24576/pg_filenode.map\" contains invalid data" ] } }, { "key" : { "cmd" : [ - "sudo -u postgres du -sh /var/lib/pgsql/9.5/data/base/16384" + "sudo -u postgres du -sh /var/lib/pgsql/9.5/data/base/24576" ], "host" : "pg-primary", "output" : true @@ -1622,7 +2044,7 @@ "type" : "exe", "value" : { "output" : [ - "152K\t/var/lib/pgsql/9.5/data/base/16384" + "152K\t/var/lib/pgsql/9.5/data/base/24576" ] } }, @@ -1664,7 +2086,7 @@ " 1 | template1", " 12373 | template0", " 12378 | postgres", - " 16385 | test2", + " 24577 | test2", "(4 rows)" ] } @@ -1719,7 +2141,7 @@ "type" : "exe", "value" : { "output" : [ - "2018-03-20 00:08:02.310193+00" + "2018-05-06 15:10:50.54322+00" ] } }, @@ -1765,7 +2187,7 @@ "key" : { "cmd" : [ "sudo -u postgres pgbackrest --stanza=demo --delta \\", - " --type=time \"--target=2018-03-20 00:08:02.310193+00\" restore" + " --type=time \"--target=2018-05-06 15:10:50.54322+00\" restore" ], "host" : "pg-primary", "output" : false @@ -1801,7 +2223,7 @@ "value" : { "output" : [ "restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'", - "recovery_target_time = '2018-03-20 00:08:02.310193+00'" + "recovery_target_time = '2018-05-06 15:10:50.54322+00'" ] } }, @@ -1868,16 +2290,16 @@ "type" : "exe", "value" : { "output" : [ - "LOG: database system was interrupted; last known up at 2018-03-20 00:07:56 UTC", - "LOG: starting point-in-time recovery to 2018-03-20 00:08:02.310193+00", + "LOG: database system was interrupted; last known up at 2018-05-06 15:10:46 UTC", + "LOG: starting point-in-time recovery to 2018-05-06 15:10:50.54322+00", "LOG: restored log file \"00000004.history\" from archive", - "LOG: restored log file \"000000040000000000000017\" from archive", - "LOG: redo starts at 0/17000028", - "LOG: consistent recovery state reached at 0/170000F8", - "LOG: restored log file \"000000040000000000000018\" from archive", - "LOG: recovery stopping before commit of transaction 627, time 2018-03-20 00:08:02.421161+00", - "LOG: redo done at 0/18022FF8", - "LOG: last completed transaction was at log time 2018-03-20 00:08:02.206459+00", + "LOG: restored log file \"000000040000000000000019\" from archive", + "LOG: redo starts at 0/19000028", + "LOG: consistent recovery state reached at 0/190000F8", + "LOG: restored log file \"00000004000000000000001A\" from archive", + "LOG: recovery stopping before commit of transaction 630, time 2018-05-06 15:10:50.727111+00", + "LOG: redo done at 0/1A01BBF8", + "LOG: last completed transaction was at log time 2018-05-06 15:10:50.323779+00", "LOG: selected new timeline ID: 5", "LOG: restored log file \"00000004.history\" from archive", " [filtered 3 lines of output]" @@ -1923,7 +2345,7 @@ "type" : "exe", "value" : { "output" : [ - "20180320-000701F_20180320-000755D" + "20180506-150955F_20180506-151045D" ] } }, @@ -1951,7 +2373,7 @@ "key" : { "cmd" : [ "sudo -u postgres pgbackrest --stanza=demo --delta \\", - " --type=time \"--target=2018-03-20 00:08:02.310193+00\" restore" + " --type=time \"--target=2018-05-06 15:10:50.54322+00\" restore" ], "host" : "pg-primary", "output" : false @@ -2031,14 +2453,14 @@ "type" : "exe", "value" : { "output" : [ - "LOG: database system was interrupted; last known up at 2018-03-20 00:08:12 UTC", - "LOG: starting point-in-time recovery to 2018-03-20 00:08:02.310193+00", + "LOG: database system was interrupted; last known up at 2018-05-06 15:11:00 UTC", + "LOG: starting point-in-time recovery to 2018-05-06 15:10:50.54322+00", "LOG: restored log file \"00000005.history\" from archive", - "LOG: restored log file \"000000050000000000000019\" from archive", - "LOG: redo starts at 0/19000028", - "LOG: consistent recovery state reached at 0/190000F8", - "LOG: redo done at 0/190000F8", - "LOG: restored log file \"000000050000000000000019\" from archive", + "LOG: restored log file \"00000005000000000000001B\" from archive", + "LOG: redo starts at 0/1B000028", + "LOG: consistent recovery state reached at 0/1B0000F8", + "LOG: redo done at 0/1B0000F8", + "LOG: restored log file \"00000005000000000000001B\" from archive", " [filtered 7 lines of output]" ] } @@ -2052,7 +2474,7 @@ "filter" : false, "filter-context" : 2, "list" : [ - "20180320-000701F_20180320-000755D" + "20180506-150955F_20180506-151045D" ] }, "host" : "pg-primary", @@ -2065,47 +2487,47 @@ " status: ok", "", " db (current)", - " wal archive min/max (9.5-1): 00000002000000000000000A / 000000050000000000000019", + " wal archive min/max (9.5-1): 00000002000000000000000B / 00000005000000000000001B", "", - " full backup: 20180320-000653F", - " timestamp start/stop: 2018-03-20 00:06:53 / 2018-03-20 00:07:00", - " wal start/stop: 00000002000000000000000A / 00000002000000000000000A", + " full backup: 20180506-150948F", + " timestamp start/stop: 2018-05-06 15:09:48 / 2018-05-06 15:09:54", + " wal start/stop: 00000002000000000000000B / 00000002000000000000000B", " database size: 20.5MB, backup size: 20.5MB", " repository size: 2.4MB, repository backup size: 2.4MB", "", - " full backup: 20180320-000701F", - " timestamp start/stop: 2018-03-20 00:07:01 / 2018-03-20 00:07:07", - " wal start/stop: 00000002000000000000000C / 00000002000000000000000C", + " full backup: 20180506-150955F", + " timestamp start/stop: 2018-05-06 15:09:55 / 2018-05-06 15:10:01", + " wal start/stop: 00000002000000000000000D / 00000002000000000000000D", " database size: 20.5MB, backup size: 20.5MB", " repository size: 2.4MB, repository backup size: 2.4MB", "", - " diff backup: 20180320-000701F_20180320-000724D", - " timestamp start/stop: 2018-03-20 00:07:24 / 2018-03-20 00:07:28", - " wal start/stop: 000000020000000000000012 / 000000020000000000000012", + " diff backup: 20180506-150955F_20180506-151015D", + " timestamp start/stop: 2018-05-06 15:10:15 / 2018-05-06 15:10:18", + " wal start/stop: 000000020000000000000014 / 000000020000000000000014", " database size: 20.5MB, backup size: 9.8KB", " repository size: 2.4MB, repository backup size: 1KB", - " backup reference list: 20180320-000701F", + " backup reference list: 20180506-150955F", "", - " incr backup: 20180320-000701F_20180320-000738I", - " timestamp start/stop: 2018-03-20 00:07:38 / 2018-03-20 00:07:44", - " wal start/stop: 000000030000000000000014 / 000000030000000000000014", - " database size: 33.9MB, backup size: 13.4MB", + " incr backup: 20180506-150955F_20180506-151027I", + " timestamp start/stop: 2018-05-06 15:10:27 / 2018-05-06 15:10:33", + " wal start/stop: 000000030000000000000016 / 000000030000000000000016", + " database size: 33.9MB, backup size: 13.5MB", " repository size: 4MB, repository backup size: 1.6MB", - " backup reference list: 20180320-000701F", + " backup reference list: 20180506-150955F", "", - " diff backup: 20180320-000701F_20180320-000755D", - " timestamp start/stop: 2018-03-20 00:07:55 / 2018-03-20 00:08:00", - " wal start/stop: 000000040000000000000017 / 000000040000000000000017", - " database size: 27.2MB, backup size: 6.7MB", - " repository size: 3.2MB, repository backup size: 820KB", - " backup reference list: 20180320-000701F", + " diff backup: 20180506-150955F_20180506-151045D", + " timestamp start/stop: 2018-05-06 15:10:45 / 2018-05-06 15:10:49", + " wal start/stop: 000000040000000000000019 / 000000040000000000000019", + " database size: 27.2MB, backup size: 6.8MB", + " repository size: 3.2MB, repository backup size: 831.6KB", + " backup reference list: 20180506-150955F", "", - " incr backup: 20180320-000701F_20180320-000811I", - " timestamp start/stop: 2018-03-20 00:08:11 / 2018-03-20 00:08:15", - " wal start/stop: 000000050000000000000019 / 000000050000000000000019", - " database size: 27.2MB, backup size: 2MB", - " repository size: 3.2MB, repository backup size: 209.3KB", - " backup reference list: 20180320-000701F, 20180320-000701F_20180320-000755D" + " incr backup: 20180506-150955F_20180506-151059I", + " timestamp start/stop: 2018-05-06 15:10:59 / 2018-05-06 15:11:03", + " wal start/stop: 00000005000000000000001B / 00000005000000000000001B", + " database size: 27.2MB, backup size: 1.9MB", + " repository size: 3.2MB, repository backup size: 209.9KB", + " backup reference list: 20180506-150955F, 20180506-150955F_20180506-151045D" ] } }, @@ -2123,8 +2545,8 @@ "key" : { "cmd" : [ "sudo -u postgres pgbackrest --stanza=demo --delta \\", - " --type=time \"--target=2018-03-20 00:08:02.310193+00\" \\", - " --set=20180320-000701F_20180320-000755D restore" + " --type=time \"--target=2018-05-06 15:10:50.54322+00\" \\", + " --set=20180506-150955F_20180506-151045D restore" ], "host" : "pg-primary", "output" : false @@ -2204,16 +2626,16 @@ "type" : "exe", "value" : { "output" : [ - "LOG: database system was interrupted; last known up at 2018-03-20 00:07:56 UTC", - "LOG: starting point-in-time recovery to 2018-03-20 00:08:02.310193+00", + "LOG: database system was interrupted; last known up at 2018-05-06 15:10:46 UTC", + "LOG: starting point-in-time recovery to 2018-05-06 15:10:50.54322+00", "LOG: restored log file \"00000004.history\" from archive", - "LOG: restored log file \"000000040000000000000017\" from archive", - "LOG: redo starts at 0/17000028", - "LOG: consistent recovery state reached at 0/170000F8", - "LOG: restored log file \"000000040000000000000018\" from archive", - "LOG: recovery stopping before commit of transaction 627, time 2018-03-20 00:08:02.421161+00", - "LOG: redo done at 0/18022FF8", - "LOG: last completed transaction was at log time 2018-03-20 00:08:02.206459+00", + "LOG: restored log file \"000000040000000000000019\" from archive", + "LOG: redo starts at 0/19000028", + "LOG: consistent recovery state reached at 0/190000F8", + "LOG: restored log file \"00000004000000000000001A\" from archive", + "LOG: recovery stopping before commit of transaction 630, time 2018-05-06 15:10:50.727111+00", + "LOG: redo done at 0/1A01BBF8", + "LOG: last completed transaction was at log time 2018-05-06 15:10:50.323779+00", "LOG: restored log file \"00000005.history\" from archive", "LOG: restored log file \"00000006.history\" from archive", " [filtered 5 lines of output]" @@ -2222,7 +2644,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -2245,13 +2667,16 @@ "repo1-retention-diff=2", "repo1-retention-full=2", "start-fast=y", - "stop-auto=y" + "stop-auto=y", + "", + "[global:archive-push]", + "compress-level=3" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -2305,7 +2730,10 @@ "repo1-s3-verify-ssl=n", "repo1-type=s3", "start-fast=y", - "stop-auto=y" + "stop-auto=y", + "", + "[global:archive-push]", + "compress-level=3" ] } }, @@ -2348,7 +2776,7 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: stanza-create command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-type=none --repo1-path=/ --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo", + "P00 INFO: stanza-create command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-type=none --repo1-path=/ --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo", "P00 INFO: stanza-create command end: completed successfully" ] } @@ -2372,16 +2800,16 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: backup command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=4 --repo1-cipher-type=none --repo1-path=/ --repo1-retention-diff=2 --repo1-retention-full=2 --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo --start-fast --stop-auto", + "P00 INFO: backup command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=4 --repo1-cipher-type=none --repo1-path=/ --repo1-retention-diff=2 --repo1-retention-full=2 --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo --start-fast --stop-auto", "P00 WARN: no prior backup exists, incr backup has been changed to full", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:08:37\": backup begins after the requested immediate checkpoint completes", - "P00 INFO: backup start archive = 000000070000000000000019, lsn = 0/19000028", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:11:25\": backup begins after the requested immediate checkpoint completes", + "P00 INFO: backup start archive = 00000007000000000000001B, lsn = 0/1B000028", " [filtered 1119 lines of output]", "P04 INFO: backup file /var/lib/pgsql/9.5/data/base/1/12216 (0B, 100%)", "P02 INFO: backup file /var/lib/pgsql/9.5/data/base/1/12211 (0B, 100%)", "P00 INFO: full backup size = 27.3MB", "P00 INFO: execute exclusive pg_stop_backup() and wait for all WAL segments to archive", - "P00 INFO: backup stop archive = 000000070000000000000019, lsn = 0/19000130", + "P00 INFO: backup stop archive = 00000007000000000000001B, lsn = 0/1B000130", " [filtered 4 lines of output]" ] } @@ -2414,7 +2842,7 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: stop command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-type=none --repo1-path=/ --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo", + "P00 INFO: stop command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-type=none --repo1-path=/ --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo", "P00 INFO: stop command end: completed successfully" ] } @@ -2437,7 +2865,7 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: stanza-delete command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-type=none --repo1-path=/ --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo", + "P00 INFO: stanza-delete command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-cipher-type=none --repo1-path=/ --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo", "P00 INFO: stanza-delete command end: completed successfully" ] } @@ -2499,7 +2927,7 @@ { "key" : { "cmd" : [ - "sudo mkdir /root/pgbackrest-release-2.01" + "sudo mkdir /root/pgbackrest-release-2.02" ], "host" : "repository", "output" : false @@ -2509,7 +2937,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/build /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/build /root/pgbackrest-release-2.02" ], "host" : "repository", "output" : false @@ -2519,7 +2947,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/lib /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/lib /root/pgbackrest-release-2.02" ], "host" : "repository", "output" : false @@ -2529,7 +2957,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/libc /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/libc /root/pgbackrest-release-2.02" ], "host" : "repository", "output" : false @@ -2539,7 +2967,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/src /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/src /root/pgbackrest-release-2.02" ], "host" : "repository", "output" : false @@ -2549,7 +2977,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /root/pgbackrest-release-2.01/lib/pgBackRest \\", + "sudo cp -r /root/pgbackrest-release-2.02/lib/pgBackRest \\", " /usr/share/perl5" ], "host" : "repository", @@ -2600,7 +3028,27 @@ { "key" : { "cmd" : [ - "sudo touch /etc/pgbackrest.conf" + "sudo mkdir /etc/pgbackrest" + ], + "host" : "repository", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo mkdir /etc/pgbackrest/conf.d" + ], + "host" : "repository", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo touch /etc/pgbackrest/pgbackrest.conf" ], "host" : "repository", "output" : false @@ -2610,7 +3058,7 @@ { "key" : { "cmd" : [ - "sudo chmod 640 /etc/pgbackrest.conf" + "sudo chmod 640 /etc/pgbackrest/pgbackrest.conf" ], "host" : "repository", "output" : false @@ -2620,7 +3068,7 @@ { "key" : { "cmd" : [ - "sudo chown pgbackrest:pgbackrest /etc/pgbackrest.conf" + "sudo chown pgbackrest:pgbackrest /etc/pgbackrest/pgbackrest.conf" ], "host" : "repository", "output" : false @@ -2630,7 +3078,7 @@ { "key" : { "cmd" : [ - "sudo sh -c 'cd /root/pgbackrest-release-2.01/libc && \\", + "sudo sh -c 'cd /root/pgbackrest-release-2.02/libc && \\", " perl Makefile.PL INSTALLMAN1DIR=none INSTALLMAN3DIR=none'" ], "host" : "repository", @@ -2641,7 +3089,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/libc test" + "sudo make -C /root/pgbackrest-release-2.02/libc test" ], "host" : "repository", "output" : false @@ -2651,7 +3099,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/libc install" + "sudo make -C /root/pgbackrest-release-2.02/libc install" ], "host" : "repository", "output" : false @@ -2661,7 +3109,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/src" + "sudo make -C /root/pgbackrest-release-2.02/src" ], "host" : "repository", "output" : false @@ -2671,7 +3119,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/src install" + "sudo make -C /root/pgbackrest-release-2.02/src install" ], "host" : "repository", "output" : false @@ -2681,7 +3129,7 @@ { "key" : { "cmd" : [ - "sudo mkdir /var/lib/pgbackrest" + "sudo mkdir -p /var/lib/pgbackrest" ], "host" : "repository", "output" : false @@ -2796,7 +3244,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "repository", "option" : { "global" : { @@ -2816,7 +3264,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "repository", "option" : { "demo" : { @@ -2863,7 +3311,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "demo" : { @@ -2998,39 +3446,49 @@ { "key" : { "cmd" : [ - "sudo mkdir -m 750 /var/spool/pgbackrest" + "sudo lscpu" ], - "host" : "pg-primary", - "output" : false + "highlight" : { + "filter" : true, + "filter-context" : 2, + "list" : [ + "^CPU\\(s\\)\\:" + ] + }, + "host" : "repository", + "output" : true }, - "type" : "exe" + "type" : "exe", + "value" : { + "output" : [ + "Architecture: x86_64", + "CPU op-mode(s): 32-bit, 64-bit", + "Byte Order: Little Endian", + "CPU(s): 8", + "On-line CPU(s) list: 0-7", + "Thread(s) per core: 1", + " [filtered 16 lines of output]" + ] + } }, { "key" : { "cmd" : [ - "sudo chown postgres:postgres /var/spool/pgbackrest" + "sudo -u pgbackrest pgbackrest --stanza=demo --type=full backup" ], - "host" : "pg-primary", + "host" : "repository", "output" : false }, "type" : "exe" }, { "key" : { - "file" : "/etc/pgbackrest.conf", - "host" : "pg-primary", + "file" : "/etc/pgbackrest/pgbackrest.conf", + "host" : "repository", "option" : { "global" : { - "archive-async" : { - "value" : "y" - }, - "spool-path" : { - "value" : "/var/spool/pgbackrest" - } - }, - "global:archive-push" : { "process-max" : { - "value" : "2" + "value" : "3" } } } @@ -3039,25 +3497,24 @@ "value" : { "config" : [ "[demo]", + "pg1-host=pg-primary", + "pg1-host-user=postgres", "pg1-path=/var/lib/pgsql/9.5/data", "", "[global]", - "archive-async=y", - "log-level-file=detail", - "repo1-host=repository", - "spool-path=/var/spool/pgbackrest", - "", - "[global:archive-push]", - "process-max=2" + "process-max=3", + "repo1-path=/var/lib/pgbackrest", + "repo1-retention-full=2", + "start-fast=y" ] } }, { "key" : { "cmd" : [ - "sudo -u postgres rm -f /var/log/pgbackrest/demo-archive-async.log" + "sudo -u pgbackrest pgbackrest --stanza=demo --type=full backup" ], - "host" : "pg-primary", + "host" : "repository", "output" : false }, "type" : "exe" @@ -3065,163 +3522,7 @@ { "key" : { "cmd" : [ - "sudo -u postgres psql -c \" \\", - " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", - " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", - " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", - " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", - " select pg_create_restore_point('test async push'); select pg_switch_xlog();\"" - ], - "host" : "pg-primary", - "output" : false - }, - "type" : "exe" - }, - { - "key" : { - "cmd" : [ - "sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check" - ], - "highlight" : { - "filter" : true, - "filter-context" : 2, - "list" : [ - "WAL segment" - ] - }, - "host" : "pg-primary", - "output" : true - }, - "type" : "exe", - "value" : { - "output" : [ - "P00 INFO: check command begin 2.01: --log-level-console=info --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-host=repository --stanza=demo", - "P00 INFO: WAL segment 000000080000000000000025 successfully stored in the archive at '/var/lib/pgbackrest/archive/demo/9.5-1/0000000800000000/000000080000000000000025-794b3e85ba26e8069db739ac867d1c1636907372.gz'", - "P00 INFO: check command end: completed successfully" - ] - } - }, - { - "key" : { - "cmd" : [ - "sudo -u postgres cat /var/log/pgbackrest/demo-archive-async.log" - ], - "highlight" : { - "filter" : true, - "filter-context" : 2, - "list" : [ - " WAL file\\(s\\) to archive|pushed WAL file 0000000" - ] - }, - "host" : "pg-primary", - "output" : true - }, - "type" : "exe", - "value" : { - "output" : [ - "-------------------PROCESS START-------------------", - "P00 INFO: archive-push command begin 2.01: --archive-async --log-level-console=warn --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", - "P00 INFO: push 3 WAL file(s) to archive: 000000080000000000000020...000000080000000000000022", - "P02 DETAIL: pushed WAL file 000000080000000000000021 to archive", - "P01 DETAIL: pushed WAL file 000000080000000000000020 to archive", - "P02 DETAIL: pushed WAL file 000000080000000000000022 to archive", - "P00 INFO: archive-push command end: completed successfully", - "", - "-------------------PROCESS START-------------------", - "P00 INFO: archive-push command begin 2.01: --archive-async --log-level-console=warn --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", - "P00 INFO: push 2 WAL file(s) to archive: 000000080000000000000023...000000080000000000000024", - "P02 DETAIL: pushed WAL file 000000080000000000000024 to archive", - "P01 DETAIL: pushed WAL file 000000080000000000000023 to archive", - "P00 INFO: archive-push command end: completed successfully", - "", - "-------------------PROCESS START-------------------", - "P00 INFO: archive-push command begin 2.01: --archive-async --log-level-console=warn --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", - "P00 INFO: push 1 WAL file(s) to archive: 000000080000000000000025", - "P01 DETAIL: pushed WAL file 000000080000000000000025 to archive", - "P00 INFO: archive-push command end: completed successfully" - ] - } - }, - { - "key" : { - "cmd" : [ - "sudo lscpu" - ], - "highlight" : { - "filter" : true, - "filter-context" : 2, - "list" : [ - "^CPU\\(s\\)\\:" - ] - }, - "host" : "repository", - "output" : true - }, - "type" : "exe", - "value" : { - "output" : [ - "Architecture: x86_64", - "CPU op-mode(s): 32-bit, 64-bit", - "Byte Order: Little Endian", - "CPU(s): 8", - "On-line CPU(s) list: 0-7", - "Thread(s) per core: 1", - " [filtered 16 lines of output]" - ] - } - }, - { - "key" : { - "cmd" : [ - "sudo -u pgbackrest pgbackrest --stanza=demo --type=full backup" - ], - "host" : "repository", - "output" : false - }, - "type" : "exe" - }, - { - "key" : { - "file" : "/etc/pgbackrest.conf", - "host" : "repository", - "option" : { - "global" : { - "process-max" : { - "value" : "3" - } - } - } - }, - "type" : "cfg-pgbackrest", - "value" : { - "config" : [ - "[demo]", - "pg1-host=pg-primary", - "pg1-host-user=postgres", - "pg1-path=/var/lib/pgsql/9.5/data", - "", - "[global]", - "process-max=3", - "repo1-path=/var/lib/pgbackrest", - "repo1-retention-full=2", - "start-fast=y" - ] - } - }, - { - "key" : { - "cmd" : [ - "sudo -u pgbackrest pgbackrest --stanza=demo --type=full backup" - ], - "host" : "repository", - "output" : false - }, - "type" : "exe" - }, - { - "key" : { - "cmd" : [ - "sudo -u pgbackrest pgbackrest info" + "sudo -u pgbackrest pgbackrest info" ], "highlight" : { "filter" : false, @@ -3240,17 +3541,17 @@ " status: ok", "", " db (current)", - " wal archive min/max (9.5-1): 000000080000000000000026 / 000000080000000000000027", + " wal archive min/max (9.5-1): 000000080000000000000022 / 000000080000000000000023", "", - " full backup: 20180320-001019F", - " timestamp start/stop: 2018-03-20 00:10:19 / 2018-03-20 00:10:28", - " wal start/stop: 000000080000000000000026 / 000000080000000000000026", + " full backup: 20180506-151258F", + " timestamp start/stop: 2018-05-06 15:12:58 / 2018-05-06 15:13:07", + " wal start/stop: 000000080000000000000022 / 000000080000000000000022", " database size: 27.3MB, backup size: 27.3MB", " repository size: 3.1MB, repository backup size: 3.1MB", "", - " full backup: 20180320-001030F", - " timestamp start/stop: 2018-03-20 00:10:30 / 2018-03-20 00:10:38", - " wal start/stop: 000000080000000000000027 / 000000080000000000000027", + " full backup: 20180506-151308F", + " timestamp start/stop: 2018-05-06 15:13:08 / 2018-05-06 15:13:15", + " wal start/stop: 000000080000000000000023 / 000000080000000000000023", " database size: 27.3MB, backup size: 27.3MB", " repository size: 3.1MB, repository backup size: 3.1MB" ] @@ -3384,7 +3685,7 @@ { "key" : { "cmd" : [ - "sudo mkdir /root/pgbackrest-release-2.01" + "sudo mkdir /root/pgbackrest-release-2.02" ], "host" : "pg-standby", "output" : false @@ -3394,7 +3695,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/build /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/build /root/pgbackrest-release-2.02" ], "host" : "pg-standby", "output" : false @@ -3404,7 +3705,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/lib /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/lib /root/pgbackrest-release-2.02" ], "host" : "pg-standby", "output" : false @@ -3414,7 +3715,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/libc /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/libc /root/pgbackrest-release-2.02" ], "host" : "pg-standby", "output" : false @@ -3424,7 +3725,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/src /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/src /root/pgbackrest-release-2.02" ], "host" : "pg-standby", "output" : false @@ -3434,7 +3735,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /root/pgbackrest-release-2.01/lib/pgBackRest \\", + "sudo cp -r /root/pgbackrest-release-2.02/lib/pgBackRest \\", " /usr/share/perl5" ], "host" : "pg-standby", @@ -3485,7 +3786,27 @@ { "key" : { "cmd" : [ - "sudo touch /etc/pgbackrest.conf" + "sudo mkdir /etc/pgbackrest" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo mkdir /etc/pgbackrest/conf.d" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo touch /etc/pgbackrest/pgbackrest.conf" ], "host" : "pg-standby", "output" : false @@ -3495,7 +3816,7 @@ { "key" : { "cmd" : [ - "sudo chmod 640 /etc/pgbackrest.conf" + "sudo chmod 640 /etc/pgbackrest/pgbackrest.conf" ], "host" : "pg-standby", "output" : false @@ -3505,7 +3826,7 @@ { "key" : { "cmd" : [ - "sudo chown postgres:postgres /etc/pgbackrest.conf" + "sudo chown postgres:postgres /etc/pgbackrest/pgbackrest.conf" ], "host" : "pg-standby", "output" : false @@ -3515,7 +3836,7 @@ { "key" : { "cmd" : [ - "sudo sh -c 'cd /root/pgbackrest-release-2.01/libc && \\", + "sudo sh -c 'cd /root/pgbackrest-release-2.02/libc && \\", " perl Makefile.PL INSTALLMAN1DIR=none INSTALLMAN3DIR=none'" ], "host" : "pg-standby", @@ -3526,7 +3847,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/libc test" + "sudo make -C /root/pgbackrest-release-2.02/libc test" ], "host" : "pg-standby", "output" : false @@ -3536,7 +3857,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/libc install" + "sudo make -C /root/pgbackrest-release-2.02/libc install" ], "host" : "pg-standby", "output" : false @@ -3546,7 +3867,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/src" + "sudo make -C /root/pgbackrest-release-2.02/src" ], "host" : "pg-standby", "output" : false @@ -3556,7 +3877,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/src install" + "sudo make -C /root/pgbackrest-release-2.02/src install" ], "host" : "pg-standby", "output" : false @@ -3630,7 +3951,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-standby", "option" : { "demo" : { @@ -3642,6 +3963,9 @@ } }, "global" : { + "log-level-file" : { + "value" : "detail" + }, "log-level-stderr" : { "value" : "off" }, @@ -3662,6 +3986,7 @@ "recovery-option=standby_mode=on", "", "[global]", + "log-level-file=detail", "repo1-host=repository" ] } @@ -3775,12 +4100,12 @@ "type" : "exe", "value" : { "output" : [ - "LOG: database system was interrupted; last known up at 2018-03-20 00:10:31 UTC", + "LOG: database system was interrupted; last known up at 2018-05-06 15:13:09 UTC", "LOG: entering standby mode", "LOG: restored log file \"00000008.history\" from archive", - "LOG: restored log file \"000000080000000000000027\" from archive", - "LOG: redo starts at 0/27000028", - "LOG: consistent recovery state reached at 0/27000130", + "LOG: restored log file \"000000080000000000000023\" from archive", + "LOG: redo starts at 0/23000028", + "LOG: consistent recovery state reached at 0/230000F8", "LOG: database system is ready to accept read only connections" ] } @@ -3851,9 +4176,9 @@ "type" : "exe", "value" : { "output" : [ - " pg_switch_xlog | now ", - "----------------+------------------------------", - " 0/2801AF50 | 2018-03-20 00:11:13.86664+00", + " pg_switch_xlog | now ", + "----------------+-------------------------------", + " 0/2401F620 | 2018-05-06 15:13:53.267301+00", "(1 row)" ] } @@ -3877,9 +4202,9 @@ "type" : "exe", "value" : { "output" : [ - " message | now ", - "----------------+------------------------------", - " Important Data | 2018-03-20 00:11:15.74974+00", + " message | now ", + "----------------+-------------------------------", + " Important Data | 2018-05-06 15:13:54.877317+00", "(1 row)" ] } @@ -3902,7 +4227,7 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: check command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-host=repository --stanza=demo", + "P00 INFO: check command begin 2.02: --log-level-console=info --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-host=repository --stanza=demo", "P00 INFO: switch xlog cannot be performed on the standby, all other checks passed successfully", "P00 INFO: check command end: completed successfully" ] @@ -3948,7 +4273,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-standby", "option" : { "demo" : { @@ -3967,6 +4292,7 @@ "recovery-option=primary_conninfo=host=172.17.0.3 port=5432 user=replicator", "", "[global]", + "log-level-file=detail", "repo1-host=repository" ] } @@ -4099,8 +4425,8 @@ "output" : [ " [filtered 6 lines of output]", "LOG: database system is ready to accept read only connections", - "LOG: restored log file \"000000080000000000000028\" from archive", - "LOG: started streaming WAL from primary at 0/29000000 on timeline 8" + "LOG: restored log file \"000000080000000000000024\" from archive", + "LOG: started streaming WAL from primary at 0/25000000 on timeline 8" ] } }, @@ -4129,7 +4455,7 @@ "output" : [ " message | now ", "----------------+-------------------------------", - " Important Data | 2018-03-20 00:11:28.275949+00", + " Important Data | 2018-05-06 15:14:08.415026+00", "(1 row)" ] } @@ -4155,96 +4481,15 @@ "output" : [ " message | now ", "----------------+-------------------------------", - " Important Data | 2018-03-20 00:11:28.461057+00", + " Important Data | 2018-05-06 15:14:08.673029+00", "(1 row)" ] } }, - { - "key" : { - "file" : "/etc/pgbackrest.conf", - "host" : "repository", - "option" : { - "demo" : { - "pg2-host" : { - "value" : "pg-standby" - }, - "pg2-host-user" : { - "value" : "postgres" - }, - "pg2-path" : { - "value" : "/var/lib/pgsql/9.5/data" - } - }, - "global" : { - "backup-standby" : { - "value" : "y" - } - } - } - }, - "type" : "cfg-pgbackrest", - "value" : { - "config" : [ - "[demo]", - "pg1-host=pg-primary", - "pg1-host-user=postgres", - "pg1-path=/var/lib/pgsql/9.5/data", - "pg2-host=pg-standby", - "pg2-host-user=postgres", - "pg2-path=/var/lib/pgsql/9.5/data", - "", - "[global]", - "backup-standby=y", - "process-max=3", - "repo1-path=/var/lib/pgbackrest", - "repo1-retention-full=2", - "start-fast=y" - ] - } - }, - { - "key" : { - "cmd" : [ - "sudo -u pgbackrest pgbackrest --stanza=demo --log-level-console=detail backup" - ], - "highlight" : { - "filter" : true, - "filter-context" : 2, - "list" : [ - "backup file pg-primary|replay on the standby" - ] - }, - "host" : "repository", - "output" : true - }, - "type" : "exe", - "value" : { - "output" : [ - " [filtered 2 lines of output]", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:11:29\": backup begins after the requested immediate checkpoint completes", - "P00 INFO: backup start archive = 00000008000000000000002A, lsn = 0/2A000028", - "P00 INFO: wait for replay on the standby to reach 0/2A000028", - "P00 INFO: replay on the standby reached 0/2A0000D0", - "P02 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12378/2608 (432KB, 20%) checksum 43dc37e1adc99cd565209efc74fa53cae1f2aae1", - "P01 INFO: backup file pg-primary:/var/lib/pgsql/9.5/data/global/pg_control (8KB, 20%) checksum 27b52c0ee696a882bd06a233e2a11686e6d40489", - "P04 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12378/1249 (360KB, 37%) checksum 365e91049e35e27294acbf44c7704d2cd05cb423", - "P01 INFO: backup file pg-primary:/var/lib/pgsql/9.5/data/pg_log/postgresql.log (4.6KB, 37%) checksum 94b761b366be33010711c922eff2abb72e6ff43c", - "P02 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12378/2673 (320KB, 52%) checksum abf621f5689a53727703458fe9d57a725bc6e853", - "P03 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12378/2674 (360KB, 69%) checksum f9962cca45f890610e12caca675813ede8a0f5ed", - "P01 INFO: backup file pg-primary:/var/lib/pgsql/9.5/data/pg_hba.conf (4.1KB, 69%) checksum dbda288edbce6486fab7ca9f9db0864316754bee", - "P04 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12378/2658 (112KB, 74%) checksum 1ef341fcf8155b1e3e5253df3236168d6368fa29", - "P01 INFO: backup file pg-primary:/var/lib/pgsql/9.5/data/backup_label (238B, 74%) checksum 2dc8a970435f1bb5edbc7dd9e8a06010ff5d05f2", - "P02 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12378/1259 (104KB, 79%) checksum 988c7e55688e8206c1be12cf85e08f7da94c1db6", - "P03 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12378/2659 (72KB, 83%) checksum a0eef2a57b5b7df72bce3acdc8ec39d88f149512", - " [filtered 30 lines of output]" - ] - } - }, { "key" : { "cmd" : [ - "sudo service postgresql-9.5 stop" + "sudo mkdir -m 750 /var/spool/pgbackrest" ], "host" : "pg-primary", "output" : false @@ -4254,9 +4499,8 @@ { "key" : { "cmd" : [ - "sudo yum install postgresql96-server" + "sudo chown postgres:postgres /var/spool/pgbackrest" ], - "cmd-extra" : "-y", "host" : "pg-primary", "output" : false }, @@ -4265,7 +4509,7 @@ { "key" : { "cmd" : [ - "sudo service postgresql-9.5 stop" + "sudo mkdir -m 750 /var/spool/pgbackrest" ], "host" : "pg-standby", "output" : false @@ -4275,9 +4519,8 @@ { "key" : { "cmd" : [ - "sudo yum install postgresql96-server" + "sudo chown postgres:postgres /var/spool/pgbackrest" ], - "cmd-extra" : "-y", "host" : "pg-standby", "output" : false }, @@ -4285,14 +4528,407 @@ }, { "key" : { - "cmd" : [ - "sudo -u postgres /usr/pgsql-9.6/bin/initdb \\", - " -D /var/lib/pgsql/9.6/data -k -A peer" - ], + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", - "output" : false + "option" : { + "global" : { + "archive-async" : { + "value" : "y" + }, + "spool-path" : { + "value" : "/var/spool/pgbackrest" + } + }, + "global:archive-get" : { + "process-max" : { + "value" : "2" + } + }, + "global:archive-push" : { + "process-max" : { + "value" : "2" + } + } + } }, - "type" : "exe" + "type" : "cfg-pgbackrest", + "value" : { + "config" : [ + "[demo]", + "pg1-path=/var/lib/pgsql/9.5/data", + "", + "[global]", + "archive-async=y", + "log-level-file=detail", + "repo1-host=repository", + "spool-path=/var/spool/pgbackrest", + "", + "[global:archive-get]", + "process-max=2", + "", + "[global:archive-push]", + "process-max=2" + ] + } + }, + { + "key" : { + "file" : "/etc/pgbackrest/pgbackrest.conf", + "host" : "pg-standby", + "option" : { + "global" : { + "archive-async" : { + "value" : "y" + }, + "spool-path" : { + "value" : "/var/spool/pgbackrest" + } + }, + "global:archive-get" : { + "process-max" : { + "value" : "2" + } + }, + "global:archive-push" : { + "process-max" : { + "value" : "2" + } + } + } + }, + "type" : "cfg-pgbackrest", + "value" : { + "config" : [ + "[demo]", + "pg1-path=/var/lib/pgsql/9.5/data", + "recovery-option=standby_mode=on", + "recovery-option=primary_conninfo=host=172.17.0.3 port=5432 user=replicator", + "", + "[global]", + "archive-async=y", + "log-level-file=detail", + "repo1-host=repository", + "spool-path=/var/spool/pgbackrest", + "", + "[global:archive-get]", + "process-max=2", + "", + "[global:archive-push]", + "process-max=2" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres psql -c \"alter user replicator password 'bogus'\"" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "ALTER ROLE" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo service postgresql-9.5 restart" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres rm -f /var/log/pgbackrest/demo-archive-push-async.log" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres psql -c \" \\", + " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", + " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", + " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", + " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", + " select pg_create_restore_point('test async push'); select pg_switch_xlog();\"" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check" + ], + "highlight" : { + "filter" : true, + "filter-context" : 2, + "list" : [ + "WAL segment" + ] + }, + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "P00 INFO: check command begin 2.02: --log-level-console=info --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --repo1-host=repository --stanza=demo", + "P00 INFO: WAL segment 00000008000000000000002A successfully stored in the archive at '/var/lib/pgbackrest/archive/demo/9.5-1/0000000800000000/00000008000000000000002A-fa9b05fe62ad6ef67def76525ffac56693fb3077.gz'", + "P00 INFO: check command end: completed successfully" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres cat /var/log/pgbackrest/demo-archive-push-async.log" + ], + "highlight" : { + "filter" : true, + "filter-context" : 2, + "list" : [ + " WAL file\\(s\\) to archive|pushed WAL file 0000000" + ] + }, + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "-------------------PROCESS START-------------------", + "P00 INFO: archive-push command begin 2.02: [pg_xlog/000000080000000000000025] --archive-async --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", + "P00 INFO: push 2 WAL file(s) to archive: 000000080000000000000025...000000080000000000000026", + "P02 DETAIL: pushed WAL file 000000080000000000000026 to archive", + "P01 DETAIL: pushed WAL file 000000080000000000000025 to archive", + "P00 INFO: archive-push command end: completed successfully", + "", + "-------------------PROCESS START-------------------", + "P00 INFO: archive-push command begin 2.02: [pg_xlog/000000080000000000000027] --archive-async --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", + "P00 INFO: push 3 WAL file(s) to archive: 000000080000000000000027...000000080000000000000029", + "P01 DETAIL: pushed WAL file 000000080000000000000027 to archive", + "P02 DETAIL: pushed WAL file 000000080000000000000028 to archive", + "P01 DETAIL: pushed WAL file 000000080000000000000029 to archive", + "P00 INFO: archive-push command end: completed successfully", + "", + "-------------------PROCESS START-------------------", + "P00 INFO: archive-push command begin 2.02: [pg_xlog/00000008000000000000002A] --archive-async --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", + "P00 INFO: push 1 WAL file(s) to archive: 00000008000000000000002A", + "P01 DETAIL: pushed WAL file 00000008000000000000002A to archive", + "P00 INFO: archive-push command end: completed successfully" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres sleep 5" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres cat /var/log/pgbackrest/demo-archive-get-async.log" + ], + "highlight" : { + "filter" : true, + "filter-context" : 2, + "list" : [ + "got WAL file [0-F]{24} from archive" + ] + }, + "host" : "pg-standby", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "-------------------PROCESS START-------------------", + "P00 INFO: archive-get command begin 2.02: [000000080000000000000023, 000000080000000000000024, 000000080000000000000025, 000000080000000000000026, 000000080000000000000027, 000000080000000000000028, 000000080000000000000029, 00000008000000000000002A] --archive-async --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", + "P00 INFO: get 8 WAL file(s) from archive: 000000080000000000000023...00000008000000000000002A", + "P01 DETAIL: got WAL file 000000080000000000000023 from archive", + "P02 DETAIL: got WAL file 000000080000000000000024 from archive", + "P01 DETAIL: WAL file 000000080000000000000025 not found in archive", + "P02 DETAIL: WAL file 000000080000000000000026 not found in archive", + " [filtered 33 lines of output]", + "P00 INFO: archive-get command begin 2.02: [000000080000000000000025, 000000080000000000000026, 000000080000000000000027, 000000080000000000000028, 000000080000000000000029, 00000008000000000000002A, 00000008000000000000002B, 00000008000000000000002C] --archive-async --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/pgsql/9.5/data --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", + "P00 INFO: get 8 WAL file(s) from archive: 000000080000000000000025...00000008000000000000002C", + "P01 DETAIL: got WAL file 000000080000000000000025 from archive", + "P02 DETAIL: got WAL file 000000080000000000000026 from archive", + "P01 DETAIL: got WAL file 000000080000000000000027 from archive", + "P02 DETAIL: got WAL file 000000080000000000000028 from archive", + "P01 DETAIL: got WAL file 000000080000000000000029 from archive", + "P02 DETAIL: got WAL file 00000008000000000000002A from archive", + "P01 DETAIL: WAL file 00000008000000000000002B not found in archive", + "P02 DETAIL: WAL file 00000008000000000000002C not found in archive", + " [filtered 12 lines of output]" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres psql -c \"alter user replicator password 'jw8s0F4'\"" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "ALTER ROLE" + ] + } + }, + { + "key" : { + "file" : "/etc/pgbackrest/pgbackrest.conf", + "host" : "repository", + "option" : { + "demo" : { + "pg2-host" : { + "value" : "pg-standby" + }, + "pg2-host-user" : { + "value" : "postgres" + }, + "pg2-path" : { + "value" : "/var/lib/pgsql/9.5/data" + } + }, + "global" : { + "backup-standby" : { + "value" : "y" + } + } + } + }, + "type" : "cfg-pgbackrest", + "value" : { + "config" : [ + "[demo]", + "pg1-host=pg-primary", + "pg1-host-user=postgres", + "pg1-path=/var/lib/pgsql/9.5/data", + "pg2-host=pg-standby", + "pg2-host-user=postgres", + "pg2-path=/var/lib/pgsql/9.5/data", + "", + "[global]", + "backup-standby=y", + "process-max=3", + "repo1-path=/var/lib/pgbackrest", + "repo1-retention-full=2", + "start-fast=y" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u pgbackrest pgbackrest --stanza=demo --log-level-console=detail backup" + ], + "highlight" : { + "filter" : true, + "filter-context" : 2, + "list" : [ + "backup file pg-primary|replay on the standby" + ] + }, + "host" : "repository", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + " [filtered 2 lines of output]", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:14:24\": backup begins after the requested immediate checkpoint completes", + "P00 INFO: backup start archive = 00000008000000000000002C, lsn = 0/2C000028", + "P00 INFO: wait for replay on the standby to reach 0/2C000028", + "P00 INFO: replay on the standby reached 0/2C0000D0", + "P01 INFO: backup file pg-primary:/var/lib/pgsql/9.5/data/global/pg_control (8KB, 0%) checksum aded6a82cfc48e32e3b3ffd927069abfd763ca36", + "P01 INFO: backup file pg-primary:/var/lib/pgsql/9.5/data/pg_log/postgresql.log (5.2KB, 0%) checksum 91410f5ef355c9933ca933c968659523520e0afd", + "P03 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12378/2674 (360KB, 17%) checksum dd206a01cb42bf6ac2cff826b4842d8d2a968d8b", + "P01 INFO: backup file pg-primary:/var/lib/pgsql/9.5/data/pg_hba.conf (4.1KB, 17%) checksum dbda288edbce6486fab7ca9f9db0864316754bee", + "P02 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12378/2608 (432KB, 37%) checksum f56299471251125acbf779dd195b363708779225", + "P04 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12378/1249 (360KB, 54%) checksum c29af94a5842e1ee2ba247a22d0eac022acce3bb", + "P01 INFO: backup file pg-primary:/var/lib/pgsql/9.5/data/backup_label (238B, 54%) checksum ed0ffc8b508c791254e283795f3ecf1e66e74d45", + "P02 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12378/2658 (112KB, 59%) checksum 99c01e1ada8802ef4d0f0f5f60888f77b38f78b2", + "P03 INFO: backup file pg-standby:/var/lib/pgsql/9.5/data/base/12378/2673 (320KB, 74%) checksum e3d8e203cdfdb3c69681bb207bee0610eddf3480", + " [filtered 33 lines of output]" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo service postgresql-9.5 stop" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo yum install postgresql96-server" + ], + "cmd-extra" : "-y", + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo service postgresql-9.5 stop" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo yum install postgresql96-server" + ], + "cmd-extra" : "-y", + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres /usr/pgsql-9.6/bin/initdb \\", + " -D /var/lib/pgsql/9.6/data -k -A peer" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" }, { "key" : { @@ -4372,7 +5008,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "demo" : { @@ -4394,6 +5030,9 @@ "repo1-host=repository", "spool-path=/var/spool/pgbackrest", "", + "[global:archive-get]", + "process-max=2", + "", "[global:archive-push]", "process-max=2" ] @@ -4401,7 +5040,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-standby", "option" : { "demo" : { @@ -4420,13 +5059,22 @@ "recovery-option=primary_conninfo=host=172.17.0.3 port=5432 user=replicator", "", "[global]", - "repo1-host=repository" + "archive-async=y", + "log-level-file=detail", + "repo1-host=repository", + "spool-path=/var/spool/pgbackrest", + "", + "[global:archive-get]", + "process-max=2", + "", + "[global:archive-push]", + "process-max=2" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "repository", "option" : { "demo" : { @@ -4494,7 +5142,7 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: stanza-upgrade command begin 2.01: --no-backup-standby --log-level-console=info --log-level-stderr=off --no-log-timestamp --no-online --pg1-host=pg-primary --pg2-host=pg-standby --pg1-host-user=postgres --pg2-host-user=postgres --pg1-path=/var/lib/pgsql/9.6/data --pg2-path=/var/lib/pgsql/9.6/data --repo1-path=/var/lib/pgbackrest --stanza=demo", + "P00 INFO: stanza-upgrade command begin 2.02: --no-backup-standby --log-level-console=info --log-level-stderr=off --no-log-timestamp --no-online --pg1-host=pg-primary --pg2-host=pg-standby --pg1-host-user=postgres --pg2-host-user=postgres --pg1-path=/var/lib/pgsql/9.6/data --pg2-path=/var/lib/pgsql/9.6/data --repo1-path=/var/lib/pgbackrest --stanza=demo", "P00 INFO: stanza-upgrade command end: completed successfully" ] } @@ -4525,7 +5173,7 @@ "type" : "exe", "value" : { "output" : [ - "postgresql-9.6 (pid 4948) is running..." + "postgresql-9.6 (pid 5211) is running..." ] } }, @@ -4655,7 +5303,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "repository", "option" : { "global" : { @@ -4715,6 +5363,21 @@ "ip" : "172.17.0.3" } }, + { + "key" : { + "cmd" : [ + "sudo -u postgres perl -V | grep USE_64_BIT_INT" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + " USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS" + ] + } + }, { "key" : { "cmd" : [ @@ -4775,6 +5438,16 @@ }, "type" : "exe" }, + { + "key" : { + "cmd" : [ + "sudo apt-get update" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, { "key" : { "cmd" : [ @@ -4789,7 +5462,7 @@ { "key" : { "cmd" : [ - "sudo mkdir /root/pgbackrest-release-2.01" + "sudo mkdir /root/pgbackrest-release-2.02" ], "host" : "pg-primary", "output" : false @@ -4799,7 +5472,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/build /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/build /root/pgbackrest-release-2.02" ], "host" : "pg-primary", "output" : false @@ -4809,7 +5482,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/lib /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/lib /root/pgbackrest-release-2.02" ], "host" : "pg-primary", "output" : false @@ -4819,7 +5492,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/libc /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/libc /root/pgbackrest-release-2.02" ], "host" : "pg-primary", "output" : false @@ -4829,7 +5502,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/src /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/src /root/pgbackrest-release-2.02" ], "host" : "pg-primary", "output" : false @@ -4839,7 +5512,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /root/pgbackrest-release-2.01/lib/pgBackRest \\", + "sudo cp -r /root/pgbackrest-release-2.02/lib/pgBackRest \\", " /usr/share/perl5" ], "host" : "pg-primary", @@ -4890,7 +5563,27 @@ { "key" : { "cmd" : [ - "sudo touch /etc/pgbackrest.conf" + "sudo mkdir /etc/pgbackrest" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo mkdir /etc/pgbackrest/conf.d" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo touch /etc/pgbackrest/pgbackrest.conf" ], "host" : "pg-primary", "output" : false @@ -4900,7 +5593,7 @@ { "key" : { "cmd" : [ - "sudo chmod 640 /etc/pgbackrest.conf" + "sudo chmod 640 /etc/pgbackrest/pgbackrest.conf" ], "host" : "pg-primary", "output" : false @@ -4910,7 +5603,7 @@ { "key" : { "cmd" : [ - "sudo chown postgres:postgres /etc/pgbackrest.conf" + "sudo chown postgres:postgres /etc/pgbackrest/pgbackrest.conf" ], "host" : "pg-primary", "output" : false @@ -4920,7 +5613,7 @@ { "key" : { "cmd" : [ - "sudo sh -c 'cd /root/pgbackrest-release-2.01/libc && \\", + "sudo sh -c 'cd /root/pgbackrest-release-2.02/libc && \\", " perl Makefile.PL INSTALLMAN1DIR=none INSTALLMAN3DIR=none'" ], "host" : "pg-primary", @@ -4931,7 +5624,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/libc test" + "sudo make -C /root/pgbackrest-release-2.02/libc test" ], "host" : "pg-primary", "output" : false @@ -4941,7 +5634,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/libc install" + "sudo make -C /root/pgbackrest-release-2.02/libc install" ], "host" : "pg-primary", "output" : false @@ -4951,7 +5644,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/src" + "sudo make -C /root/pgbackrest-release-2.02/src" ], "host" : "pg-primary", "output" : false @@ -4961,7 +5654,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/src install" + "sudo make -C /root/pgbackrest-release-2.02/src install" ], "host" : "pg-primary", "output" : false @@ -4979,7 +5672,7 @@ "type" : "exe", "value" : { "output" : [ - "pgBackRest 2.01 - General help", + "pgBackRest 2.02 - General help", "", "Usage:", " pgbackrest [options] [command]", @@ -5069,7 +5762,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "demo" : { @@ -5098,7 +5791,7 @@ { "key" : { "cmd" : [ - "sudo mkdir /var/lib/pgbackrest" + "sudo mkdir -p /var/lib/pgbackrest" ], "host" : "pg-primary", "output" : false @@ -5127,7 +5820,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -5201,7 +5894,33 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", + "host" : "pg-primary", + "option" : { + "global:archive-push" : { + "compress-level" : { + "value" : "3" + } + } + } + }, + "type" : "cfg-pgbackrest", + "value" : { + "config" : [ + "[demo]", + "pg1-path=/var/lib/postgresql/9.4/demo", + "", + "[global]", + "repo1-path=/var/lib/pgbackrest", + "", + "[global:archive-push]", + "compress-level=3" + ] + } + }, + { + "key" : { + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -5219,13 +5938,16 @@ "", "[global]", "repo1-path=/var/lib/pgbackrest", - "repo1-retention-full=2" + "repo1-retention-full=2", + "", + "[global:archive-push]", + "compress-level=3" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -5248,7 +5970,10 @@ "repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO", "repo1-cipher-type=aes-256-cbc", "repo1-path=/var/lib/pgbackrest", - "repo1-retention-full=2" + "repo1-retention-full=2", + "", + "[global:archive-push]", + "compress-level=3" ] } }, @@ -5270,7 +5995,7 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: stanza-create command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --stanza=demo", + "P00 INFO: stanza-create command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --stanza=demo", "P00 INFO: stanza-create command end: completed successfully" ] } @@ -5293,8 +6018,8 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: check command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --stanza=demo", - "P00 INFO: WAL segment 000000010000000000000001 successfully stored in the archive at '/var/lib/pgbackrest/archive/demo/9.4-1/0000000100000000/000000010000000000000001-3543f1551a7643d0892c0a27fddef588f24fc1c1.gz'", + "P00 INFO: check command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --stanza=demo", + "P00 INFO: WAL segment 000000010000000000000001 successfully stored in the archive at '/var/lib/pgbackrest/archive/demo/9.4-1/0000000100000000/000000010000000000000001-e2fa61cdafccfb38d0e5cc48de2d771a9507d71f.gz'", "P00 INFO: check command end: completed successfully" ] } @@ -5318,9 +6043,9 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: backup command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo", + "P00 INFO: backup command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo", "P00 WARN: no prior backup exists, incr backup has been changed to full", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:13:05\": backup begins after the next regular checkpoint completes", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:16:11\": backup begins after the next regular checkpoint completes", "P00 INFO: backup start archive = 000000010000000000000002, lsn = 0/2000028", " [filtered 754 lines of output]", "P01 INFO: backup file /var/lib/postgresql/9.4/demo/base/1/11895 (0B, 100%)", @@ -5343,7 +6068,7 @@ "type" : "exe", "value" : { "output" : [ - "20180320-001305F" + "20180506-151611F" ] } }, @@ -5367,8 +6092,8 @@ "value" : { "output" : [ " [filtered 4 lines of output]", - "P01 INFO: backup file /var/lib/postgresql/9.4/demo/global/pg_control (8KB, 97%) checksum d64c883c4b0664ab2528bf7e6f1df82cc48b0308", - "P01 INFO: backup file /var/lib/postgresql/9.4/demo/backup_label (236B, 100%) checksum ff8e781310f038470e768e41c0fbae409a987cbd", + "P01 INFO: backup file /var/lib/postgresql/9.4/demo/global/pg_control (8KB, 97%) checksum e8c6995d1f2d84d666c8bd12aae25fbe53d1e7e4", + "P01 INFO: backup file /var/lib/postgresql/9.4/demo/backup_label (236B, 100%) checksum 30baf4c7292a9c6155978b02627d7bd15ffd804b", "P00 INFO: diff backup size = 8.2KB", "P00 INFO: execute exclusive pg_stop_backup() and wait for all WAL segments to archive", "P00 INFO: backup stop archive = 000000010000000000000004, lsn = 0/40000F0", @@ -5400,18 +6125,18 @@ " db (current)", " wal archive min/max (9.4-1): 000000010000000000000002 / 000000010000000000000004", "", - " full backup: 20180320-001305F", - " timestamp start/stop: 2018-03-20 00:13:05 / 2018-03-20 00:13:10", + " full backup: 20180506-151611F", + " timestamp start/stop: 2018-05-06 15:16:11 / 2018-05-06 15:16:16", " wal start/stop: 000000010000000000000002 / 000000010000000000000002", " database size: 19.2MB, backup size: 19.2MB", " repository size: 2.2MB, repository backup size: 2.2MB", "", - " diff backup: 20180320-001305F_20180320-001311D", - " timestamp start/stop: 2018-03-20 00:13:11 / 2018-03-20 00:13:14", + " diff backup: 20180506-151611F_20180506-151616D", + " timestamp start/stop: 2018-05-06 15:16:16 / 2018-05-06 15:16:20", " wal start/stop: 000000010000000000000004 / 000000010000000000000004", " database size: 19.2MB, backup size: 8.2KB", " repository size: 2.2MB, repository backup size: 400B", - " backup reference list: 20180320-001305F" + " backup reference list: 20180506-151611F" ] } }, @@ -5530,9 +6255,9 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: backup command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --type=incr", - "P00 INFO: last backup label = 20180320-001305F_20180320-001311D, version = 2.01", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:13:26\": backup begins after the next regular checkpoint completes", + "P00 INFO: backup command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --type=incr", + "P00 INFO: last backup label = 20180506-151611F_20180506-151616D, version = 2.02", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:16:32\": backup begins after the next regular checkpoint completes", "P00 INFO: backup start archive = 000000020000000000000006, lsn = 0/6000028", "P01 INFO: backup file /var/lib/postgresql/9.4/demo/pg_multixact/offsets/0000 (8KB, 33%) checksum 0631457264ff7f8d5fb1edc2c0211992a67c73e6", " [filtered 10 lines of output]" @@ -5541,7 +6266,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -5562,7 +6287,10 @@ "repo1-cipher-type=aes-256-cbc", "repo1-path=/var/lib/pgbackrest", "repo1-retention-full=2", - "start-fast=y" + "start-fast=y", + "", + "[global:archive-push]", + "compress-level=3" ] } }, @@ -5585,11 +6313,11 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: backup command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --type=incr", - "P00 INFO: last backup label = 20180320-001305F_20180320-001326I, version = 2.01", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:13:30\": backup begins after the requested immediate checkpoint completes", + "P00 INFO: backup command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --type=incr", + "P00 INFO: last backup label = 20180506-151611F_20180506-151632I, version = 2.02", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:16:37\": backup begins after the requested immediate checkpoint completes", "P00 INFO: backup start archive = 000000020000000000000007, lsn = 0/7000028", - "P01 INFO: backup file /var/lib/postgresql/9.4/demo/global/pg_control (8KB, 97%) checksum 33dfd47798b7959b0e8de89de53938b29672ffae", + "P01 INFO: backup file /var/lib/postgresql/9.4/demo/global/pg_control (8KB, 97%) checksum 8500029d8dec8b2403e77a7c8946db1e4a896834", " [filtered 8 lines of output]" ] } @@ -5602,41 +6330,467 @@ "host" : "pg-primary", "output" : false }, - "type" : "exe" + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres pgbackrest --stanza=demo --type=incr \\", + " --log-level-console=info backup" + ], + "err-expect" : "47", + "highlight" : { + "filter" : true, + "filter-context" : 2, + "list" : [ + "ERROR:" + ] + }, + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + " [filtered 2 lines of output]", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:16:41\": backup begins after the requested immediate checkpoint completes", + "P00 INFO: backup start archive = 000000020000000000000008, lsn = 0/8000028", + "P00 ERROR: [047]: unable to create path '/var/lib/pgbackrest/backup/demo/20180506-151611F_20180506-151641I': Permission denied", + "P00 INFO: backup command end: aborted with exception [047]" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo chmod 750 /var/lib/pgbackrest/backup/demo/" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres pgbackrest --stanza=demo --type=incr \\", + " --log-level-console=info backup" + ], + "err-expect" : "57", + "highlight" : { + "filter" : true, + "filter-context" : 2, + "list" : [ + "ERROR:" + ] + }, + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "P00 INFO: backup command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --type=incr", + "P00 INFO: last backup label = 20180506-151611F_20180506-151637I, version = 2.02", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:16:43\": backup begins after the requested immediate checkpoint completes", + "P00 ERROR: [057]: ERROR: a backup is already in progress", + " HINT: Run pg_stop_backup() and try again.:", + " select to_char(current_timestamp, 'YYYY-MM-DD HH24:MI:SS.US TZ'), pg_xlogfile_name(lsn), lsn::text from pg_start_backup('pgBackRest backup started at 2018-05-06 15:16:43', true) as lsn" + ] + } + }, + { + "key" : { + "file" : "/etc/pgbackrest/pgbackrest.conf", + "host" : "pg-primary", + "option" : { + "global" : { + "stop-auto" : { + "value" : "y" + } + } + } + }, + "type" : "cfg-pgbackrest", + "value" : { + "config" : [ + "[demo]", + "pg1-path=/var/lib/postgresql/9.4/demo", + "", + "[global]", + "repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO", + "repo1-cipher-type=aes-256-cbc", + "repo1-path=/var/lib/pgbackrest", + "repo1-retention-full=2", + "start-fast=y", + "stop-auto=y", + "", + "[global:archive-push]", + "compress-level=3" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres pgbackrest --stanza=demo --type=incr \\", + " --log-level-console=info backup" + ], + "highlight" : { + "filter" : true, + "filter-context" : 2, + "list" : [ + "cluster is already in backup mode|backup begins after the requested immediate checkpoint completes" + ] + }, + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "P00 INFO: backup command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --stop-auto --type=incr", + "P00 INFO: last backup label = 20180506-151611F_20180506-151637I, version = 2.02", + "P00 WARN: the cluster is already in backup mode but no pgBackRest backup process is running. pg_stop_backup() will be called so a new backup can be started.", + "P00 INFO: execute exclusive pg_stop_backup() and wait for all WAL segments to archive", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:16:45\": backup begins after the requested immediate checkpoint completes", + "P00 INFO: backup start archive = 000000020000000000000009, lsn = 0/9000028", + "P01 INFO: backup file /var/lib/postgresql/9.4/demo/global/pg_control (8KB, 97%) checksum 725279f91ec80c37072f7c1cb71fd27c36e9f0b8", + " [filtered 8 lines of output]" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres pgbackrest --output=json info" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "[", + " {", + " \"archive\" : [", + " {", + " \"database\" : {", + " \"id\" : 1", + " },", + " \"id\" : \"9.4-1\",", + " \"max\" : \"000000020000000000000009\",", + " \"min\" : \"000000010000000000000002\"", + " }", + " ],", + " \"backup\" : [", + " {", + " \"archive\" : {", + " \"start\" : \"000000010000000000000002\",", + " \"stop\" : \"000000010000000000000002\"", + " },", + " \"backrest\" : {", + " \"format\" : 5,", + " \"version\" : \"2.02\"", + " },", + " \"database\" : {", + " \"id\" : 1", + " },", + " \"info\" : {", + " \"delta\" : 20162900,", + " \"repository\" : {", + " \"delta\" : 2389280,", + " \"size\" : 2389280", + " },", + " \"size\" : 20162900", + " },", + " \"label\" : \"20180506-151611F\",", + " \"prior\" : null,", + " \"reference\" : null,", + " \"timestamp\" : {", + " \"start\" : 1525619771,", + " \"stop\" : 1525619776", + " },", + " \"type\" : \"full\"", + " },", + " {", + " \"archive\" : {", + " \"start\" : \"000000010000000000000004\",", + " \"stop\" : \"000000010000000000000004\"", + " },", + " \"backrest\" : {", + " \"format\" : 5,", + " \"version\" : \"2.02\"", + " },", + " \"database\" : {", + " \"id\" : 1", + " },", + " \"info\" : {", + " \"delta\" : 8428,", + " \"repository\" : {", + " \"delta\" : 400,", + " \"size\" : 2389280", + " },", + " \"size\" : 20162900", + " },", + " \"label\" : \"20180506-151611F_20180506-151616D\",", + " \"prior\" : \"20180506-151611F\",", + " \"reference\" : [", + " \"20180506-151611F\"", + " ],", + " \"timestamp\" : {", + " \"start\" : 1525619776,", + " \"stop\" : 1525619780", + " },", + " \"type\" : \"diff\"", + " },", + " {", + " \"archive\" : {", + " \"start\" : \"000000020000000000000006\",", + " \"stop\" : \"000000020000000000000006\"", + " },", + " \"backrest\" : {", + " \"format\" : 5,", + " \"version\" : \"2.02\"", + " },", + " \"database\" : {", + " \"id\" : 1", + " },", + " \"info\" : {", + " \"delta\" : 24812,", + " \"repository\" : {", + " \"delta\" : 544,", + " \"size\" : 2389280", + " },", + " \"size\" : 20162900", + " },", + " \"label\" : \"20180506-151611F_20180506-151632I\",", + " \"prior\" : \"20180506-151611F_20180506-151616D\",", + " \"reference\" : [", + " \"20180506-151611F\"", + " ],", + " \"timestamp\" : {", + " \"start\" : 1525619792,", + " \"stop\" : 1525619796", + " },", + " \"type\" : \"incr\"", + " },", + " {", + " \"archive\" : {", + " \"start\" : \"000000020000000000000007\",", + " \"stop\" : \"000000020000000000000007\"", + " },", + " \"backrest\" : {", + " \"format\" : 5,", + " \"version\" : \"2.02\"", + " },", + " \"database\" : {", + " \"id\" : 1", + " },", + " \"info\" : {", + " \"delta\" : 8428,", + " \"repository\" : {", + " \"delta\" : 400,", + " \"size\" : 2389280", + " },", + " \"size\" : 20162900", + " },", + " \"label\" : \"20180506-151611F_20180506-151637I\",", + " \"prior\" : \"20180506-151611F_20180506-151632I\",", + " \"reference\" : [", + " \"20180506-151611F\",", + " \"20180506-151611F_20180506-151632I\"", + " ],", + " \"timestamp\" : {", + " \"start\" : 1525619797,", + " \"stop\" : 1525619800", + " },", + " \"type\" : \"incr\"", + " },", + " {", + " \"archive\" : {", + " \"start\" : \"000000020000000000000009\",", + " \"stop\" : \"000000020000000000000009\"", + " },", + " \"backrest\" : {", + " \"format\" : 5,", + " \"version\" : \"2.02\"", + " },", + " \"database\" : {", + " \"id\" : 1", + " },", + " \"info\" : {", + " \"delta\" : 8428,", + " \"repository\" : {", + " \"delta\" : 400,", + " \"size\" : 2389280", + " },", + " \"size\" : 20162900", + " },", + " \"label\" : \"20180506-151611F_20180506-151645I\",", + " \"prior\" : \"20180506-151611F_20180506-151637I\",", + " \"reference\" : [", + " \"20180506-151611F\",", + " \"20180506-151611F_20180506-151632I\"", + " ],", + " \"timestamp\" : {", + " \"start\" : 1525619805,", + " \"stop\" : 1525619810", + " },", + " \"type\" : \"incr\"", + " }", + " ],", + " \"db\" : [", + " {", + " \"id\" : 1,", + " \"system-id\" : 6552486958504244113,", + " \"version\" : \"9.4\"", + " }", + " ],", + " \"name\" : \"demo\",", + " \"status\" : {", + " \"code\" : 0,", + " \"message\" : \"ok\"", + " }", + " }", + "]" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres mkdir -p /home/postgres/pgbackrest/doc/example" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres cp -r /backrest/doc/example/* \\", + " /home/postgres/pgbackrest/doc/example" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres cat \\", + " /home/postgres/pgbackrest/doc/example/pgsql-pgbackrest-info.sql" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "-- An example of monitoring pgBackRest from within PostgresSQL", + "--", + "-- Use copy to export data from the pgBackRest info command into the jsonb", + "-- type so it can be queried directly by PostgresSQL.", + "", + "-- Create monitor schema", + "create schema monitor;", + "", + "-- Get pgBackRest info in JSON format", + "create function monitor.pgbackrest_info()", + " returns jsonb AS $$", + "declare", + " data jsonb;", + "begin", + " -- Create a temp table to hold the JSON data", + " create temp table temp_pgbackrest_data (data jsonb);", + "", + " -- Copy data into the table directory from the pgBackRest into command", + " copy temp_pgbackrest_data (data)", + " from program", + " 'pgbackrest --output=json info | tr ''\\n'' '' ''' (format text);", + "", + " select temp_pgbackrest_data.data", + " into data", + " from temp_pgbackrest_data;", + "", + " drop table temp_pgbackrest_data;", + "", + " return data;", + "end $$ language plpgsql;" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres psql -f \\", + " /home/postgres/pgbackrest/doc/example/pgsql-pgbackrest-info.sql" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres cat \\", + " /home/postgres/pgbackrest/doc/example/pgsql-pgbackrest-query.sql" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "-- Get last successful backup for each stanza", + "--", + "-- Requires the monitor.pgbackrest_info function.", + "with stanza as", + "(", + " select data->'name' as name,", + " data->'backup'->(", + " jsonb_array_length(data->'backup') - 1) as last_backup,", + " data->'archive'->(", + " jsonb_array_length(data->'archive') - 1) as current_archive", + " from jsonb_array_elements(monitor.pgbackrest_info()) as data", + ")", + "select name,", + " to_timestamp(", + " (last_backup->'timestamp'->>'stop')::numeric) as last_successful_backup,", + " current_archive->>'max' as last_archived_wal", + " from stanza;" + ] + } }, { "key" : { "cmd" : [ - "sudo -u postgres pgbackrest --stanza=demo --type=incr \\", - " --log-level-console=info backup" + "sudo -u postgres psql -f \\", + " /home/postgres/pgbackrest/doc/example/pgsql-pgbackrest-query.sql" ], - "err-expect" : "47", - "highlight" : { - "filter" : true, - "filter-context" : 2, - "list" : [ - "ERROR:" - ] - }, "host" : "pg-primary", "output" : true }, "type" : "exe", "value" : { "output" : [ - " [filtered 2 lines of output]", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:13:34\": backup begins after the requested immediate checkpoint completes", - "P00 INFO: backup start archive = 000000020000000000000008, lsn = 0/8000028", - "P00 ERROR: [047]: unable to create path '/var/lib/pgbackrest/backup/demo/20180320-001305F_20180320-001334I': Permission denied", - "P00 INFO: backup command end: aborted with exception [047]" + " name | last_successful_backup | last_archived_wal ", + "--------+------------------------+--------------------------", + " \"demo\" | 2018-05-06 15:16:50+00 | 000000020000000000000009", + "(1 row)" ] } }, { "key" : { "cmd" : [ - "sudo chmod 750 /var/lib/pgbackrest/backup/demo/" + "sudo apt-get install jq" ], + "cmd-extra" : "-y 2>&1", "host" : "pg-primary", "output" : false }, @@ -5645,93 +6799,38 @@ { "key" : { "cmd" : [ - "sudo -u postgres pgbackrest --stanza=demo --type=incr \\", - " --log-level-console=info backup" + "sudo -u postgres pgbackrest --output=json --stanza=demo info | \\", + " jq '.[0] | .backup[-1] | .timestamp.stop'" ], - "err-expect" : "57", - "highlight" : { - "filter" : true, - "filter-context" : 2, - "list" : [ - "ERROR:" - ] - }, "host" : "pg-primary", "output" : true }, "type" : "exe", "value" : { "output" : [ - "P00 INFO: backup command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --type=incr", - "P00 INFO: last backup label = 20180320-001305F_20180320-001330I, version = 2.01", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:13:36\": backup begins after the requested immediate checkpoint completes", - "P00 ERROR: [057]: ERROR: a backup is already in progress", - " HINT: Run pg_stop_backup() and try again.:", - " select to_char(current_timestamp, 'YYYY-MM-DD HH24:MI:SS.US TZ'), pg_xlogfile_name(lsn), lsn::text from pg_start_backup('pgBackRest backup started at 2018-03-20 00:13:36', true) as lsn" - ] - } - }, - { - "key" : { - "file" : "/etc/pgbackrest.conf", - "host" : "pg-primary", - "option" : { - "global" : { - "stop-auto" : { - "value" : "y" - } - } - } - }, - "type" : "cfg-pgbackrest", - "value" : { - "config" : [ - "[demo]", - "pg1-path=/var/lib/postgresql/9.4/demo", - "", - "[global]", - "repo1-cipher-pass=zWaf6XtpjIVZC5444yXB+cgFDFl7MxGlgkZSaoPvTGirhPygu4jOKOXf9LO4vjfO", - "repo1-cipher-type=aes-256-cbc", - "repo1-path=/var/lib/pgbackrest", - "repo1-retention-full=2", - "start-fast=y", - "stop-auto=y" + "1525619810" ] } }, { "key" : { "cmd" : [ - "sudo -u postgres pgbackrest --stanza=demo --type=incr \\", - " --log-level-console=info backup" + "sudo -u postgres pgbackrest --output=json --stanza=demo info | \\", + " jq '.[0] | .archive[-1] | .max'" ], - "highlight" : { - "filter" : true, - "filter-context" : 2, - "list" : [ - "cluster is already in backup mode|backup begins after the requested immediate checkpoint completes" - ] - }, "host" : "pg-primary", "output" : true }, "type" : "exe", "value" : { "output" : [ - "P00 INFO: backup command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo --start-fast --stop-auto --type=incr", - "P00 INFO: last backup label = 20180320-001305F_20180320-001330I, version = 2.01", - "P00 WARN: the cluster is already in backup mode but no pgBackRest backup process is running. pg_stop_backup() will be called so a new backup can be started.", - "P00 INFO: execute exclusive pg_stop_backup() and wait for all WAL segments to archive", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:13:38\": backup begins after the requested immediate checkpoint completes", - "P00 INFO: backup start archive = 000000020000000000000009, lsn = 0/9000028", - "P01 INFO: backup file /var/lib/postgresql/9.4/demo/global/pg_control (8KB, 97%) checksum 2bb3f7cb57a717f41bc60542ea8e629a22410a70", - " [filtered 8 lines of output]" + "\"000000020000000000000009\"" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -5753,7 +6852,10 @@ "repo1-path=/var/lib/pgbackrest", "repo1-retention-full=2", "start-fast=y", - "stop-auto=y" + "stop-auto=y", + "", + "[global:archive-push]", + "compress-level=3" ] } }, @@ -5767,7 +6869,7 @@ "filter" : true, "filter-context" : 2, "list" : [ - "archive retention on backup 20180320-001305F|remove archive" + "archive retention on backup 20180506-151611F|remove archive" ] }, "host" : "pg-primary", @@ -5778,8 +6880,8 @@ "output" : [ " [filtered 763 lines of output]", "P00 INFO: backup command end: completed successfully", - "P00 INFO: expire command begin 2.01: --log-level-console=detail --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo", - "P00 DETAIL: archive retention on backup 20180320-001305F, archiveId = 9.4-1, start = 000000010000000000000002", + "P00 INFO: expire command begin", + "P00 DETAIL: archive retention on backup 20180506-151611F, archiveId = 9.4-1, start = 000000010000000000000002", "P00 DETAIL: no archive to remove, archiveId = 9.4-1", "P00 INFO: expire command end: completed successfully" ] @@ -5796,7 +6898,7 @@ "type" : "exe", "value" : { "output" : [ - "20180320-001343F" + "20180506-151655F" ] } }, @@ -5810,7 +6912,7 @@ "filter" : true, "filter-context" : 2, "list" : [ - "expire full backup set\\: 20180320-001305F|archive retention on backup 20180320-001343F|remove archive" + "expire full backup set\\: 20180506-151611F|archive retention on backup 20180506-151655F|remove archive" ] }, "host" : "pg-primary", @@ -5821,17 +6923,17 @@ "output" : [ " [filtered 763 lines of output]", "P00 INFO: backup command end: completed successfully", - "P00 INFO: expire command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-full=2 --stanza=demo", - "P00 INFO: expire full backup set: 20180320-001305F, 20180320-001305F_20180320-001311D, 20180320-001305F_20180320-001326I, 20180320-001305F_20180320-001330I, 20180320-001305F_20180320-001338I", - "P00 INFO: remove expired backup 20180320-001305F_20180320-001338I", - "P00 INFO: remove expired backup 20180320-001305F_20180320-001330I", + "P00 INFO: expire command begin", + "P00 INFO: expire full backup set: 20180506-151611F, 20180506-151611F_20180506-151616D, 20180506-151611F_20180506-151632I, 20180506-151611F_20180506-151637I, 20180506-151611F_20180506-151645I", + "P00 INFO: remove expired backup 20180506-151611F_20180506-151645I", + "P00 INFO: remove expired backup 20180506-151611F_20180506-151637I", " [filtered 3 lines of output]" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -5854,7 +6956,10 @@ "repo1-retention-diff=1", "repo1-retention-full=2", "start-fast=y", - "stop-auto=y" + "stop-auto=y", + "", + "[global:archive-push]", + "compress-level=3" ] } }, @@ -5879,7 +6984,7 @@ "type" : "exe", "value" : { "output" : [ - "20180320-001349F_20180320-001356D" + "20180506-151702F_20180506-151709D" ] } }, @@ -5903,7 +7008,7 @@ "filter" : true, "filter-context" : 2, "list" : [ - "expire diff backup set: 20180320-001349F_20180320-001356D" + "expire diff backup set: 20180506-151702F_20180506-151709D" ] }, "host" : "pg-primary", @@ -5914,16 +7019,16 @@ "output" : [ " [filtered 10 lines of output]", "P00 INFO: backup command end: completed successfully", - "P00 INFO: expire command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-diff=1 --repo1-retention-full=2 --stanza=demo", - "P00 INFO: expire diff backup set: 20180320-001349F_20180320-001356D, 20180320-001349F_20180320-001401I", - "P00 INFO: remove expired backup 20180320-001349F_20180320-001401I", - "P00 INFO: remove expired backup 20180320-001349F_20180320-001356D" + "P00 INFO: expire command begin", + "P00 INFO: expire diff backup set: 20180506-151702F_20180506-151709D, 20180506-151702F_20180506-151714I", + "P00 INFO: remove expired backup 20180506-151702F_20180506-151714I", + "P00 INFO: remove expired backup 20180506-151702F_20180506-151709D" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -5946,7 +7051,10 @@ "repo1-retention-diff=2", "repo1-retention-full=2", "start-fast=y", - "stop-auto=y" + "stop-auto=y", + "", + "[global:archive-push]", + "compress-level=3" ] } }, @@ -5961,7 +7069,7 @@ "type" : "exe", "value" : { "output" : [ - "20180320-001349F_20180320-001405D" + "20180506-151702F_20180506-151718D" ] } }, @@ -5998,10 +7106,10 @@ "output" : [ " [filtered 7 lines of output]", "P00 INFO: execute exclusive pg_stop_backup() and wait for all WAL segments to archive", - "P00 INFO: backup stop archive = 000000020000000000000012, lsn = 0/120000F0", - "P00 INFO: new backup label = 20180320-001349F_20180320-001410D", + "P00 INFO: backup stop archive = 000000020000000000000014, lsn = 0/140000F0", + "P00 INFO: new backup label = 20180506-151702F_20180506-151724D", "P00 INFO: backup command end: completed successfully", - "P00 INFO: expire command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-diff=2 --repo1-retention-full=2 --stanza=demo" + "P00 INFO: expire command begin" ] } }, @@ -6016,7 +7124,7 @@ "type" : "exe", "value" : { "output" : [ - "20180320-001349F_20180320-001410D" + "20180506-151702F_20180506-151724D" ] } }, @@ -6030,7 +7138,7 @@ "filter" : true, "filter-context" : 2, "list" : [ - "archive retention on backup 20180320-001349F_20180320-001405D|remove archive" + "archive retention on backup 20180506-151702F_20180506-151718D|remove archive" ] }, "host" : "pg-primary", @@ -6039,13 +7147,13 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: expire command begin 2.01: --log-level-console=detail --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-archive=1 --repo1-retention-archive-type=diff --repo1-retention-diff=2 --repo1-retention-full=2 --stanza=demo", - "P00 DETAIL: archive retention on backup 20180320-001343F, archiveId = 9.4-1, start = 00000002000000000000000A, stop = 00000002000000000000000A", - "P00 DETAIL: archive retention on backup 20180320-001349F, archiveId = 9.4-1, start = 00000002000000000000000B, stop = 00000002000000000000000B", - "P00 DETAIL: archive retention on backup 20180320-001349F_20180320-001405D, archiveId = 9.4-1, start = 00000002000000000000000E, stop = 00000002000000000000000E", - "P00 DETAIL: archive retention on backup 20180320-001349F_20180320-001410D, archiveId = 9.4-1, start = 000000020000000000000012", - "P00 DETAIL: remove archive: archiveId = 9.4-1, start = 00000002000000000000000C, stop = 00000002000000000000000D", - "P00 DETAIL: remove archive: archiveId = 9.4-1, start = 00000002000000000000000F, stop = 000000020000000000000011", + "P00 INFO: expire command begin 2.02: --log-level-console=detail --log-level-stderr=off --no-log-timestamp --repo1-cipher-pass=<redacted> --repo1-cipher-type=aes-256-cbc --repo1-path=/var/lib/pgbackrest --repo1-retention-archive=1 --repo1-retention-archive-type=diff --repo1-retention-diff=2 --repo1-retention-full=2 --stanza=demo", + "P00 DETAIL: archive retention on backup 20180506-151655F, archiveId = 9.4-1, start = 00000002000000000000000B, stop = 00000002000000000000000B", + "P00 DETAIL: archive retention on backup 20180506-151702F, archiveId = 9.4-1, start = 00000002000000000000000C, stop = 00000002000000000000000C", + "P00 DETAIL: archive retention on backup 20180506-151702F_20180506-151718D, archiveId = 9.4-1, start = 000000020000000000000010, stop = 000000020000000000000010", + "P00 DETAIL: archive retention on backup 20180506-151702F_20180506-151724D, archiveId = 9.4-1, start = 000000020000000000000014", + "P00 DETAIL: remove archive: archiveId = 9.4-1, start = 00000002000000000000000D, stop = 00000002000000000000000F", + "P00 DETAIL: remove archive: archiveId = 9.4-1, start = 000000020000000000000011, stop = 000000020000000000000013", "P00 INFO: expire command end: completed successfully" ] } @@ -6188,7 +7296,7 @@ { "key" : { "cmd" : [ - "sudo -u postgres du -sh /var/lib/postgresql/9.4/demo/base/16384" + "sudo -u postgres psql -Atc \"select oid from pg_database where datname = 'test1'\"" ], "host" : "pg-primary", "output" : true @@ -6196,7 +7304,22 @@ "type" : "exe", "value" : { "output" : [ - "6.4M\t/var/lib/postgresql/9.4/demo/base/16384" + "24576" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres du -sh /var/lib/postgresql/9.4/demo/base/24576" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "6.5M\t/var/lib/postgresql/9.4/demo/base/24576" ] } }, @@ -6278,14 +7401,14 @@ "type" : "exe", "value" : { "output" : [ - "psql: FATAL: relation mapping file \"base/16384/pg_filenode.map\" contains invalid data" + "psql: FATAL: relation mapping file \"base/24576/pg_filenode.map\" contains invalid data" ] } }, { "key" : { "cmd" : [ - "sudo -u postgres du -sh /var/lib/postgresql/9.4/demo/base/16384" + "sudo -u postgres du -sh /var/lib/postgresql/9.4/demo/base/24576" ], "host" : "pg-primary", "output" : true @@ -6293,7 +7416,7 @@ "type" : "exe", "value" : { "output" : [ - "152K\t/var/lib/postgresql/9.4/demo/base/16384" + "152K\t/var/lib/postgresql/9.4/demo/base/24576" ] } }, @@ -6335,7 +7458,7 @@ " 1 | template1", " 12134 | template0", " 12139 | postgres", - " 16385 | test2", + " 24577 | test2", "(4 rows)" ] } @@ -6390,7 +7513,7 @@ "type" : "exe", "value" : { "output" : [ - "2018-03-20 00:14:45.019624+00" + "2018-05-06 15:17:58.783787+00" ] } }, @@ -6436,7 +7559,7 @@ "key" : { "cmd" : [ "sudo -u postgres pgbackrest --stanza=demo --delta \\", - " --type=time \"--target=2018-03-20 00:14:45.019624+00\" restore" + " --type=time \"--target=2018-05-06 15:17:58.783787+00\" restore" ], "host" : "pg-primary", "output" : false @@ -6472,7 +7595,7 @@ "value" : { "output" : [ "restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'", - "recovery_target_time = '2018-03-20 00:14:45.019624+00'" + "recovery_target_time = '2018-05-06 15:17:58.783787+00'" ] } }, @@ -6539,19 +7662,19 @@ "type" : "exe", "value" : { "output" : [ - "LOG: database system was interrupted; last known up at 2018-03-20 00:14:40 UTC", - "LOG: starting point-in-time recovery to 2018-03-20 00:14:45.019624+00", + "LOG: database system was interrupted; last known up at 2018-05-06 15:17:54 UTC", + "LOG: starting point-in-time recovery to 2018-05-06 15:17:58.783787+00", "LOG: restored log file \"00000004.history\" from archive", - "LOG: restored log file \"000000040000000000000017\" from archive", - " [filtered 2 lines of output]", + "LOG: restored log file \"000000040000000000000019\" from archive", + "LOG: redo starts at 0/19000028", + "LOG: consistent recovery state reached at 0/190000F0", + "LOG: restored log file \"00000004000000000000001A\" from archive", + "LOG: recovery stopping before commit of transaction 689, time 2018-05-06 15:17:58.990914+00", + "LOG: redo done at 0/1A016E48", + "LOG: last completed transaction was at log time 2018-05-06 15:17:58.563866+00", "LOG: incomplete startup packet", - "LOG: restored log file \"000000040000000000000018\" from archive", - "LOG: recovery stopping before commit of transaction 686, time 2018-03-20 00:14:45.182277+00", - "LOG: redo done at 0/180157F0", - "LOG: last completed transaction was at log time 2018-03-20 00:14:44.86087+00", "LOG: selected new timeline ID: 5", - "LOG: restored log file \"00000004.history\" from archive", - " [filtered 4 lines of output]" + " [filtered 5 lines of output]" ] } }, @@ -6594,7 +7717,7 @@ "type" : "exe", "value" : { "output" : [ - "20180320-001349F_20180320-001439D" + "20180506-151702F_20180506-151753D" ] } }, @@ -6622,7 +7745,7 @@ "key" : { "cmd" : [ "sudo -u postgres pgbackrest --stanza=demo --delta \\", - " --type=time \"--target=2018-03-20 00:14:45.019624+00\" restore" + " --type=time \"--target=2018-05-06 15:17:58.783787+00\" restore" ], "host" : "pg-primary", "output" : false @@ -6702,15 +7825,15 @@ "type" : "exe", "value" : { "output" : [ - "LOG: database system was interrupted; last known up at 2018-03-20 00:14:55 UTC", - "LOG: starting point-in-time recovery to 2018-03-20 00:14:45.019624+00", + "LOG: database system was interrupted; last known up at 2018-05-06 15:18:09 UTC", + "LOG: starting point-in-time recovery to 2018-05-06 15:17:58.783787+00", "LOG: restored log file \"00000005.history\" from archive", - "LOG: restored log file \"000000050000000000000019\" from archive", - "LOG: redo starts at 0/19000028", - "LOG: consistent recovery state reached at 0/190000F0", - "LOG: redo done at 0/190000F0", + "LOG: restored log file \"00000005000000000000001B\" from archive", + "LOG: redo starts at 0/1B000028", + "LOG: consistent recovery state reached at 0/1B0000F0", + "LOG: redo done at 0/1B0000F0", "LOG: incomplete startup packet", - " [filtered 9 lines of output]" + " [filtered 10 lines of output]" ] } }, @@ -6723,7 +7846,7 @@ "filter" : false, "filter-context" : 2, "list" : [ - "20180320-001349F_20180320-001439D" + "20180506-151702F_20180506-151753D" ] }, "host" : "pg-primary", @@ -6736,47 +7859,47 @@ " status: ok", "", " db (current)", - " wal archive min/max (9.4-1): 00000002000000000000000A / 000000050000000000000019", + " wal archive min/max (9.4-1): 00000002000000000000000B / 00000005000000000000001B", "", - " full backup: 20180320-001343F", - " timestamp start/stop: 2018-03-20 00:13:43 / 2018-03-20 00:13:48", - " wal start/stop: 00000002000000000000000A / 00000002000000000000000A", + " full backup: 20180506-151655F", + " timestamp start/stop: 2018-05-06 15:16:55 / 2018-05-06 15:17:02", + " wal start/stop: 00000002000000000000000B / 00000002000000000000000B", " database size: 19.2MB, backup size: 19.2MB", " repository size: 2.2MB, repository backup size: 2.2MB", "", - " full backup: 20180320-001349F", - " timestamp start/stop: 2018-03-20 00:13:49 / 2018-03-20 00:13:54", - " wal start/stop: 00000002000000000000000B / 00000002000000000000000B", + " full backup: 20180506-151702F", + " timestamp start/stop: 2018-05-06 15:17:02 / 2018-05-06 15:17:08", + " wal start/stop: 00000002000000000000000C / 00000002000000000000000C", " database size: 19.2MB, backup size: 19.2MB", " repository size: 2.2MB, repository backup size: 2.2MB", "", - " diff backup: 20180320-001349F_20180320-001410D", - " timestamp start/stop: 2018-03-20 00:14:10 / 2018-03-20 00:14:13", - " wal start/stop: 000000020000000000000012 / 000000020000000000000012", + " diff backup: 20180506-151702F_20180506-151724D", + " timestamp start/stop: 2018-05-06 15:17:24 / 2018-05-06 15:17:27", + " wal start/stop: 000000020000000000000014 / 000000020000000000000014", " database size: 19.2MB, backup size: 8.2KB", " repository size: 2.2MB, repository backup size: 400B", - " backup reference list: 20180320-001349F", + " backup reference list: 20180506-151702F", "", - " incr backup: 20180320-001349F_20180320-001422I", - " timestamp start/stop: 2018-03-20 00:14:22 / 2018-03-20 00:14:27", - " wal start/stop: 000000030000000000000014 / 000000030000000000000014", - " database size: 31.7MB, backup size: 12.5MB", + " incr backup: 20180506-151702F_20180506-151737I", + " timestamp start/stop: 2018-05-06 15:17:37 / 2018-05-06 15:17:42", + " wal start/stop: 000000030000000000000016 / 000000030000000000000016", + " database size: 31.7MB, backup size: 12.6MB", " repository size: 3.7MB, repository backup size: 1.5MB", - " backup reference list: 20180320-001349F", + " backup reference list: 20180506-151702F", "", - " diff backup: 20180320-001349F_20180320-001439D", - " timestamp start/stop: 2018-03-20 00:14:39 / 2018-03-20 00:14:43", - " wal start/stop: 000000040000000000000017 / 000000040000000000000017", + " diff backup: 20180506-151702F_20180506-151753D", + " timestamp start/stop: 2018-05-06 15:17:53 / 2018-05-06 15:17:58", + " wal start/stop: 000000040000000000000019 / 000000040000000000000019", " database size: 25.5MB, backup size: 6.3MB", - " repository size: 3MB, repository backup size: 771.6KB", - " backup reference list: 20180320-001349F", + " repository size: 3MB, repository backup size: 781KB", + " backup reference list: 20180506-151702F", "", - " incr backup: 20180320-001349F_20180320-001454I", - " timestamp start/stop: 2018-03-20 00:14:54 / 2018-03-20 00:14:57", - " wal start/stop: 000000050000000000000019 / 000000050000000000000019", + " incr backup: 20180506-151702F_20180506-151807I", + " timestamp start/stop: 2018-05-06 15:18:07 / 2018-05-06 15:18:11", + " wal start/stop: 00000005000000000000001B / 00000005000000000000001B", " database size: 25.5MB, backup size: 1.7MB", - " repository size: 3MB, repository backup size: 200.8KB", - " backup reference list: 20180320-001349F, 20180320-001349F_20180320-001439D" + " repository size: 3MB, repository backup size: 201.5KB", + " backup reference list: 20180506-151702F, 20180506-151702F_20180506-151753D" ] } }, @@ -6794,8 +7917,8 @@ "key" : { "cmd" : [ "sudo -u postgres pgbackrest --stanza=demo --delta \\", - " --type=time \"--target=2018-03-20 00:14:45.019624+00\" \\", - " --set=20180320-001349F_20180320-001439D restore" + " --type=time \"--target=2018-05-06 15:17:58.783787+00\" \\", + " --set=20180506-151702F_20180506-151753D restore" ], "host" : "pg-primary", "output" : false @@ -6875,25 +7998,25 @@ "type" : "exe", "value" : { "output" : [ - "LOG: database system was interrupted; last known up at 2018-03-20 00:14:40 UTC", - "LOG: starting point-in-time recovery to 2018-03-20 00:14:45.019624+00", - "FATAL: the database system is starting up", + "LOG: database system was interrupted; last known up at 2018-05-06 15:17:54 UTC", + "LOG: starting point-in-time recovery to 2018-05-06 15:17:58.783787+00", "LOG: restored log file \"00000004.history\" from archive", - " [filtered 3 lines of output]", + "LOG: restored log file \"000000040000000000000019\" from archive", + "LOG: redo starts at 0/19000028", + "LOG: consistent recovery state reached at 0/190000F0", + "LOG: restored log file \"00000004000000000000001A\" from archive", + "LOG: recovery stopping before commit of transaction 689, time 2018-05-06 15:17:58.990914+00", + "LOG: redo done at 0/1A016E48", + "LOG: last completed transaction was at log time 2018-05-06 15:17:58.563866+00", "LOG: incomplete startup packet", - "LOG: restored log file \"000000040000000000000018\" from archive", - "LOG: recovery stopping before commit of transaction 686, time 2018-03-20 00:14:45.182277+00", - "LOG: redo done at 0/180157F0", - "LOG: last completed transaction was at log time 2018-03-20 00:14:44.86087+00", "LOG: restored log file \"00000005.history\" from archive", - "LOG: restored log file \"00000006.history\" from archive", - " [filtered 7 lines of output]" + " [filtered 8 lines of output]" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -6916,13 +8039,16 @@ "repo1-retention-diff=2", "repo1-retention-full=2", "start-fast=y", - "stop-auto=y" + "stop-auto=y", + "", + "[global:archive-push]", + "compress-level=3" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "global" : { @@ -6976,7 +8102,10 @@ "repo1-s3-verify-ssl=n", "repo1-type=s3", "start-fast=y", - "stop-auto=y" + "stop-auto=y", + "", + "[global:archive-push]", + "compress-level=3" ] } }, @@ -7019,7 +8148,7 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: stanza-create command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-type=none --repo1-path=/ --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo", + "P00 INFO: stanza-create command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-type=none --repo1-path=/ --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo", "P00 INFO: stanza-create command end: completed successfully" ] } @@ -7043,16 +8172,16 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: backup command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --process-max=4 --repo1-cipher-type=none --repo1-path=/ --repo1-retention-diff=2 --repo1-retention-full=2 --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo --start-fast --stop-auto", + "P00 INFO: backup command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --process-max=4 --repo1-cipher-type=none --repo1-path=/ --repo1-retention-diff=2 --repo1-retention-full=2 --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo --start-fast --stop-auto", "P00 WARN: no prior backup exists, incr backup has been changed to full", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:15:18\": backup begins after the requested immediate checkpoint completes", - "P00 INFO: backup start archive = 000000070000000000000019, lsn = 0/19000028", + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:18:34\": backup begins after the requested immediate checkpoint completes", + "P00 INFO: backup start archive = 00000007000000000000001B, lsn = 0/1B000028", " [filtered 995 lines of output]", - "P02 INFO: backup file /var/lib/postgresql/9.4/demo/base/1/11905 (0B, 100%)", - "P03 INFO: backup file /var/lib/postgresql/9.4/demo/base/1/11907 (0B, 100%)", + "P01 INFO: backup file /var/lib/postgresql/9.4/demo/base/1/11895 (0B, 100%)", + "P03 INFO: backup file /var/lib/postgresql/9.4/demo/base/1/11885 (0B, 100%)", "P00 INFO: full backup size = 25.5MB", "P00 INFO: execute exclusive pg_stop_backup() and wait for all WAL segments to archive", - "P00 INFO: backup stop archive = 000000070000000000000019, lsn = 0/19000128", + "P00 INFO: backup stop archive = 00000007000000000000001B, lsn = 0/1B000128", " [filtered 4 lines of output]" ] } @@ -7085,7 +8214,7 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: stop command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-type=none --repo1-path=/ --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo", + "P00 INFO: stop command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --repo1-cipher-type=none --repo1-path=/ --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo", "P00 INFO: stop command end: completed successfully" ] } @@ -7108,7 +8237,7 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: stanza-delete command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-type=none --repo1-path=/ --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo", + "P00 INFO: stanza-delete command begin 2.02: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-cipher-type=none --repo1-path=/ --repo1-s3-bucket=demo-bucket --repo1-s3-endpoint=s3.amazonaws.com --repo1-s3-key=<redacted> --repo1-s3-key-secret=<redacted> --repo1-s3-region=us-east-1 --no-repo1-s3-verify-ssl --repo1-type=s3 --stanza=demo", "P00 INFO: stanza-delete command end: completed successfully" ] } @@ -7145,6 +8274,16 @@ }, "type" : "exe" }, + { + "key" : { + "cmd" : [ + "sudo apt-get update" + ], + "host" : "repository", + "output" : false + }, + "type" : "exe" + }, { "key" : { "cmd" : [ @@ -7159,7 +8298,7 @@ { "key" : { "cmd" : [ - "sudo mkdir /root/pgbackrest-release-2.01" + "sudo mkdir /root/pgbackrest-release-2.02" ], "host" : "repository", "output" : false @@ -7169,7 +8308,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/build /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/build /root/pgbackrest-release-2.02" ], "host" : "repository", "output" : false @@ -7179,7 +8318,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/lib /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/lib /root/pgbackrest-release-2.02" ], "host" : "repository", "output" : false @@ -7189,7 +8328,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/libc /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/libc /root/pgbackrest-release-2.02" ], "host" : "repository", "output" : false @@ -7199,7 +8338,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/src /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/src /root/pgbackrest-release-2.02" ], "host" : "repository", "output" : false @@ -7209,7 +8348,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /root/pgbackrest-release-2.01/lib/pgBackRest \\", + "sudo cp -r /root/pgbackrest-release-2.02/lib/pgBackRest \\", " /usr/share/perl5" ], "host" : "repository", @@ -7260,7 +8399,27 @@ { "key" : { "cmd" : [ - "sudo touch /etc/pgbackrest.conf" + "sudo mkdir /etc/pgbackrest" + ], + "host" : "repository", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo mkdir /etc/pgbackrest/conf.d" + ], + "host" : "repository", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo touch /etc/pgbackrest/pgbackrest.conf" ], "host" : "repository", "output" : false @@ -7270,7 +8429,7 @@ { "key" : { "cmd" : [ - "sudo chmod 640 /etc/pgbackrest.conf" + "sudo chmod 640 /etc/pgbackrest/pgbackrest.conf" ], "host" : "repository", "output" : false @@ -7280,7 +8439,7 @@ { "key" : { "cmd" : [ - "sudo chown pgbackrest:pgbackrest /etc/pgbackrest.conf" + "sudo chown pgbackrest:pgbackrest /etc/pgbackrest/pgbackrest.conf" ], "host" : "repository", "output" : false @@ -7290,7 +8449,7 @@ { "key" : { "cmd" : [ - "sudo sh -c 'cd /root/pgbackrest-release-2.01/libc && \\", + "sudo sh -c 'cd /root/pgbackrest-release-2.02/libc && \\", " perl Makefile.PL INSTALLMAN1DIR=none INSTALLMAN3DIR=none'" ], "host" : "repository", @@ -7301,7 +8460,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/libc test" + "sudo make -C /root/pgbackrest-release-2.02/libc test" ], "host" : "repository", "output" : false @@ -7311,7 +8470,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/libc install" + "sudo make -C /root/pgbackrest-release-2.02/libc install" ], "host" : "repository", "output" : false @@ -7321,7 +8480,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/src" + "sudo make -C /root/pgbackrest-release-2.02/src" ], "host" : "repository", "output" : false @@ -7331,7 +8490,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/src install" + "sudo make -C /root/pgbackrest-release-2.02/src install" ], "host" : "repository", "output" : false @@ -7341,7 +8500,7 @@ { "key" : { "cmd" : [ - "sudo mkdir /var/lib/pgbackrest" + "sudo mkdir -p /var/lib/pgbackrest" ], "host" : "repository", "output" : false @@ -7456,7 +8615,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "repository", "option" : { "global" : { @@ -7476,7 +8635,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "repository", "option" : { "demo" : { @@ -7523,7 +8682,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "demo" : { @@ -7643,164 +8802,17 @@ "host" : "pg-primary", "output" : false }, - "type" : "exe" - }, - { - "key" : { - "cmd" : [ - "sudo -u pgbackrest pgbackrest --stanza=demo backup" - ], - "host" : "repository", - "output" : false - }, - "type" : "exe" - }, - { - "key" : { - "cmd" : [ - "sudo mkdir -m 750 /var/spool/pgbackrest" - ], - "host" : "pg-primary", - "output" : false - }, - "type" : "exe" - }, - { - "key" : { - "cmd" : [ - "sudo chown postgres:postgres /var/spool/pgbackrest" - ], - "host" : "pg-primary", - "output" : false - }, - "type" : "exe" - }, - { - "key" : { - "file" : "/etc/pgbackrest.conf", - "host" : "pg-primary", - "option" : { - "global" : { - "archive-async" : { - "value" : "y" - }, - "spool-path" : { - "value" : "/var/spool/pgbackrest" - } - }, - "global:archive-push" : { - "process-max" : { - "value" : "2" - } - } - } - }, - "type" : "cfg-pgbackrest", - "value" : { - "config" : [ - "[demo]", - "pg1-path=/var/lib/postgresql/9.4/demo", - "", - "[global]", - "archive-async=y", - "log-level-file=detail", - "repo1-host=repository", - "spool-path=/var/spool/pgbackrest", - "", - "[global:archive-push]", - "process-max=2" - ] - } - }, - { - "key" : { - "cmd" : [ - "sudo -u postgres rm -f /var/log/pgbackrest/demo-archive-async.log" - ], - "host" : "pg-primary", - "output" : false - }, - "type" : "exe" - }, - { - "key" : { - "cmd" : [ - "sudo -u postgres psql -c \" \\", - " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", - " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", - " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", - " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", - " select pg_create_restore_point('test async push'); select pg_switch_xlog();\"" - ], - "host" : "pg-primary", - "output" : false - }, - "type" : "exe" - }, - { - "key" : { - "cmd" : [ - "sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check" - ], - "highlight" : { - "filter" : true, - "filter-context" : 2, - "list" : [ - "WAL segment" - ] - }, - "host" : "pg-primary", - "output" : true - }, - "type" : "exe", - "value" : { - "output" : [ - "P00 INFO: check command begin 2.01: --log-level-console=info --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-host=repository --stanza=demo", - "P00 INFO: WAL segment 000000080000000000000026 successfully stored in the archive at '/var/lib/pgbackrest/archive/demo/9.4-1/0000000800000000/000000080000000000000026-9dd1f997ce8f9211974d215e29cf5a8b855d92b3.gz'", - "P00 INFO: check command end: completed successfully" - ] - } + "type" : "exe" }, { "key" : { "cmd" : [ - "sudo -u postgres cat /var/log/pgbackrest/demo-archive-async.log" + "sudo -u pgbackrest pgbackrest --stanza=demo backup" ], - "highlight" : { - "filter" : true, - "filter-context" : 2, - "list" : [ - " WAL file\\(s\\) to archive|pushed WAL file 0000000" - ] - }, - "host" : "pg-primary", - "output" : true + "host" : "repository", + "output" : false }, - "type" : "exe", - "value" : { - "output" : [ - "-------------------PROCESS START-------------------", - "P00 INFO: archive-push command begin 2.01: --archive-async --log-level-console=warn --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", - "P00 INFO: push 3 WAL file(s) to archive: 000000080000000000000021...000000080000000000000023", - "P02 DETAIL: pushed WAL file 000000080000000000000022 to archive", - "P01 DETAIL: pushed WAL file 000000080000000000000021 to archive", - "P02 DETAIL: pushed WAL file 000000080000000000000023 to archive", - "P00 INFO: archive-push command end: completed successfully", - "", - "-------------------PROCESS START-------------------", - "P00 INFO: archive-push command begin 2.01: --archive-async --log-level-console=warn --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", - "P00 INFO: push 2 WAL file(s) to archive: 000000080000000000000024...000000080000000000000025", - "P02 DETAIL: pushed WAL file 000000080000000000000025 to archive", - "P01 DETAIL: pushed WAL file 000000080000000000000024 to archive", - "P00 INFO: archive-push command end: completed successfully", - "", - "-------------------PROCESS START-------------------", - "P00 INFO: archive-push command begin 2.01: --archive-async --log-level-console=warn --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", - "P00 INFO: push 1 WAL file(s) to archive: 000000080000000000000026", - "P01 DETAIL: pushed WAL file 000000080000000000000026 to archive", - "P00 INFO: archive-push command end: completed successfully" - ] - } + "type" : "exe" }, { "key" : { @@ -7842,7 +8854,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "repository", "option" : { "global" : { @@ -7900,17 +8912,17 @@ " status: ok", "", " db (current)", - " wal archive min/max (9.4-1): 000000080000000000000028 / 000000080000000000000029", + " wal archive min/max (9.4-1): 000000080000000000000022 / 000000080000000000000023", "", - " full backup: 20180320-001642F", - " timestamp start/stop: 2018-03-20 00:16:42 / 2018-03-20 00:16:50", - " wal start/stop: 000000080000000000000028 / 000000080000000000000028", + " full backup: 20180506-152004F", + " timestamp start/stop: 2018-05-06 15:20:04 / 2018-05-06 15:20:13", + " wal start/stop: 000000080000000000000022 / 000000080000000000000022", " database size: 25.5MB, backup size: 25.5MB", " repository size: 3MB, repository backup size: 3MB", "", - " full backup: 20180320-001652F", - " timestamp start/stop: 2018-03-20 00:16:52 / 2018-03-20 00:16:59", - " wal start/stop: 000000080000000000000029 / 000000080000000000000029", + " full backup: 20180506-152014F", + " timestamp start/stop: 2018-05-06 15:20:14 / 2018-05-06 15:20:19", + " wal start/stop: 000000080000000000000023 / 000000080000000000000023", " database size: 25.5MB, backup size: 25.5MB", " repository size: 3MB, repository backup size: 3MB" ] @@ -8029,6 +9041,16 @@ "ip" : "172.17.0.5" } }, + { + "key" : { + "cmd" : [ + "sudo apt-get update" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, { "key" : { "cmd" : [ @@ -8043,7 +9065,7 @@ { "key" : { "cmd" : [ - "sudo mkdir /root/pgbackrest-release-2.01" + "sudo mkdir /root/pgbackrest-release-2.02" ], "host" : "pg-standby", "output" : false @@ -8053,7 +9075,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/build /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/build /root/pgbackrest-release-2.02" ], "host" : "pg-standby", "output" : false @@ -8063,7 +9085,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/lib /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/lib /root/pgbackrest-release-2.02" ], "host" : "pg-standby", "output" : false @@ -8073,7 +9095,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/libc /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/libc /root/pgbackrest-release-2.02" ], "host" : "pg-standby", "output" : false @@ -8083,7 +9105,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /backrest/src /root/pgbackrest-release-2.01" + "sudo cp -r /backrest/src /root/pgbackrest-release-2.02" ], "host" : "pg-standby", "output" : false @@ -8093,7 +9115,7 @@ { "key" : { "cmd" : [ - "sudo cp -r /root/pgbackrest-release-2.01/lib/pgBackRest \\", + "sudo cp -r /root/pgbackrest-release-2.02/lib/pgBackRest \\", " /usr/share/perl5" ], "host" : "pg-standby", @@ -8144,7 +9166,27 @@ { "key" : { "cmd" : [ - "sudo touch /etc/pgbackrest.conf" + "sudo mkdir /etc/pgbackrest" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo mkdir /etc/pgbackrest/conf.d" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo touch /etc/pgbackrest/pgbackrest.conf" ], "host" : "pg-standby", "output" : false @@ -8154,7 +9196,7 @@ { "key" : { "cmd" : [ - "sudo chmod 640 /etc/pgbackrest.conf" + "sudo chmod 640 /etc/pgbackrest/pgbackrest.conf" ], "host" : "pg-standby", "output" : false @@ -8164,7 +9206,7 @@ { "key" : { "cmd" : [ - "sudo chown postgres:postgres /etc/pgbackrest.conf" + "sudo chown postgres:postgres /etc/pgbackrest/pgbackrest.conf" ], "host" : "pg-standby", "output" : false @@ -8174,7 +9216,7 @@ { "key" : { "cmd" : [ - "sudo sh -c 'cd /root/pgbackrest-release-2.01/libc && \\", + "sudo sh -c 'cd /root/pgbackrest-release-2.02/libc && \\", " perl Makefile.PL INSTALLMAN1DIR=none INSTALLMAN3DIR=none'" ], "host" : "pg-standby", @@ -8185,7 +9227,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/libc test" + "sudo make -C /root/pgbackrest-release-2.02/libc test" ], "host" : "pg-standby", "output" : false @@ -8195,7 +9237,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/libc install" + "sudo make -C /root/pgbackrest-release-2.02/libc install" ], "host" : "pg-standby", "output" : false @@ -8205,7 +9247,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/src" + "sudo make -C /root/pgbackrest-release-2.02/src" ], "host" : "pg-standby", "output" : false @@ -8215,7 +9257,7 @@ { "key" : { "cmd" : [ - "sudo make -C /root/pgbackrest-release-2.01/src install" + "sudo make -C /root/pgbackrest-release-2.02/src install" ], "host" : "pg-standby", "output" : false @@ -8289,7 +9331,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-standby", "option" : { "demo" : { @@ -8301,6 +9343,9 @@ } }, "global" : { + "log-level-file" : { + "value" : "detail" + }, "log-level-stderr" : { "value" : "off" }, @@ -8321,6 +9366,7 @@ "recovery-option=standby_mode=on", "", "[global]", + "log-level-file=detail", "repo1-host=repository" ] } @@ -8436,13 +9482,13 @@ "output" : [ "LOG: could not bind IPv6 socket: Cannot assign requested address", "HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.", - "LOG: database system was interrupted; last known up at 2018-03-20 00:16:53 UTC", + "LOG: database system was interrupted; last known up at 2018-05-06 15:20:15 UTC", "LOG: entering standby mode", "LOG: restored log file \"00000008.history\" from archive", "LOG: incomplete startup packet", - "LOG: restored log file \"000000080000000000000029\" from archive", - "LOG: redo starts at 0/29000028", - "LOG: consistent recovery state reached at 0/29000128", + "LOG: restored log file \"000000080000000000000023\" from archive", + "LOG: redo starts at 0/23000028", + "LOG: consistent recovery state reached at 0/230000F0", "LOG: database system is ready to accept read only connections" ] } @@ -8515,7 +9561,7 @@ "output" : [ " pg_switch_xlog | now ", "----------------+-------------------------------", - " 0/2A0199E0 | 2018-03-20 00:17:28.430251+00", + " 0/24019A60 | 2018-05-06 15:20:56.974643+00", "(1 row)" ] } @@ -8527,10 +9573,212 @@ " select *, current_timestamp from replicated_table\"" ], "highlight" : { - "filter" : false, + "filter" : false, + "filter-context" : 2, + "list" : [ + "Important Data" + ] + }, + "host" : "pg-standby", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + " message | now ", + "----------------+-------------------------------", + " Important Data | 2018-05-06 15:20:59.232628+00", + "(1 row)" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check" + ], + "highlight" : { + "filter" : true, + "filter-context" : 2, + "list" : [ + "all other checks passed" + ] + }, + "host" : "pg-standby", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "P00 INFO: check command begin 2.02: --log-level-console=info --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-host=repository --stanza=demo", + "P00 INFO: switch xlog cannot be performed on the standby, all other checks passed successfully", + "P00 INFO: check command end: completed successfully" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres psql -c \" \\", + " create user replicator password 'jw8s0F4' replication\";" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "CREATE ROLE" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres sh -c 'echo \\", + " \"host replication replicator 172.17.0.5/32 md5\" \\", + " >> /etc/postgresql/9.4/demo/pg_hba.conf'" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo pg_ctlcluster 9.4 demo reload" + ], + "host" : "pg-primary", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "file" : "/etc/pgbackrest/pgbackrest.conf", + "host" : "pg-standby", + "option" : { + "demo" : { + "recovery-option" : { + "value" : "primary_conninfo=host=172.17.0.3 port=5432 user=replicator" + } + } + } + }, + "type" : "cfg-pgbackrest", + "value" : { + "config" : [ + "[demo]", + "pg1-path=/var/lib/postgresql/9.4/demo", + "recovery-option=standby_mode=on", + "recovery-option=primary_conninfo=host=172.17.0.3 port=5432 user=replicator", + "", + "[global]", + "log-level-file=detail", + "repo1-host=repository" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres sh -c 'echo \\", + " \"172.17.0.3:*:replication:replicator:jw8s0F4\" \\", + " >> /home/postgres/.pgpass'" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres chmod 600 /home/postgres/.pgpass" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo pg_ctlcluster 9.4 demo stop" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres pgbackrest --stanza=demo --delta restore" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres cat /var/lib/postgresql/9.4/demo/recovery.conf" + ], + "host" : "pg-standby", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "primary_conninfo = 'host=172.17.0.3 port=5432 user=replicator'", + "standby_mode = 'on'", + "restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo rm /var/log/postgresql/postgresql-9.4-demo.log" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo pg_ctlcluster 9.4 demo start" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres sleep 2" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres cat /var/log/postgresql/postgresql-9.4-demo.log" + ], + "highlight" : { + "filter" : true, "filter-context" : 2, "list" : [ - "Important Data" + "started streaming WAL from primary" ] }, "host" : "pg-standby", @@ -8539,34 +9787,40 @@ "type" : "exe", "value" : { "output" : [ - " message | now ", - "----------------+-------------------------------", - " Important Data | 2018-03-20 00:17:34.988692+00", - "(1 row)" + " [filtered 9 lines of output]", + "LOG: database system is ready to accept read only connections", + "LOG: restored log file \"000000080000000000000024\" from archive", + "LOG: started streaming WAL from primary at 0/25000000 on timeline 8" ] } }, { "key" : { "cmd" : [ - "sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check" + "sudo -u postgres psql -c \" \\", + " begin; \\", + " create table stream_table (message text); \\", + " insert into stream_table values ('Important Data'); \\", + " commit; \\", + " select *, current_timestamp from stream_table\";" ], "highlight" : { "filter" : true, "filter-context" : 2, "list" : [ - "all other checks passed" + "Important Data" ] }, - "host" : "pg-standby", + "host" : "pg-primary", "output" : true }, "type" : "exe", "value" : { "output" : [ - "P00 INFO: check command begin 2.01: --log-level-console=info --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-host=repository --stanza=demo", - "P00 INFO: switch xlog cannot be performed on the standby, all other checks passed successfully", - "P00 INFO: check command end: completed successfully" + " message | now ", + "----------------+------------------------------", + " Important Data | 2018-05-06 15:21:11.41956+00", + "(1 row)" ] } }, @@ -8574,24 +9828,32 @@ "key" : { "cmd" : [ "sudo -u postgres psql -c \" \\", - " create user replicator password 'jw8s0F4' replication\";" + " select *, current_timestamp from stream_table\"" ], - "host" : "pg-primary", + "highlight" : { + "filter" : false, + "filter-context" : 2, + "list" : [ + "Important Data" + ] + }, + "host" : "pg-standby", "output" : true }, "type" : "exe", "value" : { "output" : [ - "CREATE ROLE" + " message | now ", + "----------------+-------------------------------", + " Important Data | 2018-05-06 15:21:11.711161+00", + "(1 row)" ] } }, { "key" : { "cmd" : [ - "sudo -u postgres sh -c 'echo \\", - " \"host replication replicator 172.17.0.5/32 md5\" \\", - " >> /etc/postgresql/9.4/demo/pg_hba.conf'" + "sudo mkdir -m 750 /var/spool/pgbackrest" ], "host" : "pg-primary", "output" : false @@ -8601,44 +9863,17 @@ { "key" : { "cmd" : [ - "sudo pg_ctlcluster 9.4 demo reload" + "sudo chown postgres:postgres /var/spool/pgbackrest" ], "host" : "pg-primary", "output" : false }, "type" : "exe" }, - { - "key" : { - "file" : "/etc/pgbackrest.conf", - "host" : "pg-standby", - "option" : { - "demo" : { - "recovery-option" : { - "value" : "primary_conninfo=host=172.17.0.3 port=5432 user=replicator" - } - } - } - }, - "type" : "cfg-pgbackrest", - "value" : { - "config" : [ - "[demo]", - "pg1-path=/var/lib/postgresql/9.4/demo", - "recovery-option=standby_mode=on", - "recovery-option=primary_conninfo=host=172.17.0.3 port=5432 user=replicator", - "", - "[global]", - "repo1-host=repository" - ] - } - }, { "key" : { "cmd" : [ - "sudo -u postgres sh -c 'echo \\", - " \"172.17.0.3:*:replication:replicator:jw8s0F4\" \\", - " >> /home/postgres/.pgpass'" + "sudo mkdir -m 750 /var/spool/pgbackrest" ], "host" : "pg-standby", "output" : false @@ -8648,7 +9883,7 @@ { "key" : { "cmd" : [ - "sudo -u postgres chmod 600 /home/postgres/.pgpass" + "sudo chown postgres:postgres /var/spool/pgbackrest" ], "host" : "pg-standby", "output" : false @@ -8657,45 +9892,115 @@ }, { "key" : { - "cmd" : [ - "sudo pg_ctlcluster 9.4 demo stop" - ], - "host" : "pg-standby", - "output" : false + "file" : "/etc/pgbackrest/pgbackrest.conf", + "host" : "pg-primary", + "option" : { + "global" : { + "archive-async" : { + "value" : "y" + }, + "spool-path" : { + "value" : "/var/spool/pgbackrest" + } + }, + "global:archive-get" : { + "process-max" : { + "value" : "2" + } + }, + "global:archive-push" : { + "process-max" : { + "value" : "2" + } + } + } }, - "type" : "exe" + "type" : "cfg-pgbackrest", + "value" : { + "config" : [ + "[demo]", + "pg1-path=/var/lib/postgresql/9.4/demo", + "", + "[global]", + "archive-async=y", + "log-level-file=detail", + "repo1-host=repository", + "spool-path=/var/spool/pgbackrest", + "", + "[global:archive-get]", + "process-max=2", + "", + "[global:archive-push]", + "process-max=2" + ] + } }, { "key" : { - "cmd" : [ - "sudo -u postgres pgbackrest --stanza=demo --delta restore" - ], + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-standby", - "output" : false + "option" : { + "global" : { + "archive-async" : { + "value" : "y" + }, + "spool-path" : { + "value" : "/var/spool/pgbackrest" + } + }, + "global:archive-get" : { + "process-max" : { + "value" : "2" + } + }, + "global:archive-push" : { + "process-max" : { + "value" : "2" + } + } + } }, - "type" : "exe" + "type" : "cfg-pgbackrest", + "value" : { + "config" : [ + "[demo]", + "pg1-path=/var/lib/postgresql/9.4/demo", + "recovery-option=standby_mode=on", + "recovery-option=primary_conninfo=host=172.17.0.3 port=5432 user=replicator", + "", + "[global]", + "archive-async=y", + "log-level-file=detail", + "repo1-host=repository", + "spool-path=/var/spool/pgbackrest", + "", + "[global:archive-get]", + "process-max=2", + "", + "[global:archive-push]", + "process-max=2" + ] + } }, { "key" : { "cmd" : [ - "sudo -u postgres cat /var/lib/postgresql/9.4/demo/recovery.conf" + "sudo -u postgres psql -c \"alter user replicator password 'bogus'\"" ], - "host" : "pg-standby", + "host" : "pg-primary", "output" : true }, "type" : "exe", "value" : { "output" : [ - "primary_conninfo = 'host=172.17.0.3 port=5432 user=replicator'", - "standby_mode = 'on'", - "restore_command = 'pgbackrest --stanza=demo archive-get %f \"%p\"'" + "ALTER ROLE" ] } }, { "key" : { "cmd" : [ - "sudo rm /var/log/postgresql/postgresql-9.4-demo.log" + "sudo pg_ctlcluster 9.4 demo restart" ], "host" : "pg-standby", "output" : false @@ -8705,9 +10010,9 @@ { "key" : { "cmd" : [ - "sudo pg_ctlcluster 9.4 demo start" + "sudo -u postgres rm -f /var/log/pgbackrest/demo-archive-push-async.log" ], - "host" : "pg-standby", + "host" : "pg-primary", "output" : false }, "type" : "exe" @@ -8715,9 +10020,14 @@ { "key" : { "cmd" : [ - "sudo -u postgres sleep 2" + "sudo -u postgres psql -c \" \\", + " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", + " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", + " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", + " select pg_create_restore_point('test async push'); select pg_switch_xlog(); \\", + " select pg_create_restore_point('test async push'); select pg_switch_xlog();\"" ], - "host" : "pg-standby", + "host" : "pg-primary", "output" : false }, "type" : "exe" @@ -8725,43 +10035,37 @@ { "key" : { "cmd" : [ - "sudo -u postgres cat /var/log/postgresql/postgresql-9.4-demo.log" + "sudo -u postgres pgbackrest --stanza=demo --log-level-console=info check" ], "highlight" : { "filter" : true, "filter-context" : 2, "list" : [ - "started streaming WAL from primary" + "WAL segment" ] }, - "host" : "pg-standby", + "host" : "pg-primary", "output" : true }, "type" : "exe", "value" : { "output" : [ - " [filtered 9 lines of output]", - "LOG: database system is ready to accept read only connections", - "LOG: restored log file \"00000008000000000000002A\" from archive", - "LOG: started streaming WAL from primary at 0/2B000000 on timeline 8" + "P00 INFO: check command begin 2.02: --log-level-console=info --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --repo1-host=repository --stanza=demo", + "P00 INFO: WAL segment 00000008000000000000002A successfully stored in the archive at '/var/lib/pgbackrest/archive/demo/9.4-1/0000000800000000/00000008000000000000002A-2b54769baadaec580e9b8814868ced3aeef7d951.gz'", + "P00 INFO: check command end: completed successfully" ] } }, { "key" : { "cmd" : [ - "sudo -u postgres psql -c \" \\", - " begin; \\", - " create table stream_table (message text); \\", - " insert into stream_table values ('Important Data'); \\", - " commit; \\", - " select *, current_timestamp from stream_table\";" + "sudo -u postgres cat /var/log/pgbackrest/demo-archive-push-async.log" ], "highlight" : { "filter" : true, "filter-context" : 2, "list" : [ - "Important Data" + " WAL file\\(s\\) to archive|pushed WAL file 0000000" ] }, "host" : "pg-primary", @@ -8770,24 +10074,49 @@ "type" : "exe", "value" : { "output" : [ - " message | now ", - "----------------+-------------------------------", - " Important Data | 2018-03-20 00:17:46.077739+00", - "(1 row)" + "-------------------PROCESS START-------------------", + "P00 INFO: archive-push command begin 2.02: [pg_xlog/000000080000000000000025] --archive-async --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", + "P00 INFO: push 2 WAL file(s) to archive: 000000080000000000000025...000000080000000000000026", + "P01 DETAIL: pushed WAL file 000000080000000000000025 to archive", + "P02 DETAIL: pushed WAL file 000000080000000000000026 to archive", + "P00 INFO: archive-push command end: completed successfully", + "", + "-------------------PROCESS START-------------------", + "P00 INFO: archive-push command begin 2.02: [pg_xlog/000000080000000000000027] --archive-async --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", + "P00 INFO: push 3 WAL file(s) to archive: 000000080000000000000027...000000080000000000000029", + "P01 DETAIL: pushed WAL file 000000080000000000000027 to archive", + "P02 DETAIL: pushed WAL file 000000080000000000000028 to archive", + "P01 DETAIL: pushed WAL file 000000080000000000000029 to archive", + "P00 INFO: archive-push command end: completed successfully", + "", + "-------------------PROCESS START-------------------", + "P00 INFO: archive-push command begin 2.02: [pg_xlog/00000008000000000000002A] --archive-async --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", + "P00 INFO: push 1 WAL file(s) to archive: 00000008000000000000002A", + "P01 DETAIL: pushed WAL file 00000008000000000000002A to archive", + "P00 INFO: archive-push command end: completed successfully" ] } }, { "key" : { "cmd" : [ - "sudo -u postgres psql -c \" \\", - " select *, current_timestamp from stream_table\"" + "sudo -u postgres sleep 5" + ], + "host" : "pg-standby", + "output" : false + }, + "type" : "exe" + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres cat /var/log/pgbackrest/demo-archive-get-async.log" ], "highlight" : { - "filter" : false, + "filter" : true, "filter-context" : 2, "list" : [ - "Important Data" + "got WAL file [0-F]{24} from archive" ] }, "host" : "pg-standby", @@ -8796,16 +10125,54 @@ "type" : "exe", "value" : { "output" : [ - " message | now ", - "----------------+-------------------------------", - " Important Data | 2018-03-20 00:17:46.333002+00", - "(1 row)" + "-------------------PROCESS START-------------------", + "P00 INFO: archive-get command begin 2.02: [000000080000000000000023, 000000080000000000000024, 000000080000000000000025, 000000080000000000000026, 000000080000000000000027, 000000080000000000000028, 000000080000000000000029, 00000008000000000000002A] --archive-async --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", + "P00 INFO: get 8 WAL file(s) from archive: 000000080000000000000023...00000008000000000000002A", + "P01 DETAIL: got WAL file 000000080000000000000023 from archive", + "P02 DETAIL: got WAL file 000000080000000000000024 from archive", + "P01 DETAIL: WAL file 000000080000000000000025 not found in archive", + "P02 DETAIL: WAL file 000000080000000000000026 not found in archive", + " [filtered 33 lines of output]", + "P00 INFO: archive-get command begin 2.02: [000000080000000000000025, 000000080000000000000026, 000000080000000000000027, 000000080000000000000028, 000000080000000000000029, 00000008000000000000002A, 00000008000000000000002B, 00000008000000000000002C] --archive-async --log-level-console=off --log-level-file=detail --log-level-stderr=off --no-log-timestamp --pg1-path=/var/lib/postgresql/9.4/demo --process-max=2 --repo1-host=repository --spool-path=/var/spool/pgbackrest --stanza=demo", + "P00 INFO: get 8 WAL file(s) from archive: 000000080000000000000025...00000008000000000000002C", + "P01 DETAIL: got WAL file 000000080000000000000025 from archive", + "P02 DETAIL: got WAL file 000000080000000000000026 from archive", + "P01 DETAIL: got WAL file 000000080000000000000027 from archive", + "P02 DETAIL: got WAL file 000000080000000000000028 from archive", + "P02 DETAIL: WAL file 00000008000000000000002A not found in archive", + "P02 DETAIL: WAL file 00000008000000000000002B not found in archive", + "P02 DETAIL: WAL file 00000008000000000000002C not found in archive", + "P01 DETAIL: got WAL file 000000080000000000000029 from archive", + "P00 INFO: archive-get command end: completed successfully", + "", + " [filtered 5 lines of output]", + "P02 DETAIL: WAL file 00000008000000000000002D not found in archive", + "P02 DETAIL: WAL file 00000008000000000000002E not found in archive", + "P01 DETAIL: got WAL file 00000008000000000000002A from archive", + "P00 INFO: archive-get command end: completed successfully", + "", + " [filtered 24 lines of output]" + ] + } + }, + { + "key" : { + "cmd" : [ + "sudo -u postgres psql -c \"alter user replicator password 'jw8s0F4'\"" + ], + "host" : "pg-primary", + "output" : true + }, + "type" : "exe", + "value" : { + "output" : [ + "ALTER ROLE" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "repository", "option" : { "demo" : { @@ -8865,17 +10232,21 @@ "value" : { "output" : [ " [filtered 2 lines of output]", - "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-03-20 00:17:47\": backup begins after the requested immediate checkpoint completes", - "P00 INFO: backup start archive = 00000008000000000000002C, lsn = 0/2C0000C8", - "P00 INFO: wait for replay on the standby to reach 0/2C0000C8", - "P00 INFO: replay on the standby reached 0/2C000168", - "P02 INFO: backup file pg-standby:/var/lib/postgresql/9.4/demo/base/12139/12007 (392KB, 20%) checksum bc70f685fbac13fe44177419cd01f86b4fa93165", - "P01 INFO: backup file pg-primary:/var/lib/postgresql/9.4/demo/global/pg_control (8KB, 20%) checksum 3527ba100189801ef33ed2c69c4e960e25065016", - "P02 INFO: backup file pg-standby:/var/lib/postgresql/9.4/demo/base/12139/12010 (232KB, 32%) checksum 7942be329b7fd64c7b84de7c5d9f17cde491c7dd", - "P01 INFO: backup file pg-primary:/var/lib/postgresql/9.4/demo/backup_label (238B, 32%) checksum cacb1ae43120aaae237e7dfeb0b91bb8cf262dc9", - "P02 INFO: backup file pg-standby:/var/lib/postgresql/9.4/demo/base/12139/11891 (128KB, 39%) checksum cd83363e762186bf64d2867a3a7a55b359dbcfbb", - "P02 INFO: backup file pg-standby:/var/lib/postgresql/9.4/demo/base/12139/11892 (88KB, 43%) checksum 48841ee2c6fcee738cf9bcb10d4c93a325fb2fc7", - " [filtered 33 lines of output]" + "P00 INFO: execute exclusive pg_start_backup() with label \"pgBackRest backup started at 2018-05-06 15:21:29\": backup begins after the requested immediate checkpoint completes", + "P00 INFO: backup start archive = 00000008000000000000002C, lsn = 0/2C000028", + "P00 INFO: wait for replay on the standby to reach 0/2C000028", + "P00 INFO: replay on the standby reached 0/2C000348", + "P04 INFO: backup file pg-standby:/var/lib/postgresql/9.4/demo/base/12139/12009 (240KB, 12%) checksum 405f32d2767ec0f4e3357dfa948c9ed2c0c2874b", + "P04 INFO: backup file pg-standby:/var/lib/postgresql/9.4/demo/base/12139/12010 (232KB, 24%) checksum 80452b9a6bdeefb037869efd15bfa5e03b97e965", + " [filtered 11 lines of output]", + "P04 INFO: backup file pg-standby:/var/lib/postgresql/9.4/demo/base/12139/11900_fsm (24KB, 75%) checksum 190512e3d1ba5a439c22abe7fbc6c74d267bf4b2", + "P02 INFO: backup file pg-standby:/var/lib/postgresql/9.4/demo/global/11884 (16KB, 76%) checksum 7b60e09a77005bdaf60a4199e44d526db194a97f", + "P01 INFO: backup file pg-primary:/var/lib/postgresql/9.4/demo/global/pg_control (8KB, 76%) checksum eeb0ac404201f00751e20f242444240a6c3de180", + "P02 INFO: backup file pg-standby:/var/lib/postgresql/9.4/demo/base/12139/11928 (16KB, 77%) checksum 984ba9ffb2732f63c72d00f631ccf68839c91621", + "P01 INFO: backup file pg-primary:/var/lib/postgresql/9.4/demo/backup_label (238B, 77%) checksum b39fd9e1cf56fb9bfbb28905e60fdc254b9a0ddf", + "P02 INFO: backup file pg-standby:/var/lib/postgresql/9.4/demo/base/12139/11927 (16KB, 78%) checksum b704cfc15485a76acdd8606421f6f66aa88948f1", + "P04 INFO: backup file pg-standby:/var/lib/postgresql/9.4/demo/global/11883 (16KB, 78%) checksum a08294d34a3bc32fd18f2eacd730504b06f29018", + " [filtered 19 lines of output]" ] } }, @@ -9040,7 +10411,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-primary", "option" : { "demo" : { @@ -9062,6 +10433,9 @@ "repo1-host=repository", "spool-path=/var/spool/pgbackrest", "", + "[global:archive-get]", + "process-max=2", + "", "[global:archive-push]", "process-max=2" ] @@ -9069,7 +10443,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "pg-standby", "option" : { "demo" : { @@ -9088,13 +10462,22 @@ "recovery-option=primary_conninfo=host=172.17.0.3 port=5432 user=replicator", "", "[global]", - "repo1-host=repository" + "archive-async=y", + "log-level-file=detail", + "repo1-host=repository", + "spool-path=/var/spool/pgbackrest", + "", + "[global:archive-get]", + "process-max=2", + "", + "[global:archive-push]", + "process-max=2" ] } }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "repository", "option" : { "demo" : { @@ -9162,7 +10545,7 @@ "type" : "exe", "value" : { "output" : [ - "P00 INFO: stanza-upgrade command begin 2.01: --no-backup-standby --log-level-console=info --log-level-stderr=off --no-log-timestamp --no-online --pg1-host=pg-primary --pg2-host=pg-standby --pg1-host-user=postgres --pg2-host-user=postgres --pg1-path=/var/lib/postgresql/9.5/demo --pg2-path=/var/lib/postgresql/9.5/demo --repo1-path=/var/lib/pgbackrest --stanza=demo", + "P00 INFO: stanza-upgrade command begin 2.02: --no-backup-standby --log-level-console=info --log-level-stderr=off --no-log-timestamp --no-online --pg1-host=pg-primary --pg2-host=pg-standby --pg1-host-user=postgres --pg2-host-user=postgres --pg1-path=/var/lib/postgresql/9.5/demo --pg2-path=/var/lib/postgresql/9.5/demo --repo1-path=/var/lib/pgbackrest --stanza=demo", "P00 INFO: stanza-upgrade command end: completed successfully" ] } @@ -9320,7 +10703,7 @@ }, { "key" : { - "file" : "/etc/pgbackrest.conf", + "file" : "/etc/pgbackrest/pgbackrest.conf", "host" : "repository", "option" : { "global" : { diff --git a/doc/xml/index.xml b/doc/xml/index.xml index 4dabdfcab..e87f14f45 100644 --- a/doc/xml/index.xml +++ b/doc/xml/index.xml @@ -36,7 +36,7 @@ <p><backrest/> <link url="{[github-url-base]}/releases/tag/release/{[version-stable]}">v{[version-stable]}</link> is the current stable release. Release notes are on the <link page="{[backrest-page-release]}">Releases</link> page.</p> - <p><backrest/> <proper>v1</proper> will receive bugs fixes only until EOL. Documentation for <proper>v1</proper> can be found <link url="{[backrest-url-base]}/1">here</link>.</p> + <p>Documentation for <proper>v1</proper> can be found <link url="{[backrest-url-base]}/1">here</link>. No further releases are planned for <proper>v1</proper> because <proper>v2</proper> is backward-compatible with <proper>v1</proper> options and repositories.</p> </section> <section id="features"> @@ -109,13 +109,15 @@ </section> <section id="parallel-archiving"> - <title>Parallel WAL Archiving</title> + <title>Parallel, Asynchronous WAL Push &amp; Get</title> - <p>Dedicated commands are included for both pushing WAL to the archive and retrieving WAL from the archive.</p> + <p>Dedicated commands are included for pushing WAL to the archive and getting WAL from the archive. Both commands support parallelism to accelerate processing and run asynchronously to provide the fastest possible response time to <postgres/>.</p> - <p>The push command automatically detects WAL segments that are pushed multiple times and de-duplicates when the segment is identical, otherwise an error is raised. The push and get commands both ensure that the database and repository match by comparing <postgres/> versions and system identifiers. This precludes the possibility of misconfiguring the WAL archive location.</p> + <p>WAL push automatically detects WAL segments that are pushed multiple times and de-duplicates when the segment is identical, otherwise an error is raised. Asynchronous WAL push allows transfer to be offloaded to another process which compresses WAL segments in parallel for maximum throughput. This can be a critical feature for databases with extremely high write volume.</p> - <p>Asynchronous archiving allows transfer to be offloaded to another process which compresses WAL segments in parallel for maximum throughput. This can be a critical feature for databases with extremely high write volume.</p> + <p>Asynchronous WAL get maintains a local queue of WAL segments that are decompressed and ready for replay. This reduces the time needed to provide WAL to <postgres/> which maximizes replay speed. Higher-latency connections and storage (such as <proper>S3</proper>) benefit the most.</p> + + <p>The push and get commands both ensure that the database and repository match by comparing <postgres/> versions and system identifiers. This virtually eliminates the possibility of misconfiguring the WAL archive location.</p> </section> <section id="tablespace-link-support"> diff --git a/doc/xml/release.xml b/doc/xml/release.xml index 32eca1dbd..f0991ad80 100644 --- a/doc/xml/release.xml +++ b/doc/xml/release.xml @@ -12,7 +12,7 @@ </intro> <release-list> - <release date="XXXX-XX-XX" version="2.02dev" title="UNDER DEVELOPMENT"> + <release date="2018-05-06" version="2.02" title="Parallel Asynchronous Archive Get and Configuration Includes"> <release-core-list> <release-bug-list> <release-item> @@ -41,7 +41,7 @@ </release-item> <release-item> - <p>Fix delta restore failing when a linked file was missing.</p> + <p>Fix delta restore failing when a linked file is missing.</p> </release-item> <release-item> @@ -76,10 +76,6 @@ </release-feature-list> <release-improvement-list> - <release-item> - <p>Make backup/restore path sync more efficient. Scanning the entire directory can be very expensive if there are a lot of small tables. The backup manifest contains the path list so use it to perform syncs instead of scanning the backup/restore path. Remove recursive path sync functionality since it is no longer used.</p> - </release-item> - <release-item> <release-item-contributor-list> <release-item-contributor id="shang.cynthia"/> @@ -89,11 +85,15 @@ </release-item> <release-item> - <p>Show command parameters as well as command options in initial info message.</p> + <p>Make backup/restore path sync more efficient. Scanning the entire directory can be very expensive if there are a lot of small tables. The backup manifest contains the path list so use it to perform syncs instead of scanning the backup/restore path.</p> + </release-item> + + <release-item> + <p>Show command parameters as well as command options in initial info log message.</p> </release-item> <release-item> - <p>Rename <br-option>archive-queue-max</br-option> option to <br-option>archive-push-queue-max</br-option> to avoid confusion with the <br-option>archive-get-queue-max</br-option> option. The old option name will continue to be accepted.</p> + <p>Rename <br-option>archive-queue-max</br-option> option to <br-option>archive-push-queue-max</br-option> to avoid confusion with the new <br-option>archive-get-queue-max</br-option> option. The old option name will continue to be accepted.</p> </release-item> </release-improvement-list> @@ -111,7 +111,7 @@ </release-item> <release-item> - <p>Storage object improvements. Convert all functions to variadic functions. Enforce read-only storage. Add <code>storageLocalWrite()</code> helper function. Add <code>storageCopy()</code>, <code>storageExists()</code>, <code>storageMove()</code>, <code>storageNewRead()</code>/<code>storageNewWrite()</code>, <code>storagePathCreate()</code>, <code>storagePathRemove()</code>, <code>storagePathSync()</code>, and <code>storageRemove()</code>. Add <code>StorageFileRead</code> and <code>StorageFileWrite</code> objects. Abstract Posix driver code into a separate module. Call <code>storagePathCreate()</code> from the Perl Posix driver.</p> + <p>Storage object improvements. Convert all functions to variadic functions. Enforce read-only storage. Add <code>storageLocalWrite()</code> helper function. Add <code>storageCopy()</code>, <code>storageExists()</code>, <code>storageMove()</code>, <code>storageNewRead()</code>/<code>storageNewWrite()</code>, <code>storagePathCreate()</code>, <code>storagePathRemove()</code>, <code>storagePathSync()</code>, and <code>storageRemove()</code>. Add <code>StorageFileRead</code> and <code>StorageFileWrite</code> objects. Abstract Posix driver code into a separate module. Call <code>storagePathRemove()</code> from the Perl Posix driver.</p> </release-item> <release-item> @@ -168,7 +168,7 @@ </release-item> <release-item> - <p>Split debug and assert code into separate headers. Assert can be used earlier because it only depends on the error-handler and not logging. Add <code>ASSERT()</code> that is preserved in production builds.</p> + <p>Split debug and assert code into separate headers. Assert can be used earlier because it only depends on the error-handler and not logging. Add <code>ASSERT()</code> macro which is preserved in production builds.</p> </release-item> <release-item> @@ -255,7 +255,7 @@ </release-item> <release-item> - <p>Add <code>HARNESS_FORK</code> for tests that require fork(). A standard pattern for tests makes fork() easier to use and should help prevent some common mistakes.</p> + <p>Add <code>HARNESS_FORK</code> macros for tests that require fork(). A standard pattern for tests makes fork() easier to use and should help prevent some common mistakes.</p> </release-item> <release-item> diff --git a/lib/pgBackRest/Version.pm b/lib/pgBackRest/Version.pm index 6b0043869..69accad08 100644 --- a/lib/pgBackRest/Version.pm +++ b/lib/pgBackRest/Version.pm @@ -39,7 +39,7 @@ push @EXPORT, qw(backrestBin backrestBinSet); # Defines the current version of the BackRest executable. The version number is used to track features but does not affect what # repositories or manifests can be read - that's the job of the format number. #----------------------------------------------------------------------------------------------------------------------------------- -use constant BACKREST_VERSION => '2.02dev'; +use constant BACKREST_VERSION => '2.02'; push @EXPORT, qw(BACKREST_VERSION); # Format Format Number diff --git a/libc/lib/pgBackRest/LibCAuto.pm b/libc/lib/pgBackRest/LibCAuto.pm index 55579a779..0c5818b35 100644 --- a/libc/lib/pgBackRest/LibCAuto.pm +++ b/libc/lib/pgBackRest/LibCAuto.pm @@ -6,7 +6,7 @@ package pgBackRest::LibCAuto; # Library version (.999 indicates development version) sub libcAutoVersion { - return '2.02.999'; + return '2.02'; } # Configuration option value constants diff --git a/src/version.h b/src/version.h index 214a96a34..781ddcff2 100644 --- a/src/version.h +++ b/src/version.h @@ -17,6 +17,6 @@ Standard binary name /*********************************************************************************************************************************** Version of the software. Currently this value is maintained in Version.pm and updated by test.pl. ***********************************************************************************************************************************/ -#define PGBACKREST_VERSION "2.02dev" +#define PGBACKREST_VERSION "2.02" #endif diff --git a/test/code-count/file-type.yaml b/test/code-count/file-type.yaml index eecaefbc5..0e53aa665 100644 --- a/test/code-count/file-type.yaml +++ b/test/code-count/file-type.yaml @@ -151,6 +151,14 @@ lib/pgBackRest/Archive/Common.pm: class: core type: perl +lib/pgBackRest/Archive/Get/Async.pm: + class: core + type: perl + +lib/pgBackRest/Archive/Get/File.pm: + class: core + type: perl + lib/pgBackRest/Archive/Get/Get.pm: class: core type: perl @@ -539,6 +547,22 @@ src/cipher/random.h: class: core type: c/h +src/command/archive/common.c: + class: core + type: c + +src/command/archive/common.h: + class: core + type: c/h + +src/command/archive/get/get.c: + class: core + type: c + +src/command/archive/get/get.h: + class: core + type: c/h + src/command/archive/push/push.c: class: core type: c @@ -811,6 +835,14 @@ src/perl/exec.h: class: core type: c/h +src/postgres/info.c: + class: core + type: c + +src/postgres/info.h: + class: core + type: c/h + src/postgres/pageChecksum.c: class: core type: c @@ -819,19 +851,59 @@ src/postgres/pageChecksum.h: class: core type: c/h -src/storage/driver/posix.c: +src/postgres/type.h: + class: core + type: c/h + +src/postgres/version.h: + class: core + type: c/h + +src/storage/driver/posix/driver.c: class: core type: c -src/storage/driver/posix.h: +src/storage/driver/posix/driver.h: class: core type: c/h -src/storage/file.c: +src/storage/driver/posix/driverFile.c: class: core type: c -src/storage/file.h: +src/storage/driver/posix/driverFile.h: + class: core + type: c/h + +src/storage/driver/posix/driverRead.c: + class: core + type: c + +src/storage/driver/posix/driverRead.h: + class: core + type: c/h + +src/storage/driver/posix/driverWrite.c: + class: core + type: c + +src/storage/driver/posix/driverWrite.h: + class: core + type: c/h + +src/storage/fileRead.c: + class: core + type: c + +src/storage/fileRead.h: + class: core + type: c/h + +src/storage/fileWrite.c: + class: core + type: c + +src/storage/fileWrite.h: class: core type: c/h @@ -843,6 +915,10 @@ src/storage/helper.h: class: core type: c/h +src/storage/info.h: + class: core + type: c/h + src/storage/storage.c: class: core type: c @@ -955,15 +1031,15 @@ test/lib/pgBackRestTest/Env/S3EnvTest.pm: class: test/harness type: perl -test/lib/pgBackRestTest/Module/Archive/ArchiveCommonTest.pm: +test/lib/pgBackRestTest/Module/Archive/ArchiveCommonPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Archive/ArchiveGetTest.pm: +test/lib/pgBackRestTest/Module/Archive/ArchiveGetPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Archive/ArchiveInfoUnitTest.pm: +test/lib/pgBackRestTest/Module/Archive/ArchiveInfoUnitPerlTest.pm: class: test/module type: perl @@ -971,11 +1047,11 @@ test/lib/pgBackRestTest/Module/Archive/ArchivePushPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Backup/BackupInfoUnitTest.pm: +test/lib/pgBackRestTest/Module/Backup/BackupInfoUnitPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Backup/BackupUnitTest.pm: +test/lib/pgBackRestTest/Module/Backup/BackupUnitPerlTest.pm: class: test/module type: perl @@ -983,7 +1059,7 @@ test/lib/pgBackRestTest/Module/Common/CommonEncodePerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Common/CommonHttpClientTest.pm: +test/lib/pgBackRestTest/Module/Common/CommonHttpClientPerlTest.pm: class: test/module type: perl @@ -991,7 +1067,7 @@ test/lib/pgBackRestTest/Module/Common/CommonIniPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Common/CommonIoBufferedTest.pm: +test/lib/pgBackRestTest/Module/Common/CommonIoBufferedPerlTest.pm: class: test/module type: perl @@ -999,7 +1075,7 @@ test/lib/pgBackRestTest/Module/Common/CommonIoHandlePerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Common/CommonIoProcessTest.pm: +test/lib/pgBackRestTest/Module/Common/CommonIoProcessPerlTest.pm: class: test/module type: perl @@ -1007,11 +1083,11 @@ test/lib/pgBackRestTest/Module/Common/CommonLogPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Info/InfoUnitTest.pm: +test/lib/pgBackRestTest/Module/Info/InfoUnitPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Manifest/ManifestAllTest.pm: +test/lib/pgBackRestTest/Module/Manifest/ManifestAllPerlTest.pm: class: test/module type: perl @@ -1043,11 +1119,11 @@ test/lib/pgBackRestTest/Module/Performance/PerformanceIoTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Protocol/ProtocolCommonMinionTest.pm: +test/lib/pgBackRestTest/Module/Protocol/ProtocolCommonMinionPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Protocol/ProtocolHelperTest.pm: +test/lib/pgBackRestTest/Module/Protocol/ProtocolHelperPerlTest.pm: class: test/module type: perl @@ -1055,19 +1131,19 @@ test/lib/pgBackRestTest/Module/Real/RealAllTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Stanza/StanzaAllTest.pm: +test/lib/pgBackRestTest/Module/Stanza/StanzaAllPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Storage/StorageFilterCipherBlockTest.pm: +test/lib/pgBackRestTest/Module/Storage/StorageFilterCipherBlockPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Storage/StorageFilterGzipTest.pm: +test/lib/pgBackRestTest/Module/Storage/StorageFilterGzipPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Storage/StorageFilterShaTest.pm: +test/lib/pgBackRestTest/Module/Storage/StorageFilterShaPerlTest.pm: class: test/module type: perl @@ -1075,27 +1151,27 @@ test/lib/pgBackRestTest/Module/Storage/StorageHelperPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Storage/StorageLocalTest.pm: +test/lib/pgBackRestTest/Module/Storage/StorageLocalPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Storage/StoragePosixTest.pm: +test/lib/pgBackRestTest/Module/Storage/StoragePosixPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Storage/StorageS3AuthTest.pm: +test/lib/pgBackRestTest/Module/Storage/StorageS3AuthPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Storage/StorageS3CertTest.pm: +test/lib/pgBackRestTest/Module/Storage/StorageS3CertPerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Storage/StorageS3RequestTest.pm: +test/lib/pgBackRestTest/Module/Storage/StorageS3PerlTest.pm: class: test/module type: perl -test/lib/pgBackRestTest/Module/Storage/StorageS3Test.pm: +test/lib/pgBackRestTest/Module/Storage/StorageS3RequestPerlTest.pm: class: test/module type: perl @@ -1107,6 +1183,10 @@ test/src/common/harnessConfig.h: class: test/harness type: c/h +test/src/common/harnessFork.h: + class: test/harness + type: c/h + test/src/common/harnessTest.c: class: test/harness type: c @@ -1123,6 +1203,14 @@ test/src/common/logTest.h: class: test/harness type: c/h +test/src/module/archive/commonTest.c: + class: test/module + type: c + +test/src/module/archive/getTest.c: + class: test/module + type: c + test/src/module/archive/pushTest.c: class: test/module type: c @@ -1263,6 +1351,10 @@ test/src/module/perl/execTest.c: class: test/module type: c +test/src/module/postgres/infoTest.c: + class: test/module + type: c + test/src/module/postgres/pageChecksumTest.c: class: test/module type: c [parent: 4d6a51ac47e1]