@@ -131,7 +131,6 @@ doc/src/sgml/pgprobackup.sgml
131
131
<arg choice =" plain" ><option >archive-push</option ></arg >
132
132
<arg choice =" plain" ><option >-B</option > <replaceable >backup_dir</replaceable ></arg >
133
133
<arg choice =" plain" ><option >--instance</option > <replaceable >instance_name</replaceable ></arg >
134
- <arg choice =" plain" ><option >--wal-file-path</option > <replaceable >wal_file_path</replaceable ></arg >
135
134
<arg choice =" plain" ><option >--wal-file-name</option > <replaceable >wal_file_name</replaceable ></arg >
136
135
<arg rep =" repeat" ><replaceable >option</replaceable ></arg >
137
136
</cmdsynopsis >
@@ -427,14 +426,6 @@ doc/src/sgml/pgprobackup.sgml
427
426
or <application >libc</application >/<application >libicu</application > versions.
428
427
</para >
429
428
</listitem >
430
- <listitem >
431
- <para >
432
- All backups in the incremental chain must belong to the same
433
- timeline. For example, if you have taken incremental backups on a
434
- standby server that gets promoted, you have to take another FULL
435
- backup.
436
- </para >
437
- </listitem >
438
429
</itemizedlist >
439
430
</para >
440
431
</refsect2 >
@@ -754,9 +745,10 @@ ALTER ROLE backup WITH REPLICATION;
754
745
<title >Setting up Continuous WAL Archiving</title >
755
746
<para >
756
747
Making backups in PAGE backup mode, performing
757
- <link linkend =" pbk-performing-point-in-time-pitr-recovery" >PITR</link >
758
- and making backups with
759
- <link linkend =" pbk-archive-mode" >ARCHIVE</link > WAL delivery mode
748
+ <link linkend =" pbk-performing-point-in-time-pitr-recovery" >PITR</link >,
749
+ making backups with
750
+ <link linkend =" pbk-archive-mode" >ARCHIVE</link > WAL delivery mode and
751
+ running incremental backup after timeline switch
760
752
require
761
753
<ulink url =" https://postgrespro.com/docs/postgresql/current/continuous-archiving.html" >continuous
762
754
WAL archiving</ulink > to be enabled. To set up continuous
@@ -786,7 +778,7 @@ ALTER ROLE backup WITH REPLICATION;
786
778
parameter, as follows:
787
779
</para >
788
780
<programlisting >
789
- archive_command = '<replaceable >install_dir</replaceable >/pg_probackup archive-push -B <replaceable >backup_dir</replaceable > --instance <replaceable >instance_name</replaceable > --wal-file-path=%p --wal-file- name=%f [<replaceable >remote_options</replaceable >]'
781
+ archive_command = '<replaceable >install_dir</replaceable >/pg_probackup archive-push -B <replaceable >backup_dir</replaceable > --instance <replaceable >instance_name</replaceable > --wal-file-name=%f [<replaceable >remote_options</replaceable >]'
790
782
</programlisting >
791
783
</listitem >
792
784
</itemizedlist >
@@ -1634,13 +1626,14 @@ pg_probackup restore -B <replaceable>backup_dir</replaceable> --instance <replac
1634
1626
<para >
1635
1627
If you restore <link linkend =" pbk-archive-mode" >ARCHIVE</link > backups,
1636
1628
perform <link linkend =" pbk-performing-point-in-time-pitr-recovery" >PITR</link >,
1637
- or specify the <literal >--restore-as-replica</literal > option with the
1629
+ or specify the <literal >--restore-as-replica</literal > flag with the
1638
1630
<literal >restore</literal > command to set up a standby server,
1639
1631
<application >pg_probackup</application > creates a recovery configuration
1640
1632
file once all data files are copied into the target directory. This file
1641
1633
includes the minimal settings required for recovery, except for the password in the
1642
1634
<ulink url =" https://postgrespro.com/docs/postgresql/current/runtime-config-replication.html#GUC-PRIMARY-CONNINFO" >primary_conninfo</ulink >
1643
- parameter; you have to add the password manually, if required.
1635
+ parameter; you have to add the password manually or use
1636
+ the <literal >--primary-conninfo</literal > option, if required.
1644
1637
For <productname >PostgreSQL</productname > 11 or lower,
1645
1638
recovery settings are written into the <filename >recovery.conf</filename >
1646
1639
file. Starting from <productname >PostgreSQL</productname > 12,
@@ -2242,6 +2235,13 @@ BACKUP INSTANCE 'node'
2242
2235
<literal >MERGING</literal > — the backup is being merged.
2243
2236
</para >
2244
2237
</listitem >
2238
+ <listitem >
2239
+ <para >
2240
+ <literal >MERGED</literal > — the backup data files were
2241
+ successfully merged, but its metadata is in the process
2242
+ of been updated. Only full backup can have this status.
2243
+ </para >
2244
+ </listitem >
2245
2245
<listitem >
2246
2246
<para >
2247
2247
<literal >DELETING</literal > — the backup files are being deleted.
@@ -3146,7 +3146,9 @@ pg_probackup merge -B <replaceable>backup_dir</replaceable> --instance <replacea
3146
3146
<para >
3147
3147
This command merges the specified incremental backup to its
3148
3148
parent full backup, together with all incremental backups
3149
- between them. Once the merge is complete, the incremental
3149
+ between them. If the specified backup ID belong to the full backup,
3150
+ then it will be merged with the closest incremental backup.
3151
+ Once the merge is complete, the incremental
3150
3152
backups are removed as redundant. Thus, the merge operation is
3151
3153
virtually equivalent to retaking a full backup and removing all
3152
3154
the outdated backups, but it allows to save much time,
@@ -3165,7 +3167,8 @@ pg_probackup show -B <replaceable>backup_dir</replaceable> --instance <replaceab
3165
3167
</programlisting >
3166
3168
<para >
3167
3169
If the merge is still in progress, the backup status is
3168
- displayed as <literal >MERGING</literal >. The merge is idempotent, so you can
3170
+ displayed as <literal >MERGING</literal > or, at the final stage,
3171
+ <literal >MERGED</literal >. The merge is idempotent, so you can
3169
3172
restart the merge if it was interrupted.
3170
3173
</para >
3171
3174
</refsect2 >
@@ -3404,6 +3407,7 @@ pg_probackup backup -B <replaceable>backup_dir</replaceable> -b <replaceable>bac
3404
3407
[--no-validate] [--skip-block-validation]
3405
3408
[-w --no-password] [-W --password]
3406
3409
[--archive-timeout=<replaceable >timeout</replaceable >] [--external-dirs=<replaceable >external_directory_path</replaceable >]
3410
+ [--no-sync]
3407
3411
[<replaceable >connection_options</replaceable >] [<replaceable >compression_options</replaceable >] [<replaceable >remote_options</replaceable >]
3408
3412
[<replaceable >retention_options</replaceable >] [<replaceable >pinning_options</replaceable >] [<replaceable >logging_options</replaceable >]
3409
3413
</programlisting >
@@ -3556,6 +3560,18 @@ pg_probackup backup -B <replaceable>backup_dir</replaceable> -b <replaceable>bac
3556
3560
</para >
3557
3561
</listitem >
3558
3562
</varlistentry >
3563
+
3564
+ <varlistentry >
3565
+ <term ><option >--no-sync</option ></term >
3566
+ <listitem >
3567
+ <para >
3568
+ Do not sync backed up files to disk. You can use this flag to speed
3569
+ up backup process. Using this flag can result in data
3570
+ corruption in case of operating system or hardware crash.
3571
+ Corruption can be detected by backup validation.
3572
+ </para >
3573
+ </listitem >
3574
+ </varlistentry >
3559
3575
</variablelist >
3560
3576
</para >
3561
3577
@@ -3582,8 +3598,11 @@ pg_probackup restore -B <replaceable>backup_dir</replaceable> --instance <replac
3582
3598
[--help] [-D <replaceable >data_dir</replaceable >] [-i <replaceable >backup_id</replaceable >]
3583
3599
[-j <replaceable >num_threads</replaceable >] [--progress]
3584
3600
[-T <replaceable >OLDDIR</replaceable >=<replaceable >NEWDIR</replaceable >] [--external-mapping=<replaceable >OLDDIR</replaceable >=<replaceable >NEWDIR</replaceable >] [--skip-external-dirs]
3585
- [-R | --restore-as-replica] [--no-validate] [--skip-block-validation] [--force]
3601
+ [-R | --restore-as-replica] [--no-validate] [--skip-block-validation]
3602
+ [--force] [--no-sync]
3586
3603
[--restore-command=<replaceable >cmdline</replaceable >]
3604
+ [--primary-conninfo=<replaceable >primary_conninfo</replaceable >]
3605
+ [-S | --primary-slot-name=<replaceable >slotname</replaceable >]
3587
3606
[<replaceable >recovery_target_options</replaceable >] [<replaceable >logging_options</replaceable >] [<replaceable >remote_options</replaceable >]
3588
3607
[<replaceable >partial_restore_options</replaceable >] [<replaceable >remote_wal_archive_options</replaceable >]
3589
3608
</programlisting >
@@ -3621,6 +3640,34 @@ pg_probackup restore -B <replaceable>backup_dir</replaceable> --instance <replac
3621
3640
</listitem >
3622
3641
</varlistentry >
3623
3642
3643
+ <varlistentry >
3644
+ <term ><option >--primary-conninfo=<replaceable >primary_conninfo</replaceable ></option ></term >
3645
+ <listitem >
3646
+ <para >
3647
+ Sets the
3648
+ <ulink url =" https://postgrespro.com/docs/postgresql/current/runtime-config-replication.html#GUC-PRIMARY-CONNINFO" >primary_conninfo</ulink >
3649
+ parameter to the specified value.
3650
+ This option will be ignored unless the <option >-R</option > flag if specified.
3651
+ </para >
3652
+ <para >
3653
+ Example: <literal >--primary-conninfo='host=192.168.1.50 port=5432 user=foo password=foopass'</literal >
3654
+ </para >
3655
+ </listitem >
3656
+ </varlistentry >
3657
+
3658
+ <varlistentry >
3659
+ <term ><option >-S</option ></term >
3660
+ <term ><option >--primary-slot-name=<replaceable >slot_name</replaceable ></option ></term >
3661
+ <listitem >
3662
+ <para >
3663
+ Sets the
3664
+ <ulink url =" https://postgrespro.com/docs/postgresql/current/runtime-config-replication#GUC-PRIMARY-SLOT-NAME" >primary_slot_name</ulink >
3665
+ parameter to the specified value.
3666
+ This option will be ignored unless the <option >-R</option > flag if specified.
3667
+ </para >
3668
+ </listitem >
3669
+ </varlistentry >
3670
+
3624
3671
<varlistentry >
3625
3672
<term ><option >-T <replaceable >OLDDIR</replaceable >=<replaceable >NEWDIR</replaceable ></option ></term >
3626
3673
<term ><option >--tablespace-mapping=<replaceable >OLDDIR</replaceable >=<replaceable >NEWDIR</replaceable ></option ></term >
@@ -3705,6 +3752,17 @@ pg_probackup restore -B <replaceable>backup_dir</replaceable> --instance <replac
3705
3752
</para >
3706
3753
</listitem >
3707
3754
</varlistentry >
3755
+
3756
+ <varlistentry >
3757
+ <term ><option >--no-sync</option ></term >
3758
+ <listitem >
3759
+ <para >
3760
+ Do not sync restored files to disk. You can use this flag to speed
3761
+ up restore process. Using this flag can result in data
3762
+ corruption in case of operating system or hardware crash.
3763
+ </para >
3764
+ </listitem >
3765
+ </varlistentry >
3708
3766
</variablelist >
3709
3767
</para >
3710
3768
<para >
@@ -3831,7 +3889,9 @@ pg_probackup merge -B <replaceable>backup_dir</replaceable> --instance <replacea
3831
3889
<para >
3832
3890
Merges the specified incremental backup to its parent full
3833
3891
backup, together with all incremental backups between them, if
3834
- any. As a result, the full backup takes in all the merged
3892
+ any. If the specified backup ID belong to the full backup,
3893
+ then it will be merged with the closest incremental backup.
3894
+ As a result, the full backup takes in all the merged
3835
3895
data, and the incremental backups are removed as redundant.
3836
3896
</para >
3837
3897
<para >
@@ -3866,9 +3926,12 @@ pg_probackup delete -B <replaceable>backup_dir</replaceable> --instance <replace
3866
3926
<title >archive-push</title >
3867
3927
<programlisting >
3868
3928
pg_probackup archive-push -B <replaceable >backup_dir</replaceable > --instance <replaceable >instance_name</replaceable >
3869
- --wal-file-path=<replaceable >wal_file_path</replaceable > --wal-file-name=<replaceable >wal_file_name</replaceable >
3870
- [--help] [--compress] [--compress-algorithm=<replaceable >compression_algorithm</replaceable >]
3871
- [--compress-level=<replaceable >compression_level</replaceable >] [--overwrite]
3929
+ --wal-file-name=<replaceable >wal_file_name</replaceable >
3930
+ [--help] [--no-sync] [--compress] [--no-ready-rename] [--overwrite]
3931
+ [-j <replaceable >num_threads</replaceable >] [--batch-size=<replaceable >batch_size</replaceable >]
3932
+ [--archive-timeout=<replaceable >timeout</replaceable >]
3933
+ [--compress-algorithm=<replaceable >compression_algorithm</replaceable >]
3934
+ [--compress-level=<replaceable >compression_level</replaceable >]
3872
3935
[<replaceable >remote_options</replaceable >] [<replaceable >logging_options</replaceable >]
3873
3936
</programlisting >
3874
3937
<para >
@@ -3893,13 +3956,24 @@ pg_probackup archive-push -B <replaceable>backup_dir</replaceable> --instance <r
3893
3956
with the <option >--overwrite</option > flag.
3894
3957
</para >
3895
3958
<para >
3896
- The files are copied to a temporary file with the
3897
- <literal >.part</literal > suffix. After the copy is
3898
- done, atomic rename is performed. This algorithm ensures that a
3899
- failed <command >archive-push</command > will not stall continuous archiving and
3900
- that concurrent archiving from multiple sources into a single
3901
- WAL archive have no risk of archive corruption. WAL segments copied to
3902
- the archive are synced to disk.
3959
+ Every file is copied to a temporary file with the
3960
+ <literal >.part</literal > suffix. If the temporary file already
3961
+ exists, <application >pg_probackup</application > will wait
3962
+ <option >archive_timeout</option > seconds before discarding it.
3963
+ After the copy is done, atomic rename is performed.
3964
+ This algorithm ensures that a failed <command >archive-push</command >
3965
+ will not stall continuous archiving and that concurrent archiving from
3966
+ multiple sources into a single WAL archive have no risk of archive
3967
+ corruption.
3968
+ </para >
3969
+ <para >
3970
+ To speed up archiving, especially in remote mode, <command >archive-push</command >
3971
+ can be run on multiple threads using <option >-j num_threads</option > option.
3972
+ Files can also be copied in batches using option <option >--batch-size</option >.
3973
+ </para >
3974
+ <para >
3975
+ WAL segments copied to the archive are synced to disk unless
3976
+ <option >--no-sync</option > flag is used.
3903
3977
</para >
3904
3978
<para >
3905
3979
You can use <command >archive-push</command > in the
@@ -4005,7 +4079,8 @@ pg_probackup archive-get -B <replaceable>backup_dir</replaceable> --instance <re
4005
4079
<para >
4006
4080
Sets the number of parallel threads for <command >backup</command >,
4007
4081
<command >restore</command >, <command >merge</command >,
4008
- <command >validate</command >, and <command >checkdb</command > processes.
4082
+ <command >validate</command >, <command >checkdb</command > and
4083
+ <command >archive-push</command > processes.
4009
4084
</para >
4010
4085
</listitem >
4011
4086
</varlistentry >
@@ -4664,6 +4739,48 @@ pg_probackup archive-get -B <replaceable>backup_dir</replaceable> --instance <re
4664
4739
</para >
4665
4740
</listitem >
4666
4741
</varlistentry >
4742
+
4743
+ <varlistentry >
4744
+ <term ><option >--batch-size=batch_size</option ></term >
4745
+ <listitem >
4746
+ <para >
4747
+ Sets the maximum number of files to be copied into archive by signle
4748
+ <command >archive-push</command > process.
4749
+ </para >
4750
+ </listitem >
4751
+ </varlistentry >
4752
+
4753
+ <varlistentry >
4754
+ <term ><option >--archive-timeout=<replaceable >wait_time</replaceable ></option ></term >
4755
+ <listitem >
4756
+ <para >
4757
+ Sets the timeout for considering existing <literal >.part</literal > file to be stale. By default <application >pg_probackup</application > waits 300 seconds.
4758
+ </para >
4759
+ </listitem >
4760
+ </varlistentry >
4761
+
4762
+ <varlistentry >
4763
+ <term ><option >--no-ready-rename</option ></term >
4764
+ <listitem >
4765
+ <para >
4766
+ Do not rename status files in <literal >archive_status</literal > directory.
4767
+ This option should be used only if <parameter >archive_command</parameter >
4768
+ contain multiple commands.
4769
+ </para >
4770
+ </listitem >
4771
+ </varlistentry >
4772
+
4773
+ <varlistentry >
4774
+ <term ><option >--no-sync</option ></term >
4775
+ <listitem >
4776
+ <para >
4777
+ Do not sync copied WAL files to disk. You can use this flag to speed
4778
+ up archiving process. Using this flag can result in WAL archive
4779
+ corruption in case of operating system or hardware crash.
4780
+ </para >
4781
+ </listitem >
4782
+ </varlistentry >
4783
+
4667
4784
</variablelist >
4668
4785
</para >
4669
4786
</refsect3 >
0 commit comments