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

Commit3ac6d13

Browse files
author
Michael Paquier
committed
Remove --compress-data/-Z
Performance of compression is quite questionable on many objects likethat and makes the routines aimed at managing file copy, backup and restoremore complicated than they should be.This commit results in a largely simplified code in data.c, which willbe helpful when integrating differential backup using WAL file lookup.
1 parent49d37ec commit3ac6d13

File tree

18 files changed

+167
-673
lines changed

18 files changed

+167
-673
lines changed

‎backup.c

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ static parray*cleanup_list;
3636
*/
3737
staticvoidbackup_cleanup(boolfatal,void*userdata);
3838
staticvoidbackup_files(constchar*from_root,constchar*to_root,
39-
parray*files,parray*prev_files,constXLogRecPtr*lsn,boolcompress,constchar*prefix);
39+
parray*files,parray*prev_files,constXLogRecPtr*lsn,constchar*prefix);
4040
staticparray*do_backup_database(parray*backup_list,pgBackupOptionbkupopt);
4141
staticvoidconfirm_block_size(constchar*name,intblcksz);
4242
staticvoidpg_start_backup(constchar*label,boolsmooth,pgBackup*backup);
@@ -252,7 +252,7 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt)
252252

253253
/* backup files from non-snapshot */
254254
pgBackupGetPath(&current,path,lengthof(path),DATABASE_DIR);
255-
backup_files(pgdata,path,files,prev_files,lsn,current.compress_data,NULL);
255+
backup_files(pgdata,path,files,prev_files,lsn,NULL);
256256

257257
/* notify end of backup */
258258
pg_stop_backup(&current);
@@ -299,7 +299,7 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt)
299299
/* append DB cluster to backup file list */
300300
add_files(snapshot_files,mp, false, true);
301301
/* backup files of DB cluster from snapshot volume */
302-
backup_files(mp,path,snapshot_files,prev_files,lsn,current.compress_data,NULL);
302+
backup_files(mp,path,snapshot_files,prev_files,lsn,NULL);
303303
/* create file list of snapshot objects (DB cluster) */
304304
create_file_list(snapshot_files,mp,DATABASE_FILE_LIST,
305305
NULL, true);
@@ -331,7 +331,7 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt)
331331
/* backup files of TABLESPACE from snapshot volume */
332332
join_path_components(prefix,PG_TBLSPC_DIR,oid);
333333
join_path_components(dest,path,prefix);
334-
backup_files(mp,dest,snapshot_files,prev_files,lsn,current.compress_data,prefix);
334+
backup_files(mp,dest,snapshot_files,prev_files,lsn,prefix);
335335

336336
/* create file list of snapshot objects (TABLESPACE) */
337337
create_file_list(snapshot_files,mp,DATABASE_FILE_LIST,
@@ -375,7 +375,7 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt)
375375

376376
/* backup files */
377377
pgBackupGetPath(&current,path,lengthof(path),DATABASE_DIR);
378-
backup_files(pgdata,path,files,prev_files,lsn,current.compress_data,NULL);
378+
backup_files(pgdata,path,files,prev_files,lsn,NULL);
379379

380380
/* notify end of backup */
381381
pg_stop_backup(&current);
@@ -433,15 +433,6 @@ do_backup(pgBackupOption bkupopt)
433433
elog(ERROR_ARGS,_("Required parameter not specified: BACKUP_MODE "
434434
"(-b, --backup-mode)"));
435435

436-
#ifndefHAVE_LIBZ
437-
if (current.compress_data)
438-
{
439-
elog(WARNING,_("requested compression not available in this "
440-
"installation. Archive will not be compressed"));
441-
current.compress_data= false;
442-
}
443-
#endif
444-
445436
/* Confirm data block size and xlog block size are compatible */
446437
check_server_version();
447438

@@ -832,7 +823,6 @@ backup_files(const char *from_root,
832823
parray*files,
833824
parray*prev_files,
834825
constXLogRecPtr*lsn,
835-
boolcompress,
836826
constchar*prefix)
837827
{
838828
inti;
@@ -974,9 +964,8 @@ backup_files(const char *from_root,
974964

975965
/* copy the file into backup */
976966
if (!(file->is_datafile
977-
?backup_data_file(from_root,to_root,file,lsn,compress)
978-
:copy_file(from_root,to_root,file,
979-
compress ?COMPRESSION :NO_COMPRESSION)))
967+
?backup_data_file(from_root,to_root,file,lsn)
968+
:copy_file(from_root,to_root,file)))
980969
{
981970
/* record as skipped file in file_xxx.txt */
982971
file->write_size=BYTES_INVALID;
@@ -986,17 +975,7 @@ backup_files(const char *from_root,
986975
}
987976

988977
if (verbose)
989-
{
990-
/* print compression rate */
991-
if (file->write_size!=file->size)
992-
printf(_("compressed %lu (%.2f%% of %lu)\n"),
993-
(unsigned long)file->write_size,
994-
100.0*file->write_size /file->size,
995-
(unsigned long)file->size);
996-
else
997-
printf(_("copied %lu\n"), (unsigned long)file->write_size);
998-
}
999-
978+
printf(_("copied %lu\n"), (unsigned long)file->write_size);
1000979
}
1001980
else
1002981
{

‎catalog.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ pgBackupWriteConfigSection(FILE *out, pgBackup *backup)
300300
fprintf(out,"# configuration\n");
301301

302302
fprintf(out,"BACKUP_MODE=%s\n",modes[backup->backup_mode]);
303-
fprintf(out,"COMPRESS_DATA=%s\n",BOOL_TO_STR(backup->compress_data));
304303
}
305304

306305
/*
@@ -383,7 +382,6 @@ catalog_read_ini(const char *path)
383382
pgut_optionoptions[]=
384383
{
385384
{'s',0,"backup-mode",NULL,SOURCE_ENV },
386-
{'b',0,"compress-data",NULL,SOURCE_ENV },
387385
{'u',0,"timelineid",NULL,SOURCE_ENV },
388386
{'s',0,"start-lsn",NULL,SOURCE_ENV },
389387
{'s',0,"stop-lsn",NULL,SOURCE_ENV },
@@ -407,7 +405,6 @@ catalog_read_ini(const char *path)
407405

408406
i=0;
409407
options[i++].var=&backup_mode;
410-
options[i++].var=&backup->compress_data;
411408
options[i++].var=&backup->tli;
412409
options[i++].var=&start_lsn;
413410
options[i++].var=&stop_lsn;
@@ -550,7 +547,6 @@ void
550547
catalog_init_config(pgBackup*backup)
551548
{
552549
backup->backup_mode=BACKUP_MODE_INVALID;
553-
backup->compress_data= false;
554550
backup->status=BACKUP_STATUS_INVALID;
555551
backup->tli=0;
556552
backup->start_lsn=0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp