Ensure cleanup in case of early errors in streaming base backups
authorMagnus Hagander <magnus@hagander.net>
Wed, 28 May 2014 11:00:09 +0000 (13:00 +0200)
committerMagnus Hagander <magnus@hagander.net>
Wed, 28 May 2014 11:00:09 +0000 (13:00 +0200)
commit433cacfc0f1bf245a13df60da4bded02c5b61165
tree3ff3336328b8f71c105ebd25ce8d14a12222509f
parentb8cf89c041d0789d9353a2875a1041c77429037c
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.
src/backend/replication/basebackup.c