diff --git a/src/bin/pg_rewind/pg_rewind.c b/src/bin/pg_rewind/pg_rewind.c index d3ae767..6effd29 100644 --- a/src/bin/pg_rewind/pg_rewind.c +++ b/src/bin/pg_rewind/pg_rewind.c @@ -256,6 +256,9 @@ main(int argc, char **argv) exit(0); } + if (dry_run) + printf(_("Running in dry-run mode. Nothing would be changed.\n")); + findLastCheckpoint(datadir_target, divergerec, lastcommontli, &chkptrec, &chkpttli, &chkptredo); printf(_("Rewinding from last common checkpoint at %X/%X on timeline %u\n"), @@ -306,6 +309,9 @@ main(int argc, char **argv) /* * This is the point of no return. Once we start copying things, we have * modified the target directory and there is no turning back! + * + * NOTE: If --dry-run option is given, nothing would be changed. See + * dry_run checks in file_ops.c. */ executeFileMap(); @@ -340,7 +346,8 @@ main(int argc, char **argv) ControlFile_new.state = DB_IN_ARCHIVE_RECOVERY; updateControlFile(&ControlFile_new); - printf(_("Done!\n")); + if (!dry_run) + printf(_("Done!\n")); return 0; } @@ -462,6 +469,9 @@ findCommonAncestorTimeline(XLogRecPtr *recptr, TimeLineID *tli) /* * Create a backup_label file that forces recovery to begin at the last common * checkpoint. + * + * Note, that nothing would be changed if --dry-run option is given since + * open_target_file and other functions from file_ops.c checks dry_run. */ static void createBackupLabel(XLogRecPtr startpoint, TimeLineID starttli, XLogRecPtr checkpointloc) @@ -538,6 +548,9 @@ digestControlFile(ControlFileData *ControlFile, char *src, size_t size) /* * Update the target's control file. + * + * Note, that nothing would be changed if --dry-run option is given since + * open_target_file and other functions from file_ops.c checks dry_run. */ static void updateControlFile(ControlFileData *ControlFile)