Hi, On 3/2/18 1:03 PM, Fujii Masao wrote: > On Fri, Mar 2, 2018 at 1:07 PM, Michael Paquier <mich...@paquier.xyz> wrote: > >> We would talk about two backups running >> simultaneously on a standby, which would overlap with each other to >> generate a file aimed only at being helpful for debugging purposes, and >> we provide no information now for backups taken from standbys. We could >> of course make that logic a bit smarter by checking if there is an >> extsing file with the same name and create a new file with a different >> name. But is that worth the complication? That's where I am not >> convinced, and that's the reason why this patch is doing things this >> way. > > What about including the backup history file in the base backup instead of > creating it in the standby's pg_wal and archiving it? As the good side effect > of this approach, we can use the backup history file for debugging purpose > even when WAL archiving is not enabled.
I don't think this is a good idea, even if it does solve the race condition. First, it would be different from the way primary-style backups generate this file. Second, these files would not be excluded from future restore / backup cycles so they could build up after a while and cause confusion. I guess we could teach PG to delete them or pg_basebackup to ignore them, but that doesn't seem worth the effort. Regards, -- -David da...@pgmasters.net