Skip to content

Commit df1e658

Browse files
committed
Merge branch 'master' into release_2_4
2 parents f2d2bab + 963f20f commit df1e658

File tree

13 files changed

+83
-28
lines changed

13 files changed

+83
-28
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Regardless of the chosen backup type, all backups taken with `pg_probackup` supp
5454

5555
## Current release
5656

57-
[2.3.3](https://github.com/postgrespro/pg_probackup/releases/tag/2.3.3)
57+
[2.3.4](https://github.com/postgrespro/pg_probackup/releases/tag/2.3.4)
5858

5959
## Documentation
6060

src/archive.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ setup_push_filelist(const char *archive_status_dir, const char *first_file,
944944

945945
/* get list of files from archive_status */
946946
status_files = parray_new();
947-
dir_list_file(status_files, archive_status_dir, false, false, false, false, 0, FIO_DB_HOST);
947+
dir_list_file(status_files, archive_status_dir, false, false, false, false, true, 0, FIO_DB_HOST);
948948
parray_qsort(status_files, pgFileCompareName);
949949

950950
for (i = 0; i < parray_num(status_files); i++)

src/backup.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ do_backup_instance(PGconn *backup_conn, PGNodeInfo *nodeInfo, bool no_sync, bool
333333
/* list files with the logical path. omit $PGDATA */
334334
if (fio_is_remote(FIO_DB_HOST))
335335
fio_list_dir(backup_files_list, instance_config.pgdata,
336-
true, true, false, backup_logs, 0);
336+
true, true, false, backup_logs, true, 0);
337337
else
338338
dir_list_file(backup_files_list, instance_config.pgdata,
339-
true, true, false, backup_logs, 0, FIO_LOCAL_HOST);
339+
true, true, false, backup_logs, true, 0, FIO_LOCAL_HOST);
340340

341341
/*
342342
* Get database_map (name to oid) for use in partial restore feature.
@@ -356,10 +356,10 @@ do_backup_instance(PGconn *backup_conn, PGNodeInfo *nodeInfo, bool no_sync, bool
356356
* 0 value is not external dir */
357357
if (fio_is_remote(FIO_DB_HOST))
358358
fio_list_dir(backup_files_list, parray_get(external_dirs, i),
359-
false, true, false, false, i+1);
359+
false, true, false, false, true, i+1);
360360
else
361361
dir_list_file(backup_files_list, parray_get(external_dirs, i),
362-
false, true, false, false, i+1, FIO_LOCAL_HOST);
362+
false, true, false, false, true, i+1, FIO_LOCAL_HOST);
363363
}
364364
}
365365

@@ -615,7 +615,7 @@ do_backup_instance(PGconn *backup_conn, PGNodeInfo *nodeInfo, bool no_sync, bool
615615
/* Scan backup PG_XLOG_DIR */
616616
xlog_files_list = parray_new();
617617
join_path_components(pg_xlog_path, database_path, PG_XLOG_DIR);
618-
dir_list_file(xlog_files_list, pg_xlog_path, false, true, false, false, 0,
618+
dir_list_file(xlog_files_list, pg_xlog_path, false, true, false, false, true, 0,
619619
FIO_BACKUP_HOST);
620620

621621
/* TODO: Drop streamed WAL segments greater than stop_lsn */

src/catalog.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,7 @@ catalog_get_timelines(InstanceConfig *instance)
878878

879879
/* read all xlog files that belong to this archive */
880880
sprintf(arclog_path, "%s/%s/%s", backup_path, "wal", instance->name);
881-
dir_list_file(xlog_files_list, arclog_path, false, false, false, false, 0, FIO_BACKUP_HOST);
881+
dir_list_file(xlog_files_list, arclog_path, false, false, false, false, true, 0, FIO_BACKUP_HOST);
882882
parray_qsort(xlog_files_list, pgFileCompareName);
883883

884884
timelineinfos = parray_new();

src/checkdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ do_block_validation(char *pgdata, uint32 checksum_version)
208208

209209
/* list files with the logical path. omit $PGDATA */
210210
dir_list_file(files_list, pgdata, true, true,
211-
false, false, 0, FIO_DB_HOST);
211+
false, false, true, 0, FIO_DB_HOST);
212212

213213
/*
214214
* Sort pathname ascending.

src/delete.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ delete_backup_files(pgBackup *backup)
750750

751751
/* list files to be deleted */
752752
files = parray_new();
753-
dir_list_file(files, backup->root_dir, false, false, true, false, 0, FIO_LOCAL_HOST);
753+
dir_list_file(files, backup->root_dir, false, false, true, false, false, 0, FIO_BACKUP_HOST);
754754

755755
/* delete leaf node first */
756756
parray_qsort(files, pgFileCompareRelPathWithExternalDesc);

src/dir.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,9 @@ typedef struct TablespaceCreatedList
124124
static int pgCompareString(const void *str1, const void *str2);
125125

126126
static char dir_check_file(pgFile *file);
127+
127128
static void dir_list_file_internal(parray *files, pgFile *parent, const char *parent_dir,
128-
bool exclude, bool follow_symlink,
129+
bool exclude, bool follow_symlink, bool skip_hidden,
129130
int external_dir_num, fio_location location);
130131
static void opt_path_map(ConfigOption *opt, const char *arg,
131132
TablespaceList *list, const char *type);
@@ -513,7 +514,8 @@ db_map_entry_free(void *entry)
513514
*/
514515
void
515516
dir_list_file(parray *files, const char *root, bool exclude, bool follow_symlink,
516-
bool add_root, bool backup_logs, int external_dir_num, fio_location location)
517+
bool add_root, bool backup_logs, bool skip_hidden, int external_dir_num,
518+
fio_location location)
517519
{
518520
pgFile *file;
519521

@@ -551,7 +553,7 @@ dir_list_file(parray *files, const char *root, bool exclude, bool follow_symlink
551553
parray_append(files, file);
552554

553555
dir_list_file_internal(files, file, root, exclude, follow_symlink,
554-
external_dir_num, location);
556+
skip_hidden, external_dir_num, location);
555557

556558
if (!add_root)
557559
pgFileFree(file);
@@ -773,7 +775,7 @@ dir_check_file(pgFile *file)
773775
*/
774776
static void
775777
dir_list_file_internal(parray *files, pgFile *parent, const char *parent_dir,
776-
bool exclude, bool follow_symlink,
778+
bool exclude, bool follow_symlink, bool skip_hidden,
777779
int external_dir_num, fio_location location)
778780
{
779781
DIR *dir;
@@ -820,7 +822,7 @@ dir_list_file_internal(parray *files, pgFile *parent, const char *parent_dir,
820822
}
821823

822824
/* skip hidden files and directories */
823-
if (file->name[0] == '.')
825+
if (skip_hidden && file->name[0] == '.')
824826
{
825827
elog(WARNING, "Skip hidden file: '%s'", child);
826828
pgFileFree(file);
@@ -863,7 +865,7 @@ dir_list_file_internal(parray *files, pgFile *parent, const char *parent_dir,
863865
*/
864866
if (S_ISDIR(file->mode))
865867
dir_list_file_internal(files, file, child, exclude, follow_symlink,
866-
external_dir_num, location);
868+
skip_hidden, external_dir_num, location);
867869
}
868870

869871
if (errno && errno != ENOENT)

src/merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ remove_dir_with_files(const char *path)
10621062
int i;
10631063
char full_path[MAXPGPATH];
10641064

1065-
dir_list_file(files, path, false, false, true, false, 0, FIO_LOCAL_HOST);
1065+
dir_list_file(files, path, false, false, true, false, false, 0, FIO_LOCAL_HOST);
10661066
parray_qsort(files, pgFileCompareRelPathWithExternalDesc);
10671067
for (i = 0; i < parray_num(files); i++)
10681068
{

src/pg_probackup.c

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,9 +561,18 @@ main(int argc, char *argv[])
561561
setMyLocation();
562562
}
563563

564-
/* disable logging into file for archive-push and archive-get */
565-
if (backup_subcmd == ARCHIVE_GET_CMD ||
566-
backup_subcmd == ARCHIVE_PUSH_CMD)
564+
/*
565+
* Disable logging into file for archive-push and archive-get.
566+
* Note, that we should NOT use fio_is_remote() here,
567+
* because it will launch ssh connection and we do not
568+
* want it, because it will kill archive-get prefetch
569+
* performance.
570+
*
571+
* TODO: make logging into file possible via ssh
572+
*/
573+
if (fio_is_remote_simple(FIO_BACKUP_HOST) &&
574+
(backup_subcmd == ARCHIVE_GET_CMD ||
575+
backup_subcmd == ARCHIVE_PUSH_CMD))
567576
{
568577
instance_config.logger.log_level_file = LOG_OFF;
569578
}

src/pg_probackup.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ typedef enum ShowFormat
241241
#define BYTES_INVALID (-1) /* file didn`t changed since previous backup, DELTA backup do not rely on it */
242242
#define FILE_NOT_FOUND (-2) /* file disappeared during backup */
243243
#define BLOCKNUM_INVALID (-1)
244-
#define PROGRAM_VERSION "2.3.3"
245-
#define AGENT_PROTOCOL_VERSION 20303
244+
#define PROGRAM_VERSION "2.3.4"
245+
#define AGENT_PROTOCOL_VERSION 20304
246246

247247

248248
typedef struct ConnectionOptions
@@ -860,7 +860,7 @@ extern const char* deparse_compress_alg(int alg);
860860
/* in dir.c */
861861
extern void dir_list_file(parray *files, const char *root, bool exclude,
862862
bool follow_symlink, bool add_root, bool backup_logs,
863-
int external_dir_num, fio_location location);
863+
bool skip_hidden, int external_dir_num, fio_location location);
864864

865865
extern void create_data_directories(parray *dest_files,
866866
const char *data_dir,
@@ -1036,7 +1036,7 @@ extern int fio_send_file(const char *from_fullpath, const char *to_fullpath, FIL
10361036
pgFile *file, char **errormsg);
10371037

10381038
extern void fio_list_dir(parray *files, const char *root, bool exclude, bool follow_symlink,
1039-
bool add_root, bool backup_logs, int external_dir_num);
1039+
bool add_root, bool backup_logs, bool skip_hidden, int external_dir_num);
10401040

10411041
extern bool pgut_rmtree(const char *path, bool rmtopdir, bool strict);
10421042

@@ -1052,6 +1052,7 @@ extern bool pgut_rmtree(const char *path, bool rmtopdir, bool strict);
10521052

10531053
/* Check if specified location is local for current node */
10541054
extern bool fio_is_remote(fio_location location);
1055+
extern bool fio_is_remote_simple(fio_location location);
10551056

10561057
extern void get_header_errormsg(Page page, char **errormsg);
10571058
extern void get_checksum_errormsg(Page page, char **errormsg,

0 commit comments

Comments
 (0)