Skip to content

Commit bb760c3

Browse files
committed
Merge with maste
2 parents c64fd5a + c14c5a5 commit bb760c3

Some content is hidden

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

41 files changed

+2952
-2627
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
PROGRAM = pg_probackup
22

33
# utils
4-
OBJS = src/utils/json.o src/utils/logger.o src/utils/parray.o \
5-
src/utils/pgut.o src/utils/thread.o src/utils/remote.o src/utils/file.o
4+
OBJS = src/utils/configuration.o src/utils/json.o src/utils/logger.o \
5+
src/utils/parray.o src/utils/pgut.o src/utils/thread.o src/utils/remote.o src/utils/file.o
66

77
OBJS += src/archive.o src/backup.o src/catalog.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 \

gen_probackup_project.pl

+2-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ sub build_pgprobackup
158158
'validate.c'
159159
);
160160
$probackup->AddFiles(
161-
"$currpath/src/utils",
161+
"$currpath/src/utils",
162+
'configuration.c',
162163
'json.c',
163164
'logger.c',
164165
'parray.c',

src/archive.c

+6-7
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ do_archive_push(char *wal_file_path, char *wal_file_name, bool overwrite)
2828
char absolute_wal_file_path[MAXPGPATH];
2929
char current_dir[MAXPGPATH];
3030
int64 system_id;
31-
pgBackupConfig *config;
3231
bool is_compress = false;
3332

3433
if (wal_file_name == NULL && wal_file_path == NULL)
@@ -44,16 +43,16 @@ do_archive_push(char *wal_file_path, char *wal_file_name, bool overwrite)
4443
elog(ERROR, "getcwd() error");
4544

4645
/* verify that archive-push --instance parameter is valid */
47-
config = readBackupCatalogConfigFile();
4846
system_id = get_system_identifier(current_dir);
4947

50-
if (config->pgdata == NULL)
48+
if (instance_config.pgdata == NULL)
5149
elog(ERROR, "cannot read pg_probackup.conf for this instance");
5250

53-
if(system_id != config->system_identifier)
51+
if(system_id != instance_config.system_identifier)
5452
elog(ERROR, "Refuse to push WAL segment %s into archive. Instance parameters mismatch."
5553
"Instance '%s' should have SYSTEM_ID = %ld instead of %ld",
56-
wal_file_name, instance_name, config->system_identifier, system_id);
54+
wal_file_name, instance_name, instance_config.system_identifier,
55+
system_id);
5756

5857
/* Create 'archlog_path' directory. Do nothing if it already exists. */
5958
dir_create_dir(arclog_path, DIR_PERMISSION);
@@ -63,11 +62,11 @@ do_archive_push(char *wal_file_path, char *wal_file_name, bool overwrite)
6362

6463
elog(INFO, "pg_probackup archive-push from %s to %s", absolute_wal_file_path, backup_wal_file_path);
6564

66-
if (compress_alg == PGLZ_COMPRESS)
65+
if (instance_config.compress_alg == PGLZ_COMPRESS)
6766
elog(ERROR, "pglz compression is not supported");
6867

6968
#ifdef HAVE_LIBZ
70-
if (compress_alg == ZLIB_COMPRESS)
69+
if (instance_config.compress_alg == ZLIB_COMPRESS)
7170
is_compress = IsXLogFileName(wal_file_name);
7271
#endif
7372

0 commit comments

Comments
 (0)