@@ -47,7 +47,7 @@ static void backup_cleanup(bool fatal, void *userdata);
4747
4848static void * backup_files (void * arg );
4949
50- static void do_backup_instance (PGconn * backup_conn , PGNodeInfo * nodeInfo , bool no_sync , bool backup_logs );
50+ static void do_backup_pg (PGconn * backup_conn , PGNodeInfo * nodeInfo , bool no_sync , bool backup_logs );
5151
5252static void pg_start_backup (const char * label , bool smooth , pgBackup * backup ,
5353 PGNodeInfo * nodeInfo , PGconn * conn );
@@ -92,7 +92,7 @@ backup_stopbackup_callback(bool fatal, void *userdata)
9292 * Move files from 'pgdata' to a subdirectory in backup catalog.
9393 */
9494static void
95- do_backup_instance (PGconn * backup_conn , PGNodeInfo * nodeInfo , bool no_sync , bool backup_logs )
95+ do_backup_pg (PGconn * backup_conn , PGNodeInfo * nodeInfo , bool no_sync , bool backup_logs )
9696{
9797 int i ;
9898 char external_prefix [MAXPGPATH ]; /* Temp value. Used as template */
@@ -724,7 +724,7 @@ pgdata_basic_setup(ConnectionOptions conn_opt, PGNodeInfo *nodeInfo)
724724 * Entry point of pg_probackup BACKUP subcommand.
725725 */
726726int
727- do_backup (pgSetBackupParams * set_backup_params ,
727+ do_backup (InstanceState * instanceState , pgSetBackupParams * set_backup_params ,
728728 bool no_validate , bool no_sync , bool backup_logs )
729729{
730730 PGconn * backup_conn = NULL ;
@@ -740,7 +740,7 @@ do_backup(pgSetBackupParams *set_backup_params,
740740 current .external_dir_str = instance_config .external_dir_str ;
741741
742742 /* Create backup directory and BACKUP_CONTROL_FILE */
743- pgBackupCreateDir (& current , backup_instance_path );
743+ pgBackupCreateDir (& current , instanceState -> instance_backup_subdir_path );
744744
745745 if (!instance_config .pgdata )
746746 elog (ERROR , "required parameter not specified: PGDATA "
@@ -758,7 +758,7 @@ do_backup(pgSetBackupParams *set_backup_params,
758758
759759 elog (INFO , "Backup start, pg_probackup version: %s, instance: %s, backup ID: %s, backup mode: %s, "
760760 "wal mode: %s, remote: %s, compress-algorithm: %s, compress-level: %i" ,
761- PROGRAM_VERSION , instance_name , base36enc (current .backup_id ), pgBackupGetBackupMode (& current , false),
761+ PROGRAM_VERSION , instanceState -> instance_name , base36enc (current .backup_id ), pgBackupGetBackupMode (& current , false),
762762 current .stream ? "STREAM" : "ARCHIVE" , IsSshProtocol () ? "true" : "false" ,
763763 deparse_compress_alg (current .compress_alg ), current .compress_level );
764764
@@ -824,7 +824,7 @@ do_backup(pgSetBackupParams *set_backup_params,
824824 add_note (& current , set_backup_params -> note );
825825
826826 /* backup data */
827- do_backup_instance (backup_conn , & nodeInfo , no_sync , backup_logs );
827+ do_backup_pg (backup_conn , & nodeInfo , no_sync , backup_logs );
828828 pgut_atexit_pop (backup_cleanup , NULL );
829829
830830 /* compute size of wal files of this backup stored in the archive */
@@ -879,7 +879,7 @@ do_backup(pgSetBackupParams *set_backup_params,
879879 * which are expired according to retention policies
880880 */
881881 if (delete_expired || merge_expired || delete_wal )
882- do_retention ();
882+ do_retention (instanceState );
883883
884884 return 0 ;
885885}
0 commit comments