Skip to content

Commit 908efc3

Browse files
author
Marina Polyakova
committed
Merge remote-tracking branch 'origin/PGPRO11_DEV' into PGPRO11_PGPRO-1790
2 parents 96b4aa7 + d50a31b commit 908efc3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+5556
-1566
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
/tests/helpers/*pyc
3434

3535
# Extra files
36+
/src/pg_crc.c
3637
/src/datapagemap.c
3738
/src/datapagemap.h
3839
/src/logging.h

Makefile

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,23 @@
11
PROGRAM = pg_probackup
2-
OBJS = src/backup.o src/catalog.o src/configure.o src/data.o \
3-
src/delete.o src/dir.o src/fetch.o src/help.o src/init.o \
4-
src/pg_probackup.o src/restore.o src/show.o src/status.o \
5-
src/util.o src/validate.o src/datapagemap.o src/parsexlog.o \
6-
src/xlogreader.o src/streamutil.o src/receivelog.o \
7-
src/archive.o src/utils/parray.o src/utils/pgut.o src/utils/logger.o \
8-
src/utils/json.o src/utils/thread.o src/merge.o
92

10-
EXTRA_CLEAN = src/datapagemap.c src/datapagemap.h src/xlogreader.c \
11-
src/receivelog.c src/receivelog.h src/streamutil.c src/streamutil.h src/logging.h
3+
# utils
4+
OBJS = src/utils/json.o src/utils/logger.o src/utils/parray.o \
5+
src/utils/pgut.o src/utils/thread.o
126

13-
INCLUDES = src/datapagemap.h src/logging.h src/receivelog.h src/streamutil.h
7+
OBJS += src/archive.o src/backup.o src/catalog.o src/configure.o src/data.o \
8+
src/delete.o src/dir.o src/fetch.o src/help.o src/init.o src/merge.o \
9+
src/parsexlog.o src/pg_probackup.o src/restore.o src/show.o src/util.o \
10+
src/validate.o
11+
12+
# borrowed files
13+
OBJS += src/pg_crc.o src/datapagemap.o src/receivelog.o src/streamutil.o \
14+
src/xlogreader.o
15+
16+
EXTRA_CLEAN = src/pg_crc.c src/datapagemap.c src/datapagemap.h src/logging.h \
17+
src/receivelog.c src/receivelog.h src/streamutil.c src/streamutil.h \
18+
src/xlogreader.c
19+
20+
INCLUDES = src/datapagemap.h src/logging.h src/streamutil.h src/receivelog.h
1421

1522
ifdef USE_PGXS
1623
PG_CONFIG = pg_config
@@ -32,7 +39,7 @@ else
3239
srchome=$(top_srcdir)
3340
endif
3441

35-
ifneq (,$(filter 10 11 12,$(MAJORVERSION)))
42+
ifeq (,$(filter 9.5 9.6,$(MAJORVERSION)))
3643
OBJS += src/walmethods.o
3744
EXTRA_CLEAN += src/walmethods.c src/walmethods.h
3845
INCLUDES += src/walmethods.h
@@ -46,14 +53,14 @@ all: checksrcdir $(INCLUDES);
4653

4754
$(PROGRAM): $(OBJS)
4855

49-
src/xlogreader.c: $(top_srcdir)/src/backend/access/transam/xlogreader.c
50-
rm -f $@ && $(LN_S) $(srchome)/src/backend/access/transam/xlogreader.c $@
5156
src/datapagemap.c: $(top_srcdir)/src/bin/pg_rewind/datapagemap.c
5257
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_rewind/datapagemap.c $@
5358
src/datapagemap.h: $(top_srcdir)/src/bin/pg_rewind/datapagemap.h
5459
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_rewind/datapagemap.h $@
5560
src/logging.h: $(top_srcdir)/src/bin/pg_rewind/logging.h
5661
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_rewind/logging.h $@
62+
src/pg_crc.c: $(top_srcdir)/src/backend/utils/hash/pg_crc.c
63+
rm -f $@ && $(LN_S) $(srchome)/src/backend/utils/hash/pg_crc.c $@
5764
src/receivelog.c: $(top_srcdir)/src/bin/pg_basebackup/receivelog.c
5865
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/receivelog.c $@
5966
src/receivelog.h: $(top_srcdir)/src/bin/pg_basebackup/receivelog.h
@@ -62,9 +69,11 @@ src/streamutil.c: $(top_srcdir)/src/bin/pg_basebackup/streamutil.c
6269
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/streamutil.c $@
6370
src/streamutil.h: $(top_srcdir)/src/bin/pg_basebackup/streamutil.h
6471
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/streamutil.h $@
72+
src/xlogreader.c: $(top_srcdir)/src/backend/access/transam/xlogreader.c
73+
rm -f $@ && $(LN_S) $(srchome)/src/backend/access/transam/xlogreader.c $@
6574

6675

67-
ifneq (,$(filter 10 11 12,$(MAJORVERSION)))
76+
ifeq (,$(filter 9.5 9.6,$(MAJORVERSION)))
6877
src/walmethods.c: $(top_srcdir)/src/bin/pg_basebackup/walmethods.c
6978
rm -f $@ && $(LN_S) $(srchome)/src/bin/pg_basebackup/walmethods.c $@
7079
src/walmethods.h: $(top_srcdir)/src/bin/pg_basebackup/walmethods.h

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
`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.
44

55
The utility is compatible with:
6-
* PostgreSQL 9.5, 9.6, 10;
6+
* PostgreSQL 9.5, 9.6, 10, 11;
77

88
`PTRACK` backup support provided via following options:
99
* 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)
10-
* Postgres Pro Standard 9.5, 9.6
11-
* Postgres Pro Enterprise
10+
* Postgres Pro Standard 9.5, 9.6, 10
11+
* Postgres Pro Enterprise 9.5, 9.6, 10
1212

1313
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:
1414
* Choosing between full and page-level incremental backups to speed up backup and recovery
@@ -97,4 +97,4 @@ Postgres Professional, Moscow, Russia.
9797

9898
## Credits
9999

100-
`pg_probackup` utility is based on `pg_arman`, that was originally written by NTT and then developed and maintained by Michael Paquier.
100+
`pg_probackup` utility is based on `pg_arman`, that was originally written by NTT and then developed and maintained by Michael Paquier.

gen_probackup_project.pl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ BEGIN
77
if (@ARGV==1)
88
{
99
$pgsrc = shift @ARGV;
10-
if($pgsrc == "--help"){
10+
if($pgsrc eq "--help"){
1111
print STDERR "Usage $0 pg-source-dir \n";
1212
print STDERR "Like this: \n";
1313
print STDERR "$0 C:/PgProject/postgresql.10dev/postgrespro \n";
@@ -127,6 +127,7 @@ sub build_pgprobackup
127127
#vvs test
128128
my $probackup =
129129
$solution->AddProject('pg_probackup', 'exe', 'pg_probackup'); #, 'contrib/pg_probackup'
130+
$probackup->AddDefine('FRONTEND');
130131
$probackup->AddFiles(
131132
'contrib/pg_probackup/src',
132133
'archive.c',
@@ -139,11 +140,11 @@ sub build_pgprobackup
139140
'fetch.c',
140141
'help.c',
141142
'init.c',
143+
'merge.c',
142144
'parsexlog.c',
143145
'pg_probackup.c',
144146
'restore.c',
145147
'show.c',
146-
'status.c',
147148
'util.c',
148149
'validate.c'
149150
);
@@ -156,6 +157,7 @@ sub build_pgprobackup
156157
'thread.c'
157158
);
158159
$probackup->AddFile('src/backend/access/transam/xlogreader.c');
160+
$probackup->AddFile('src/backend/utils/hash/pg_crc.c');
159161
$probackup->AddFiles(
160162
'src/bin/pg_basebackup',
161163
'receivelog.c',

msvs/template.pg_probackup.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@
165165
</ItemDefinitionGroup>
166166
<ItemGroup>
167167
<ClCompile Include="@PGSRC@\backend\access\transam\xlogreader.c" />
168+
<ClCompile Include="@PGSRC@\backend\utils\hash\pg_crc.c" />
168169
<ClCompile Include="@PGSRC@\bin\pg_basebackup\receivelog.c" />
169170
<ClCompile Include="@PGSRC@\bin\pg_basebackup\streamutil.c" />
170171
<ClCompile Include="@PGSRC@\bin\pg_basebackup\walmethods.c" />

msvs/template.pg_probackup96.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@
165165
</ItemDefinitionGroup>
166166
<ItemGroup>
167167
<ClCompile Include="@PGSRC@\backend\access\transam\xlogreader.c" />
168+
<ClCompile Include="@PGSRC@\backend\utils\hash\pg_crc.c" />
168169
<ClCompile Include="@PGSRC@\bin\pg_basebackup\receivelog.c" />
169170
<ClCompile Include="@PGSRC@\bin\pg_basebackup\streamutil.c" />
170171
<ClCompile Include="@PGSRC@\bin\pg_rewind\datapagemap.c" />

msvs/template.pg_probackup_2.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@
160160
<!-- @PGROOT@\lib;@ADDLIBS@ @PGSRC@ @ADDINCLUDE@ -->
161161
<ItemGroup>
162162
<ClCompile Include="@PGSRC@\backend\access\transam\xlogreader.c" />
163+
<ClCompile Include="@PGSRC@\backend\utils\hash\pg_crc.c" />
163164
<ClCompile Include="@PGSRC@\bin\pg_basebackup\receivelog.c" />
164165
<ClCompile Include="@PGSRC@\bin\pg_basebackup\streamutil.c" />
165166
<ClCompile Include="@PGSRC@\bin\pg_basebackup\walmethods.c" />

src/archive.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
*
88
*-------------------------------------------------------------------------
99
*/
10+
1011
#include "pg_probackup.h"
1112

1213
#include <unistd.h>
13-
#include <sys/stat.h>
1414

1515
/*
1616
* pg_probackup specific archive command for archive backups
@@ -52,7 +52,7 @@ do_archive_push(char *wal_file_path, char *wal_file_name, bool overwrite)
5252

5353
if(system_id != config->system_identifier)
5454
elog(ERROR, "Refuse to push WAL segment %s into archive. Instance parameters mismatch."
55-
"Instance '%s' should have SYSTEM_ID = " INT64_FORMAT " instead of " INT64_FORMAT,
55+
"Instance '%s' should have SYSTEM_ID = %ld instead of %ld",
5656
wal_file_name, instance_name, config->system_identifier, system_id);
5757

5858
/* Create 'archlog_path' directory. Do nothing if it already exists. */

0 commit comments

Comments
 (0)