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

Commit6837632

Browse files
committed
Fix issues in pg_rewind with --no-ensure-shutdown/--write-recovery-conf
This fixes two issues with recent features added in pg_rewind:- --dry-run should do nothing on the target directory, but927474cforgot to consider that for --write-recovery-conf.- --no-ensure-shutdown was not actually working. There is no testcoverage for this option yet, but a subsequent patch will add that.Author: Alexey KondratovDiscussion:https://postgr.es/m/7ca88204-3e0b-2f4c-c8af-acadc4b266e5@postgrespro.ru
1 parent6f3823b commit6837632

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

‎src/bin/pg_rewind/pg_rewind.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ main(int argc, char **argv)
101101
{"write-recovery-conf",no_argument,NULL,'R'},
102102
{"source-pgdata",required_argument,NULL,1},
103103
{"source-server",required_argument,NULL,2},
104-
{"no-ensure-shutdown",no_argument,NULL,44},
104+
{"no-ensure-shutdown",no_argument,NULL,4},
105105
{"version",no_argument,NULL,'V'},
106106
{"dry-run",no_argument,NULL,'n'},
107107
{"no-sync",no_argument,NULL,'N'},
@@ -180,9 +180,11 @@ main(int argc, char **argv)
180180
case1:/* --source-pgdata */
181181
datadir_source=pg_strdup(optarg);
182182
break;
183+
183184
case2:/* --source-server */
184185
connstr_source=pg_strdup(optarg);
185186
break;
187+
186188
case4:
187189
no_ensure_shutdown= true;
188190
break;
@@ -341,7 +343,7 @@ main(int argc, char **argv)
341343
if (!rewind_needed)
342344
{
343345
pg_log_info("no rewind required");
344-
if (writerecoveryconf)
346+
if (writerecoveryconf&& !dry_run)
345347
WriteRecoveryConfig(conn,datadir_target,
346348
GenerateRecoveryConfig(conn,NULL));
347349
exit(0);
@@ -442,7 +444,7 @@ main(int argc, char **argv)
442444
pg_log_info("syncing target data directory");
443445
syncTargetDirectory();
444446

445-
if (writerecoveryconf)
447+
if (writerecoveryconf&& !dry_run)
446448
WriteRecoveryConfig(conn,datadir_target,
447449
GenerateRecoveryConfig(conn,NULL));
448450

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp