Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7ef2945

Browse files
committed
write only completed files to backup_content_control of running backup
1 parent66a1c64 commit7ef2945

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

‎src/backup.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ do_backup_instance(PGconn *backup_conn)
575575

576576
/* Print the list of files to backup catalog */
577577
write_backup_filelist(&current,backup_files_list,instance_config.pgdata,
578-
NULL,external_dirs);
578+
external_dirs);
579579

580580
/* clean external directories list */
581581
if (external_dirs)
@@ -1999,18 +1999,17 @@ backup_files(void *arg)
19991999
structstatbuf;
20002000
pgFile*file= (pgFile*)parray_get(arguments->files_list,i);
20012001

2002-
20032002
if (arguments->thread_num==1)
20042003
{
20052004
/* update every 10 seconds */
20062005
if ((difftime(time(NULL),prev_time))>10)
20072006
{
20082007
prev_time=time(NULL);
2009-
elog(INFO,"write_backup_filelist N=%ld, starttime %ld, time %ld",
2010-
parray_num(backup_files_list),current.start_time,prev_time);
2008+
elog(INFO,"write_backup_filelist N=%d, starttime %ld, time %ld",
2009+
n_backup_files_list,current.start_time,prev_time);
20112010

2012-
write_backup_filelist(&current,backup_files_list,instance_config.pgdata,
2013-
NULL,arguments->external_dirs);
2011+
write_backup_filelist(&current,arguments->files_list,instance_config.pgdata,
2012+
arguments->external_dirs);
20142013
}
20152014
}
20162015

@@ -2146,6 +2145,7 @@ backup_files(void *arg)
21462145
}
21472146
}
21482147

2148+
file->backuped= true;
21492149
elog(VERBOSE,"File \"%s\". Copied "INT64_FORMAT" bytes",
21502150
file->path,file->write_size);
21512151
}

‎src/catalog.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ write_backup(pgBackup *backup)
630630
*/
631631
void
632632
write_backup_filelist(pgBackup*backup,parray*files,constchar*root,
633-
constchar*external_prefix,parray*external_list)
633+
parray*external_list)
634634
{
635635
FILE*out;
636636
charpath[MAXPGPATH];
@@ -657,12 +657,15 @@ write_backup_filelist(pgBackup *backup, parray *files, const char *root,
657657
charline[BLCKSZ];
658658
intlen=0;
659659

660+
i++;
661+
if (!file->backuped)
662+
continue;
663+
660664
/* omit root directory portion */
661665
if (root&&strstr(path,root)==path)
662666
path=GetRelativePath(path,root);
663-
elseif (file->external_dir_num&&!external_prefix)
667+
elseif (file->external_dir_num&&external_list)
664668
{
665-
Assert(external_list);
666669
path=GetRelativePath(path,parray_get(external_list,
667670
file->external_dir_num-1));
668671
}
@@ -707,8 +710,6 @@ write_backup_filelist(pgBackup *backup, parray *files, const char *root,
707710
/* reset write_len */
708711
write_len=0;
709712
}
710-
711-
i++;
712713
}
713714

714715
/* write what is left in the buffer to file */

‎src/merge.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -368,8 +368,7 @@ merge_backups(pgBackup *to_backup, pgBackup *from_backup)
368368
else
369369
to_backup->wal_bytes=BYTES_INVALID;
370370

371-
write_backup_filelist(to_backup,files,from_database_path,
372-
from_external_prefix,NULL);
371+
write_backup_filelist(to_backup,files,from_database_path,NULL);
373372
write_backup(to_backup);
374373

375374
delete_source_backup:

‎src/pg_probackup.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ typedef struct pgFile
146146
datapagemap_tpagemap;/* bitmap of pages updated since previous backup */
147147
boolpagemap_isabsent;/* Used to mark files with unknown state of pagemap,
148148
* i.e. datafiles without _ptrack */
149+
150+
/* state during bakup */
151+
boolbackuped;/* is file already completely copied into destination backup? */
149152
}pgFile;
150153

151154
/* Special values of datapagemap_t bitmapsize */
@@ -555,8 +558,7 @@ extern pgBackup *catalog_get_last_data_backup(parray *backup_list,
555558
TimeLineIDtli);
556559
externvoidpgBackupWriteControl(FILE*out,pgBackup*backup);
557560
externvoidwrite_backup_filelist(pgBackup*backup,parray*files,
558-
constchar*root,constchar*external_prefix,
559-
parray*external_list);
561+
constchar*root,parray*external_list);
560562

561563
externvoidpgBackupGetPath(constpgBackup*backup,char*path,size_tlen,
562564
constchar*subdir);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp