Skip to content

Commit f1b30e5

Browse files
committed
Merge branch 'master' into release_2_5
2 parents 3836509 + 8c0badc commit f1b30e5

37 files changed

+1379
-359
lines changed

.gitignore

+1-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434

3535
# Extra files
3636
/src/pg_crc.c
37-
/src/datapagemap.c
38-
/src/datapagemap.h
39-
/src/logging.h
4037
/src/receivelog.c
4138
/src/receivelog.h
4239
/src/streamutil.c
@@ -59,3 +56,4 @@
5956

6057
# Misc
6158
.python-version
59+
.vscode

Makefile

+37-63
Original file line numberDiff line numberDiff line change
@@ -7,102 +7,76 @@ OBJS = src/utils/configuration.o src/utils/json.o src/utils/logger.o \
77
OBJS += src/archive.o src/backup.o src/catalog.o src/checkdb.o src/configure.o src/data.o \
88
src/delete.o src/dir.o src/fetch.o src/help.o src/init.o src/merge.o \
99
src/parsexlog.o src/ptrack.o src/pg_probackup.o src/restore.o src/show.o src/util.o \
10-
src/validate.o
10+
src/validate.o src/datapagemap.o
1111

1212
# borrowed files
13-
OBJS += src/pg_crc.o src/datapagemap.o src/receivelog.o src/streamutil.o \
13+
OBJS += src/pg_crc.o src/receivelog.o src/streamutil.o \
1414
src/xlogreader.o
1515

16-
EXTRA_CLEAN = src/pg_crc.c src/datapagemap.c src/datapagemap.h \
16+
EXTRA_CLEAN = src/pg_crc.c \
1717
src/receivelog.c src/receivelog.h src/streamutil.c src/streamutil.h \
1818
src/xlogreader.c src/instr_time.h
1919

20-
INCLUDES = src/datapagemap.h src/streamutil.h src/receivelog.h src/instr_time.h
20+
ifdef top_srcdir
21+
srchome := $(abspath $(top_srcdir))
22+
else
23+
top_srcdir=../..
24+
ifneq (,$(wildcard ../../../contrib/pg_probackup))
25+
# separate build directory support
26+
srchome := $(abspath $(top_srcdir)/..)
27+
else
28+
srchome := $(abspath $(top_srcdir))
29+
endif
30+
endif
31+
32+
# OBJS variable must be finally defined before invoking the include directive
33+
ifneq (,$(wildcard $(srchome)/src/bin/pg_basebackup/walmethods.c))
34+
OBJS += src/walmethods.o
35+
EXTRA_CLEAN += src/walmethods.c src/walmethods.h
36+
endif
2137

2238
ifdef USE_PGXS
2339
PG_CONFIG = pg_config
2440
PGXS := $(shell $(PG_CONFIG) --pgxs)
2541
include $(PGXS)
26-
# !USE_PGXS
2742
else
2843
subdir=contrib/pg_probackup
2944
top_builddir=../..
3045
include $(top_builddir)/src/Makefile.global
3146
include $(top_srcdir)/contrib/contrib-global.mk
32-
endif # USE_PGXS
33-
34-
ifeq ($(top_srcdir),../..)
35-
ifeq ($(LN_S),ln -s)
36-
srchome=$(top_srcdir)/..
37-
endif
38-
else
39-
srchome=$(top_srcdir)
40-
endif
41-
42-
#ifneq (,$(filter 9.5 9.6 10 11,$(MAJORVERSION)))
43-
ifneq (12,$(MAJORVERSION))
44-
EXTRA_CLEAN += src/logging.h
45-
INCLUDES += src/logging.h
46-
endif
47-
48-
ifeq (,$(filter 9.5 9.6,$(MAJORVERSION)))
49-
OBJS += src/walmethods.o
50-
EXTRA_CLEAN += src/walmethods.c src/walmethods.h
51-
INCLUDES += src/walmethods.h
5247
endif
5348

54-
55-
PG_CPPFLAGS = -I$(libpq_srcdir) ${PTHREAD_CFLAGS} -Isrc -I$(top_srcdir)/$(subdir)/src
49+
PG_CPPFLAGS = -I$(libpq_srcdir) ${PTHREAD_CFLAGS} -Isrc -I$(srchome)/$(subdir)/src
5650
override CPPFLAGS := -DFRONTEND $(CPPFLAGS) $(PG_CPPFLAGS)
5751
PG_LIBS_INTERNAL = $(libpq_pgport) ${PTHREAD_CFLAGS}
5852

59-
all: checksrcdir $(INCLUDES);
53+
src/utils/configuration.o: src/datapagemap.h
54+
src/archive.o: src/instr_time.h
55+
src/backup.o: src/receivelog.h src/streamutil.h
6056

61-
$(PROGRAM): $(OBJS)
62-
63-
src/instr_time.h: $(top_srcdir)/src/include/portability/instr_time.h
57+
src/instr_time.h: $(srchome)/src/include/portability/instr_time.h
6458
rm -f $@ && $(LN_S) $(srchome)/src/include/portability/instr_time.h $@
65-
src/datapagemap.c: $(top_srcdir)/src/bin/pg_rewind/datapagemap.c
66-
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_rewind/datapagemap.c $@
67-
src/datapagemap.h: $(top_srcdir)/src/bin/pg_rewind/datapagemap.h
68-
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_rewind/datapagemap.h $@
69-
src/pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c
59+
src/pg_crc.c: $(srchome)/src/backend/utils/hash/pg_crc.c
7060
rm -f $@ && $(LN_S) $(srchome)/src/backend/utils/hash/pg_crc.c $@
71-
src/receivelog.c: $(top_srcdir)/src/bin/pg_basebackup/receivelog.c
61+
src/receivelog.c: $(srchome)/src/bin/pg_basebackup/receivelog.c
7262
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/receivelog.c $@
73-
src/receivelog.h: $(top_srcdir)/src/bin/pg_basebackup/receivelog.h
63+
ifneq (,$(wildcard $(srchome)/src/bin/pg_basebackup/walmethods.c))
64+
src/receivelog.h: src/walmethods.h $(srchome)/src/bin/pg_basebackup/receivelog.h
65+
else
66+
src/receivelog.h: $(srchome)/src/bin/pg_basebackup/receivelog.h
67+
endif
7468
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/receivelog.h $@
75-
src/streamutil.c: $(top_srcdir)/src/bin/pg_basebackup/streamutil.c
69+
src/streamutil.c: $(srchome)/src/bin/pg_basebackup/streamutil.c
7670
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/streamutil.c $@
77-
src/streamutil.h: $(top_srcdir)/src/bin/pg_basebackup/streamutil.h
71+
src/streamutil.h: $(srchome)/src/bin/pg_basebackup/streamutil.h
7872
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/streamutil.h $@
79-
src/xlogreader.c: $(top_srcdir)/src/backend/access/transam/xlogreader.c
73+
src/xlogreader.c: $(srchome)/src/backend/access/transam/xlogreader.c
8074
rm -f $@ && $(LN_S) $(srchome)/src/backend/access/transam/xlogreader.c $@
81-
82-
#ifneq (,$(filter 9.5 9.6 10 11,$(MAJORVERSION)))
83-
ifneq (12,$(MAJORVERSION))
84-
src/logging.h: $(top_srcdir)/src/bin/pg_rewind/logging.h
85-
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_rewind/logging.h $@
86-
endif
87-
88-
ifeq (,$(filter 9.5 9.6,$(MAJORVERSION)))
89-
src/walmethods.c: $(top_srcdir)/src/bin/pg_basebackup/walmethods.c
75+
src/walmethods.c: $(srchome)/src/bin/pg_basebackup/walmethods.c
9076
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/walmethods.c $@
91-
src/walmethods.h: $(top_srcdir)/src/bin/pg_basebackup/walmethods.h
77+
src/walmethods.h: $(srchome)/src/bin/pg_basebackup/walmethods.h
9278
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/walmethods.h $@
93-
endif
9479

9580
ifeq ($(PORTNAME), aix)
9681
CC=xlc_r
9782
endif
98-
99-
# This rule's only purpose is to give the user instructions on how to pass
100-
# the path to PostgreSQL source tree to the makefile.
101-
.PHONY: checksrcdir
102-
checksrcdir:
103-
ifndef top_srcdir
104-
@echo "You must have PostgreSQL source tree available to compile."
105-
@echo "Pass the path to the PostgreSQL source tree to make, in the top_srcdir"
106-
@echo "variable: \"make top_srcdir=<path to PostgreSQL source tree>\""
107-
@exit 1
108-
endif

README.md

+22-23
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
`pg_probackup` is a utility to manage backup and recovery of PostgreSQL database clusters. It is designed to perform periodic backups of the PostgreSQL instance that enable you to restore the server in case of a failure.
77

88
The utility is compatible with:
9-
* PostgreSQL 9.5, 9.6, 10, 11, 12;
9+
* PostgreSQL 9.5, 9.6, 10, 11, 12, 13;
1010

1111
As compared to other backup solutions, `pg_probackup` offers the following benefits that can help you implement different backup strategies and deal with large amounts of data:
1212
* Incremental backup: page-level incremental backup allows you to save disk space, speed up backup and restore. With three different incremental modes, you can plan the backup strategy in accordance with your data flow.
@@ -41,8 +41,7 @@ Regardless of the chosen backup type, all backups taken with `pg_probackup` supp
4141
## ptrack support
4242

4343
`PTRACK` backup support provided via following options:
44-
* vanilla PostgreSQL compiled with ptrack patch. Currently there are patches for [PostgreSQL 9.6](https://gist.githubusercontent.com/gsmol/5b615c971dfd461c76ef41a118ff4d97/raw/e471251983f14e980041f43bea7709b8246f4178/ptrack_9.6.6_v1.5.patch) and [PostgreSQL 10](https://gist.githubusercontent.com/gsmol/be8ee2a132b88463821021fd910d960e/raw/de24f9499f4f314a4a3e5fae5ed4edb945964df8/ptrack_10.1_v1.5.patch)
45-
* vanilla PostgreSQL 12 with [ptrack extension](https://github.com/postgrespro/ptrack)
44+
* vanilla PostgreSQL 12,13 with [ptrack extension](https://github.com/postgrespro/ptrack)
4645
* Postgres Pro Standard 9.6, 10, 11, 12
4746
* Postgres Pro Enterprise 9.6, 10, 11, 12
4847

@@ -59,65 +58,65 @@ Documentation can be found at [github](https://postgrespro.github.io/pg_probacku
5958

6059
## Installation and Setup
6160
### Windows Installation
62-
Installers are available in release **assets**. [Latests](https://github.com/postgrespro/pg_probackup/releases/2.4.1).
61+
Installers are available in release **assets**. [Latests](https://github.com/postgrespro/pg_probackup/releases/2.4.4).
6362

6463
### Linux Installation
6564
#### pg_probackup for vanilla PostgreSQL
6665
```shell
6766
#DEB Ubuntu|Debian Packages
6867
sudo echo "deb [arch=amd64] https://repo.postgrespro.ru/pg_probackup/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" > /etc/apt/sources.list.d/pg_probackup.list
6968
sudo wget -O - https://repo.postgrespro.ru/pg_probackup/keys/GPG-KEY-PG_PROBACKUP | sudo apt-key add - && sudo apt-get update
70-
sudo apt-get install pg-probackup-{12,11,10,9.6,9.5}
71-
sudo apt-get install pg-probackup-{12,11,10,9.6,9.5}-dbg
69+
sudo apt-get install pg-probackup-{13,12,11,10,9.6,9.5}
70+
sudo apt-get install pg-probackup-{13,12,11,10,9.6,9.5}-dbg
7271

7372
#DEB-SRC Packages
7473
sudo echo "deb-src [arch=amd64] https://repo.postgrespro.ru/pg_probackup/deb/ $(lsb_release -cs) main-$(lsb_release -cs)" >>\
7574
/etc/apt/sources.list.d/pg_probackup.list && sudo apt-get update
76-
sudo apt-get source pg-probackup-{12,11,10,9.6,9.5}
75+
sudo apt-get source pg-probackup-{13,12,11,10,9.6,9.5}
7776

7877
#RPM Centos Packages
7978
rpm -ivh https://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-centos.noarch.rpm
80-
yum install pg_probackup-{12,11,10,9.6,9.5}
81-
yum install pg_probackup-{12,11,10,9.6,9.5}-debuginfo
79+
yum install pg_probackup-{13,12,11,10,9.6,9.5}
80+
yum install pg_probackup-{13,12,11,10,9.6,9.5}-debuginfo
8281

8382
#RPM RHEL Packages
8483
rpm -ivh https://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-rhel.noarch.rpm
85-
yum install pg_probackup-{12,11,10,9.6,9.5}
86-
yum install pg_probackup-{12,11,10,9.6,9.5}-debuginfo
84+
yum install pg_probackup-{13,12,11,10,9.6,9.5}
85+
yum install pg_probackup-{13,12,11,10,9.6,9.5}-debuginfo
8786

8887
#RPM Oracle Linux Packages
8988
rpm -ivh https://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-oraclelinux.noarch.rpm
90-
yum install pg_probackup-{12,11,10,9.6,9.5}
91-
yum install pg_probackup-{12,11,10,9.6,9.5}-debuginfo
89+
yum install pg_probackup-{13,12,11,10,9.6,9.5}
90+
yum install pg_probackup-{13,12,11,10,9.6,9.5}-debuginfo
9291

9392
#SRPM Centos|RHEL|OracleLinux Packages
94-
yumdownloader --source pg_probackup-{12,11,10,9.6,9.5}
93+
yumdownloader --source pg_probackup-{13,12,11,10,9.6,9.5}
9594

9695
#RPM SUSE|SLES Packages
9796
zypper install --allow-unsigned-rpm -y https://repo.postgrespro.ru/pg_probackup/keys/pg_probackup-repo-suse.noarch.rpm
98-
zypper --gpg-auto-import-keys install -y pg_probackup-{12,11,10,9.6,9.5}
99-
zypper install pg_probackup-{12,11,10,9.6,9.5}-debuginfo
97+
zypper --gpg-auto-import-keys install -y pg_probackup-{13,12,11,10,9.6,9.5}
98+
zypper install pg_probackup-{13,12,11,10,9.6,9.5}-debuginfo
10099

101100
#SRPM SUSE|SLES Packages
102-
zypper si pg_probackup-{12,11,10,9.6,9.5}
101+
zypper si pg_probackup-{13,12,11,10,9.6,9.5}
103102

104103
#RPM ALT Linux 7
105104
sudo echo "rpm https://repo.postgrespro.ru/pg_probackup/rpm/latest/altlinux-p7 x86_64 vanilla" > /etc/apt/sources.list.d/pg_probackup.list
106105
sudo apt-get update
107-
sudo apt-get install pg_probackup-{12,11,10,9.6,9.5}
108-
sudo apt-get install pg_probackup-{12,11,10,9.6,9.5}-debuginfo
106+
sudo apt-get install pg_probackup-{13,12,11,10,9.6,9.5}
107+
sudo apt-get install pg_probackup-{13,12,11,10,9.6,9.5}-debuginfo
109108

110109
#RPM ALT Linux 8
111110
sudo echo "rpm https://repo.postgrespro.ru/pg_probackup/rpm/latest/altlinux-p8 x86_64 vanilla" > /etc/apt/sources.list.d/pg_probackup.list
112111
sudo apt-get update
113-
sudo apt-get install pg_probackup-{12,11,10,9.6,9.5}
114-
sudo apt-get install pg_probackup-{12,11,10,9.6,9.5}-debuginfo
112+
sudo apt-get install pg_probackup-{13,12,11,10,9.6,9.5}
113+
sudo apt-get install pg_probackup-{13,12,11,10,9.6,9.5}-debuginfo
115114

116115
#RPM ALT Linux 9
117116
sudo echo "rpm https://repo.postgrespro.ru/pg_probackup/rpm/latest/altlinux-p9 x86_64 vanilla" > /etc/apt/sources.list.d/pg_probackup.list
118117
sudo apt-get update
119-
sudo apt-get install pg_probackup-{12,11,10,9.6,9.5}
120-
sudo apt-get install pg_probackup-{12,11,10,9.6,9.5}-debuginfo
118+
sudo apt-get install pg_probackup-{13,12,11,10,9.6,9.5}
119+
sudo apt-get install pg_probackup-{13,12,11,10,9.6,9.5}-debuginfo
121120
```
122121

123122
#### pg_probackup for PostgresPro Standard and Enterprise

doc/pgprobackup.xml

+11-3
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ doc/src/sgml/pgprobackup.sgml
399399
</listitem>
400400
<listitem>
401401
<para>
402-
On Unix systems, for <productname>PostgreSQL</productname> 10 or higher,
402+
On Unix systems, for <productname>PostgreSQL</productname> 10 or lower,
403403
a backup can be made only by the same OS user that has started the <productname>PostgreSQL</productname>
404404
server. For example, if <productname>PostgreSQL</productname> server is started by
405405
user <literal>postgres</literal>, the <literal>backup</literal> command must also be run
@@ -1161,14 +1161,22 @@ GRANT SELECT ON TABLE pg_catalog.pg_database TO backup;
11611161
PostgreSQL. Links to PTRACK patches can be found
11621162
<ulink url="https://github.com/postgrespro/pg_probackup#ptrack-support">here</ulink>.
11631163
</para>
1164+
<note>
1165+
<para>
1166+
PTRACK versions lower than 2.0 are deprecated. Postgres Pro Standard and Postgres Pro Enterprise
1167+
versions starting with 11.9.1 contain PTRACK 2.0. Upgrade your server to avoid issues in backups
1168+
that you will take in future and be sure to take fresh backups of your clusters with the upgraded
1169+
PTRACK since the backups taken with PTRACK 1.x might be corrupt.
1170+
</para>
1171+
</note>
11641172
<para>
11651173
If you are going to use PTRACK backups, complete the following
11661174
additional steps. The role that will perform PTRACK backups
11671175
(the <literal>backup</literal> role in the examples below) must have
11681176
access to all the databases of the cluster.
11691177
</para>
11701178
<para>
1171-
For <productname>PostgreSQL</productname> 12 or higher:
1179+
For <productname>PostgreSQL</productname> 11 or higher:
11721180
</para>
11731181
<orderedlist>
11741182
<listitem>
@@ -1226,7 +1234,7 @@ GRANT EXECUTE ON FUNCTION pg_ptrack_get_block(oid, oid, oid, bigint) TO backup;
12261234
For older <productname>PostgreSQL</productname> versions,
12271235
PTRACK required taking backups in the exclusive mode
12281236
to provide exclusive access to bitmaps with changed blocks.
1229-
To set up PTRACK backups for <productname>PostgreSQL</productname> 11
1237+
To set up PTRACK backups for <productname>PostgreSQL</productname> 10
12301238
or lower, do the following:
12311239
</para>
12321240
<orderedlist>

0 commit comments

Comments
 (0)