Обсуждение: Skip recovery/standby signal files in pg_basebackup
Hackers, Restoring these files could cause surprising behaviors so it seems best to let the restore process create them when needed. Patch is attached. -- -David david@pgmasters.net
Вложения
On Sat, Sep 28, 2019 at 3:53 AM David Steele <david@pgmasters.net> wrote: > > Hackers, > > Restoring these files could cause surprising behaviors so it seems best > to let the restore process create them when needed. It's not a normal situation where a running postgres has either recovery.signal or standby.signal but I'm +1 on this change for safety. The patch looks good to me. Regards, -- Masahiko Sawada
On Fri, Sep 27, 2019 at 02:52:54PM -0400, David Steele wrote: > Restoring these files could cause surprising behaviors so it seems best > to let the restore process create them when needed. > > Patch is attached. When taking a base backup from a standby, we have always copied recovery.conf if present, which would have triggered recovery (and a standby if standby_mode was enabled). Hence always including RECOVERY_SIGNAL_FILE would be consistent with the past behavior. Including STANDBY_SIGNAL_FILE would be consistent with checking if standby_mode was set or not in recovery.conf. We have replaced standby_mode by the standby signal file, so including it if present is consistent with the past as well, no? -- Michael
Вложения
Hi David, On Sat, Sep 28, 2019 at 12:23 AM David Steele <david@pgmasters.net> wrote: > > Hackers, > > Restoring these files could cause surprising behaviors so it seems best > to let the restore process create them when needed. > Could you please let us know what is the surprising behaviour you are talking about here when including recovery/standby signal files in pg_basebackup output. If including recovery.conf in pg_basebackup output earlier wasn't a problem then why including recovery/standby.signal should be a problem. Your patch is just trying to skip standby.signal or recovery.signal files when the base backup is either taken on standby server or it is taken on the server where the PITR is still going on or may be paused. What would be the behaviour with your patch when *-R* option is used with pg_basebackup to take backup from standby server ? Won't it create a standby.signal file. > Patch is attached. > -- With Regards, Ashutosh Sharma EnterpriseDB:http://www.enterprisedb.com