Skip to content

Commit e1edfa4

Browse files
committed
Added warnings for -j and --batch-size setted while --wal-file-path defined by user
1 parent 4e66821 commit e1edfa4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

Diff for: src/archive.c

+11-1
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,15 @@ do_archive_push(InstanceConfig *instance, char *wal_file_path,
164164
char backup_wal_file_path[MAXPGPATH];
165165
char absolute_wal_file_path[MAXPGPATH];
166166

167-
join_path_components(absolute_wal_file_path, current_dir, wal_file_path);
167+
join_path_components(absolute_wal_file_path, wal_file_path, wal_file_name);
168168
join_path_components(backup_wal_file_path, instance->arclog_path, wal_file_name);
169169

170170
elog(INFO, "wal_file_path is setted by user %s", wal_file_path);
171+
172+
if ((batch_size > 1)||(num_threads > 1))
173+
elog(WARNING, "Options -j and --batch-size are ignored "
174+
"with --wal-file-path setted by user");
175+
171176
if (instance->compress_alg == PGLZ_COMPRESS)
172177
elog(ERROR, "pglz compression is not supported");
173178

@@ -959,6 +964,9 @@ push_wal_file(const char *from_path, const char *to_path, bool is_compress,
959964
#endif
960965
to_path_p = to_path;
961966

967+
// elog(INFO, "from_path %s", from_path);
968+
// Assert(0);
969+
962970
/* open file for read */
963971
in = fio_fopen(from_path, PG_BINARY_R, FIO_DB_HOST);
964972
if (in == NULL)
@@ -1066,6 +1074,8 @@ push_wal_file(const char *from_path, const char *to_path, bool is_compress,
10661074

10671075
read_len = fio_fread(in, buf, sizeof(buf));
10681076

1077+
// Assert(0);
1078+
10691079
if (read_len < 0)
10701080
{
10711081
errno_temp = errno;

0 commit comments

Comments
 (0)