Skip to content

Commit 6f3823b

Browse files
committed
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
1 parent 8e10405 commit 6f3823b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/pg_rewind/pg_rewind.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,8 @@ main(int argc, char **argv)
435435
ControlFile_new.minRecoveryPoint = endrec;
436436
ControlFile_new.minRecoveryPointTLI = endtli;
437437
ControlFile_new.state = DB_IN_ARCHIVE_RECOVERY;
438-
update_controlfile(datadir_target, &ControlFile_new, do_sync);
438+
if (!dry_run)
439+
update_controlfile(datadir_target, &ControlFile_new, do_sync);
439440

440441
if (showprogress)
441442
pg_log_info("syncing target data directory");

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy