@@ -745,24 +745,26 @@ do_catchup_instance(const char *source_pgdata, const char *dest_pgdata, PGconn *
745
745
746
746
wait_wal_and_calculate_stop_lsn (dest_xlog_path , stop_backup_result .lsn , & current );
747
747
748
- /* Write backup_label and tablespace_map */
749
- Assert (stop_backup_result .backup_label_content != NULL );
750
-
751
748
/* Write backup_label */
749
+ Assert (stop_backup_result .backup_label_content != NULL );
752
750
pg_stop_backup_write_file_helper (dest_pgdata , PG_BACKUP_LABEL_FILE , "backup label" ,
753
751
stop_backup_result .backup_label_content , stop_backup_result .backup_label_content_len ,
754
752
NULL );
755
753
free (stop_backup_result .backup_label_content );
756
754
stop_backup_result .backup_label_content = NULL ;
757
755
stop_backup_result .backup_label_content_len = 0 ;
758
756
759
- /* Write tablespace_map */
757
+ /* tablespace_map */
760
758
if (stop_backup_result .tablespace_map_content != NULL )
761
759
{
762
760
// TODO what if tablespace is created during catchup?
763
- pg_stop_backup_write_file_helper (dest_pgdata , PG_TABLESPACE_MAP_FILE , "tablespace map" ,
764
- stop_backup_result .tablespace_map_content , stop_backup_result .tablespace_map_content_len ,
765
- NULL );
761
+ /* Because we have already created symlinks in pg_tblspc earlier,
762
+ * we do not need to write the tablespace_map file.
763
+ * So this call is unnecessary:
764
+ * pg_stop_backup_write_file_helper(dest_pgdata, PG_TABLESPACE_MAP_FILE, "tablespace map",
765
+ * stop_backup_result.tablespace_map_content, stop_backup_result.tablespace_map_content_len,
766
+ * NULL);
767
+ */
766
768
free (stop_backup_result .tablespace_map_content );
767
769
stop_backup_result .tablespace_map_content = NULL ;
768
770
stop_backup_result .tablespace_map_content_len = 0 ;
0 commit comments