Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8d3b389

Browse files
committed
Improve comments and logs in do_pg_stop/start_backup
The function name pg_stop_backup() has been included for ages in some log messages when stopping the backup, which is confusing for base backups taken with the replication protocol because this function is never called. Some other comments and messages in this area are improved while on it. The new wording is based on input and suggestions from several people, all listed below. Author: Michael Paquier Reviewed-by: Peter Eisentraut, Álvaro Herrera, Tom Lane Discussion: https://postgr.es/m/20181221040510.GA12599@paquier.xyz
1 parent aa019da commit 8d3b389

File tree

1 file changed

+12
-9
lines changed
  • src/backend/access/transam

1 file changed

+12
-9
lines changed

src/backend/access/transam/xlog.c

+12-9
Original file line numberDiff line numberDiff line change
@@ -10170,9 +10170,10 @@ XLogFileNameP(TimeLineID tli, XLogSegNo segno)
1017010170
}
1017110171

1017210172
/*
10173-
* do_pg_start_backup is the workhorse of the user-visible pg_start_backup()
10174-
* function. It creates the necessary starting checkpoint and constructs the
10175-
* backup label file.
10173+
* do_pg_start_backup
10174+
*
10175+
* Utility function called at the start of an online backup. It creates the
10176+
* necessary starting checkpoint and constructs the backup label file.
1017610177
*
1017710178
* There are two kind of backups: exclusive and non-exclusive. An exclusive
1017810179
* backup is started with pg_start_backup(), and there can be only one active
@@ -10712,8 +10713,10 @@ get_backup_status(void)
1071210713
}
1071310714

1071410715
/*
10715-
* do_pg_stop_backup is the workhorse of the user-visible pg_stop_backup()
10716-
* function.
10716+
* do_pg_stop_backup
10717+
*
10718+
* Utility function called at the end of an online backup. It cleans up the
10719+
* backup state and can optionally wait for WAL segments to be archived.
1071710720
*
1071810721
* If labelfile is NULL, this stops an exclusive backup. Otherwise this stops
1071910722
* the non-exclusive backup specified by 'labelfile'.
@@ -11084,7 +11087,7 @@ do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
1108411087
if (!reported_waiting && waits > 5)
1108511088
{
1108611089
ereport(NOTICE,
11087-
(errmsg("pg_stop_backup cleanup done, waiting for required WAL segments to be archived")));
11090+
(errmsg("base backup done, waiting for required WAL segments to be archived")));
1108811091
reported_waiting = true;
1108911092
}
1109011093

@@ -11094,16 +11097,16 @@ do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
1109411097
{
1109511098
seconds_before_warning *= 2; /* This wraps in >10 years... */
1109611099
ereport(WARNING,
11097-
(errmsg("pg_stop_backup still waiting for all required WAL segments to be archived (%d seconds elapsed)",
11100+
(errmsg("still waiting for all required WAL segments to be archived (%d seconds elapsed)",
1109811101
waits),
1109911102
errhint("Check that your archive_command is executing properly. "
11100-
"pg_stop_backup can be canceled safely, "
11103+
"You can safely cancel this backup, "
1110111104
"but the database backup will not be usable without all the WAL segments.")));
1110211105
}
1110311106
}
1110411107

1110511108
ereport(NOTICE,
11106-
(errmsg("pg_stop_backup complete, all required WAL segments have been archived")));
11109+
(errmsg("all required WAL segments have been archived")));
1110711110
}
1110811111
else if (waitforarchive)
1110911112
ereport(NOTICE,

0 commit comments

Comments
 (0)