On Tue, 26 Jun 2018 20:19:42 +0900 (Tokyo Standard Time)
Kyotaro HORIGUCHI <horiguchi.kyot...@lab.ntt.co.jp> wrote:

> Hello.
> 
> Good catch!
> 
> At Tue, 26 Jun 2018 17:47:52 +0900, Yugo Nagata <nag...@sraoss.co.jp> wrote 
> in <20180626174752.0ce505e3.nag...@sraoss.co.jp>
> > Hi,
> > 
> > While looking into the backup and recovery code, I found small 
> > documentation bugs. 
> > The documatation says that the backup history files can be requested for 
> > recovery, 
> > but it's not used by the system and not requested anymore since PG 9.0 
> > (commit 06f82b29616cd9effcaefd99c6b6e2e80697482f) and never be requested.
> > 
> > Attached patch (doc_backup_history_file.patch) corrects the description 
> > about this.
> > 
> > In addition, the current pg_standby still can handle a backup history file 
> > that are
> > never requested. It is harmless but unnecessary code. Another attached patch
> > (pg_standby.patch) removes this part of code.
> 
> The comment fix seems fine and they seem to be all occurances of
> the word ".backup" in the context of recovery_command.
> 
> The definition of the symbol XLOG_BACKUP_LABEL is no longer
> useful after your patch applied. Removing the symbol makes
> XLOG_DATA and the variable nextWALFileName useless and finally we
> can remove all branching using it.

Thank you for your reviewing my patch.

I've also removed XLOG_BACKUP_LABEL, but I left nextWALFileName
since this is still referred in CustomizableCleanupPriorWALFiles().

Attached is the updated patch.

Regards,

> 
> regards.
> 
> -- 
> Kyotaro Horiguchi
> NTT Open Source Software Center
> 
> 


-- 
Yugo Nagata <nag...@sraoss.co.jp>
diff --git a/contrib/pg_standby/pg_standby.c b/contrib/pg_standby/pg_standby.c
index cb78597..b37cf6d 100644
--- a/contrib/pg_standby/pg_standby.c
+++ b/contrib/pg_standby/pg_standby.c
@@ -94,7 +94,6 @@ int			restoreCommandType;
 
 #define XLOG_DATA			 0
 #define XLOG_HISTORY		 1
-#define XLOG_BACKUP_LABEL	 2
 int			nextWALFileType;
 
 #define SET_RESTORE_COMMAND(cmd, arg1, arg2) \
@@ -211,15 +210,9 @@ CustomizableNextWALFileReady(void)
 		}
 
 		/*
-		 * If it's a backup file, return immediately. If it's a regular file
 		 * return only if it's the right size already.
 		 */
-		if (IsBackupHistoryFileName(nextWALFileName))
-		{
-			nextWALFileType = XLOG_BACKUP_LABEL;
-			return true;
-		}
-		else if (WalSegSz > 0 && stat_buf.st_size == WalSegSz)
+		if (WalSegSz > 0 && stat_buf.st_size == WalSegSz)
 		{
 #ifdef WIN32
 

Reply via email to