diff options
author | Michael Paquier <michael@paquier.xyz> | 2019-10-04 09:14:51 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2019-10-04 09:14:51 +0900 |
commit | 6f3823b03560589157d9dbdab623f603ef393d7c (patch) | |
tree | 755593a6a5160fb0fbab96abea465e99298b6b2a | |
parent | 8e10405c745003c5c16acb2da847db9bed1a169e (diff) |
Fix --dry-run mode of pg_rewind
Even if --dry-run mode was specified, the control file was getting
updated, preventing follow-up runs of pg_rewind to work properly on the
target data folder. The origin of the problem came from the refactoring
done by ce6afc6.
Author: Alexey Kondratov
Discussion: https://postgr.es/m/7ca88204-3e0b-2f4c-c8af-acadc4b266e5@postgrespro.ru
Backpatch-through: 12
-rw-r--r-- | src/bin/pg_rewind/pg_rewind.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/pg_rewind/pg_rewind.c b/src/bin/pg_rewind/pg_rewind.c index a7fd9e0cabe..2eb18a92c62 100644 --- a/src/bin/pg_rewind/pg_rewind.c +++ b/src/bin/pg_rewind/pg_rewind.c @@ -435,7 +435,8 @@ main(int argc, char **argv) ControlFile_new.minRecoveryPoint = endrec; ControlFile_new.minRecoveryPointTLI = endtli; ControlFile_new.state = DB_IN_ARCHIVE_RECOVERY; - update_controlfile(datadir_target, &ControlFile_new, do_sync); + if (!dry_run) + update_controlfile(datadir_target, &ControlFile_new, do_sync); if (showprogress) pg_log_info("syncing target data directory"); |