*** a/src/backend/access/transam/timeline.c
--- b/src/backend/access/transam/timeline.c
***************
*** 36,41 ****
--- 36,42 ----
  #include <unistd.h>
  
  #include "access/timeline.h"
+ #include "access/xlog.h"
  #include "access/xlog_internal.h"
  #include "access/xlogdefs.h"
  #include "storage/fd.h"
***************
*** 437,444 **** writeTimeLineHistory(TimeLineID newTLI, TimeLineID parentTLI,
  #endif
  
  	/* The history file can be archived immediately. */
! 	TLHistoryFileName(histfname, newTLI);
! 	XLogArchiveNotify(histfname);
  }
  
  /*
--- 438,448 ----
  #endif
  
  	/* The history file can be archived immediately. */
! 	if (XLogArchivingActive())
! 	{
! 		TLHistoryFileName(histfname, newTLI);
! 		XLogArchiveNotify(histfname);
! 	}
  }
  
  /*
