Skip to content

Commit 206cb04

Browse files
committed
Merge branch 'release_2_4' into issue_66
2 parents b696669 + df1e658 commit 206cb04

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);
@@ -545,7 +546,8 @@ db_map_entry_free(void *entry)
545546
*/
546547
void
547548
dir_list_file(parray *files, const char *root, bool exclude, bool follow_symlink,
548-
bool add_root, bool backup_logs, int external_dir_num, fio_location location)
549+
bool add_root, bool backup_logs, bool skip_hidden, int external_dir_num,
550+
fio_location location)
549551
{
550552
pgFile *file;
551553

@@ -583,7 +585,7 @@ dir_list_file(parray *files, const char *root, bool exclude, bool follow_symlink
583585
parray_append(files, file);
584586

585587
dir_list_file_internal(files, file, root, exclude, follow_symlink,
586-
external_dir_num, location);
588+
skip_hidden, external_dir_num, location);
587589

588590
if (!add_root)
589591
pgFileFree(file);
@@ -805,7 +807,7 @@ dir_check_file(pgFile *file)
805807
*/
806808
static void
807809
dir_list_file_internal(parray *files, pgFile *parent, const char *parent_dir,
808-
bool exclude, bool follow_symlink,
810+
bool exclude, bool follow_symlink, bool skip_hidden,
809811
int external_dir_num, fio_location location)
810812
{
811813
DIR *dir;
@@ -852,7 +854,7 @@ dir_list_file_internal(parray *files, pgFile *parent, const char *parent_dir,
852854
}
853855

854856
/* skip hidden files and directories */
855-
if (file->name[0] == '.')
857+
if (skip_hidden && file->name[0] == '.')
856858
{
857859
elog(WARNING, "Skip hidden file: '%s'", child);
858860
pgFileFree(file);
@@ -895,7 +897,7 @@ dir_list_file_internal(parray *files, pgFile *parent, const char *parent_dir,
895897
*/
896898
if (S_ISDIR(file->mode))
897899
dir_list_file_internal(files, file, child, exclude, follow_symlink,
898-
external_dir_num, location);
900+
skip_hidden, external_dir_num, location);
899901
}
900902

901903
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
@@ -563,9 +563,18 @@ main(int argc, char *argv[])
563563
setMyLocation();
564564
}
565565

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

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
@@ -861,7 +861,7 @@ extern const char* deparse_compress_alg(int alg);
861861
/* in dir.c */
862862
extern void dir_list_file(parray *files, const char *root, bool exclude,
863863
bool follow_symlink, bool add_root, bool backup_logs,
864-
int external_dir_num, fio_location location);
864+
bool skip_hidden, int external_dir_num, fio_location location);
865865

866866
extern void create_data_directories(parray *dest_files,
867867
const char *data_dir,
@@ -1042,7 +1042,7 @@ extern int fio_send_file(const char *from_fullpath, const char *to_fullpath, FIL
10421042
pgFile *file, char **errormsg);
10431043

10441044
extern void fio_list_dir(parray *files, const char *root, bool exclude, bool follow_symlink,
1045-
bool add_root, bool backup_logs, int external_dir_num);
1045+
bool add_root, bool backup_logs, bool skip_hidden, int external_dir_num);
10461046

10471047
extern bool pgut_rmtree(const char *path, bool rmtopdir, bool strict);
10481048

@@ -1063,6 +1063,7 @@ extern int32 fio_decompress(void* dst, void const* src, size_t size, int compres
10631063

10641064
/* Check if specified location is local for current node */
10651065
extern bool fio_is_remote(fio_location location);
1066+
extern bool fio_is_remote_simple(fio_location location);
10661067

10671068
extern void get_header_errormsg(Page page, char **errormsg);
10681069
extern void get_checksum_errormsg(Page page, char **errormsg,

0 commit comments

Comments
 (0)