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

Commit4b0f88e

Browse files
author
Michael Paquier
committed
Remove standby-site option
The documentation found on internet is rather unclear about the roleand the goal of this feature, which looks more like a kludge to coverthe fact that most of the system XLOG functions do not work on standbynodes. Now that this restriction has been removed by using the controlfile to look for the current timestamp, this feature is not needed.
1 parent308d00b commit4b0f88e

File tree

4 files changed

+2
-49
lines changed

4 files changed

+2
-49
lines changed

‎backup.c

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ static void pg_stop_backup(pgBackup *backup);
5151
staticvoidpg_switch_xlog(pgBackup*backup);
5252
staticvoidget_lsn(PGresult*res,XLogRecPtr*lsn);
5353
staticvoidget_xid(PGresult*res,uint32*xid);
54-
staticboolexecute_restartpoint(pgBackupOptionbkupopt);
5554

5655
staticvoiddelete_arclog_link(void);
5756
staticvoiddelete_online_wal_backup(void);
@@ -78,7 +77,6 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt)
7877
XLogRecPtr*lsn=NULL;
7978
charprev_file_txt[MAXPGPATH];/* path of the previous backup list file */
8079
boolhas_backup_label= true;/* flag if backup_label is there */
81-
boolhas_recovery_conf= false;/* flag if recovery.conf is there */
8280

8381
/* repack the options */
8482
boolsmooth_checkpoint=bkupopt.smooth_checkpoint;
@@ -131,30 +129,15 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt)
131129
snprintf(path,lengthof(path),"%s/recovery.conf",pgdata);
132130
make_native_path(path);
133131
if (fileExists(path)) {
134-
has_recovery_conf= true;
132+
current.is_from_standby= true;
135133
}
136-
if (!has_backup_label&& !has_recovery_conf)
134+
if (!has_backup_label&& !current.is_from_standby)
137135
{
138136
if (verbose)
139137
printf(_("backup_label does not exist, stop backup\n"));
140138
pg_stop_backup(NULL);
141139
elog(ERROR_SYSTEM,_("backup_label does not exist in PGDATA."));
142140
}
143-
elseif (has_recovery_conf)
144-
{
145-
146-
if (!bkupopt.standby_host|| !bkupopt.standby_port)
147-
{
148-
pg_stop_backup(NULL);
149-
elog(ERROR_SYSTEM,_("could not specified standby host or port."));
150-
}
151-
if (!execute_restartpoint(bkupopt))
152-
{
153-
pg_stop_backup(NULL);
154-
elog(ERROR_SYSTEM,_("could not execute restartpoint."));
155-
}
156-
current.is_from_standby= true;
157-
}
158141

159142
/*
160143
* list directories and symbolic links with the physical path to make
@@ -448,24 +431,6 @@ do_backup_database(parray *backup_list, pgBackupOption bkupopt)
448431
returnfiles;
449432
}
450433

451-
staticbool
452-
execute_restartpoint(pgBackupOptionbkupopt)
453-
{
454-
PGconn*sby_conn=NULL;
455-
constchar*tmp_host;
456-
constchar*tmp_port;
457-
tmp_host=pgut_get_host();
458-
tmp_port=pgut_get_port();
459-
pgut_set_host(bkupopt.standby_host);
460-
pgut_set_port(bkupopt.standby_port);
461-
sby_conn=reconnect_elevel(ERROR_PG_CONNECT);
462-
if (!sby_conn)
463-
return false;
464-
command("CHECKPOINT",0,NULL);
465-
pgut_set_host(tmp_host);
466-
pgut_set_port(tmp_port);
467-
return true;
468-
}
469434

470435
/*
471436
* backup archived WAL incrementally.

‎expected/option.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ Backup options:
2828
--keep-arclog-days=DAY keep archived WAL modified in DAY days
2929
--keep-srvlog-files=NUM keep NUM of serverlogs
3030
--keep-srvlog-days=DAY keep serverlog modified in DAY days
31-
--standby-host=HOSTNAME standby host when taking backup from standby
32-
--standby-port=PORT standby port when taking backup from standby
3331

3432
Restore options:
3533
--recovery-target-time time stamp up to which recovery will proceed

‎pg_rman.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ static intkeep_srvlog_files = KEEP_INFINITE;
3939
staticintkeep_srvlog_days=KEEP_INFINITE;
4040
staticintkeep_data_generations=KEEP_INFINITE;
4141
staticintkeep_data_days=KEEP_INFINITE;
42-
staticchar*standby_host=NULL;
43-
staticchar*standby_port=NULL;
4442

4543
/* restore configuration */
4644
staticchar*target_time;
@@ -73,8 +71,6 @@ static pgut_option options[] =
7371
{'b','s',"with-serverlog",&current.with_serverlog,SOURCE_ENV },
7472
{'b','Z',"compress-data",&current.compress_data,SOURCE_ENV },
7573
{'b','C',"smooth-checkpoint",&smooth_checkpoint,SOURCE_ENV },
76-
{'s',12,"standby-host",&standby_host,SOURCE_ENV },
77-
{'s',13,"standby-port",&standby_port,SOURCE_ENV },
7874
/* delete options */
7975
{'b','f',"force",&force,SOURCE_ENV },
8076
/* options with only long name (keep-xxx) */
@@ -194,8 +190,6 @@ main(int argc, char *argv[])
194190
bkupopt.keep_srvlog_days=keep_srvlog_days;
195191
bkupopt.keep_data_generations=keep_data_generations;
196192
bkupopt.keep_data_days=keep_data_days;
197-
bkupopt.standby_host=standby_host;
198-
bkupopt.standby_port=standby_port;
199193
returndo_backup(bkupopt);
200194
}
201195
elseif (pg_strcasecmp(cmd,"restore")==0){
@@ -247,8 +241,6 @@ pgut_help(bool details)
247241
printf(_(" --keep-arclog-days=DAY keep archived WAL modified in DAY days\n"));
248242
printf(_(" --keep-srvlog-files=NUM keep NUM of serverlogs\n"));
249243
printf(_(" --keep-srvlog-days=DAY keep serverlog modified in DAY days\n"));
250-
printf(_(" --standby-host=HOSTNAME standby host when taking backup from standby\n"));
251-
printf(_(" --standby-port=PORT standby port when taking backup from standby\n"));
252244
printf(_("\nRestore options:\n"));
253245
printf(_(" --recovery-target-time time stamp up to which recovery will proceed\n"));
254246
printf(_(" --recovery-target-xid transaction ID up to which recovery will proceed\n"));

‎pg_rman.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,6 @@ typedef struct pgBackupOption
169169
intkeep_srvlog_days;
170170
intkeep_data_generations;
171171
intkeep_data_days;
172-
char*standby_host;
173-
char*standby_port;
174172
}pgBackupOption;
175173

176174

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp