Ensure cleanup in case of early errors in streaming base backups

Magnus Hagander <magnus@hagander.net>

Commit: 0282dc2551e32f486b173c3104c3ecdf6d345e67
Author: Magnus Hagander <magnus@hagander.net>
Date: 2014-05-28T11:04:08Z
Releases: 9.1.14
Ensure cleanup in case of early errors in streaming base backups

Move the code that sends the initial status information as well as the
calculation of paths inside the ENSURE_ERROR_CLEANUP block. If this code
failed, we would "leak" a counter of number of concurrent backups, thereby
making the system always believe it was in backup mode. This could happen
if the sending failed (which it probably never did given that the small
amount of data to send would never cause a flush). It is very low risk, but
all operations after do_pg_start_backup should be protected.

Files

PathChange+/−
src/backend/replication/basebackup.c modified +2 −1