@@ -113,7 +113,7 @@ static parray *setup_push_filelist(const char *archive_status_dir,
113113 * Where archlog_path is $BACKUP_PATH/wal/instance_name
114114 */
115115void
116- do_archive_push (InstanceConfig * instance ,char * wal_file_path ,
116+ do_archive_push (InstanceState * instanceState , InstanceConfig * instance ,char * wal_file_path ,
117117char * wal_file_name ,int batch_size ,bool overwrite ,
118118bool no_sync ,bool no_ready_rename )
119119{
@@ -156,7 +156,7 @@ do_archive_push(InstanceConfig *instance, char *wal_file_path,
156156if (system_id != instance -> system_identifier )
157157elog (ERROR ,"Refuse to push WAL segment %s into archive. Instance parameters mismatch."
158158"Instance '%s' should have SYSTEM_ID = " UINT64_FORMAT " instead of " UINT64_FORMAT ,
159- wal_file_name ,instance -> name ,instance -> system_identifier ,system_id );
159+ wal_file_name ,instanceState -> instance_name ,instance -> system_identifier ,system_id );
160160
161161if (instance -> compress_alg == PGLZ_COMPRESS )
162162elog (ERROR ,"Cannot use pglz for WAL compression" );
@@ -165,7 +165,7 @@ do_archive_push(InstanceConfig *instance, char *wal_file_path,
165165join_path_components (archive_status_dir ,pg_xlog_dir ,"archive_status" );
166166
167167/* Create 'archlog_path' directory. Do nothing if it already exists. */
168- //fio_mkdir(instance->arclog_path , DIR_PERMISSION, FIO_BACKUP_HOST);
168+ //fio_mkdir(instanceState->instance_wal_subdir_path , DIR_PERMISSION, FIO_BACKUP_HOST);
169169
170170#ifdef HAVE_LIBZ
171171if (instance -> compress_alg == ZLIB_COMPRESS )
@@ -206,7 +206,7 @@ do_archive_push(InstanceConfig *instance, char *wal_file_path,
206206WALSegno * xlogfile = (WALSegno * )parray_get (batch_files ,i );
207207
208208rc = push_file (xlogfile ,archive_status_dir ,
209- pg_xlog_dir ,instance -> arclog_path ,
209+ pg_xlog_dir ,instanceState -> instance_wal_subdir_path ,
210210overwrite ,no_sync ,
211211instance -> archive_timeout ,
212212no_ready_rename || (strcmp (xlogfile -> name ,wal_file_name )== 0 ) ? true : false,
@@ -231,7 +231,7 @@ do_archive_push(InstanceConfig *instance, char *wal_file_path,
231231archive_push_arg * arg = & (threads_args [i ]);
232232
233233arg -> first_filename = wal_file_name ;
234- arg -> archive_dir = instance -> arclog_path ;
234+ arg -> archive_dir = instanceState -> instance_wal_subdir_path ;
235235arg -> pg_xlog_dir = pg_xlog_dir ;
236236arg -> archive_status_dir = archive_status_dir ;
237237arg -> overwrite = overwrite ;
@@ -1008,7 +1008,7 @@ setup_push_filelist(const char *archive_status_dir, const char *first_file,
10081008
10091009 */
10101010void
1011- do_archive_get (InstanceConfig * instance ,const char * prefetch_dir_arg ,
1011+ do_archive_get (InstanceState * instanceState , InstanceConfig * instance ,const char * prefetch_dir_arg ,
10121012char * wal_file_path ,char * wal_file_name ,int batch_size ,
10131013bool validate_wal )
10141014{
@@ -1046,8 +1046,8 @@ do_archive_get(InstanceConfig *instance, const char *prefetch_dir_arg,
10461046join_path_components (absolute_wal_file_path ,current_dir ,wal_file_path );
10471047
10481048/* full filepath to WAL file in archive directory.
1049- *backup_path /wal/instance_name/000000010000000000000001 */
1050- join_path_components (backup_wal_file_path ,instance -> arclog_path ,wal_file_name );
1049+ *$BACKUP_PATH /wal/instance_name/000000010000000000000001 */
1050+ join_path_components (backup_wal_file_path ,instanceState -> instance_wal_subdir_path ,wal_file_name );
10511051
10521052INSTR_TIME_SET_CURRENT (start_time );
10531053if (num_threads > batch_size )
@@ -1098,7 +1098,7 @@ do_archive_get(InstanceConfig *instance, const char *prefetch_dir_arg,
10981098 * copy requested file directly from archive.
10991099 */
11001100if (!next_wal_segment_exists (tli ,segno ,prefetch_dir ,instance -> xlog_seg_size ))
1101- n_fetched = run_wal_prefetch (prefetch_dir ,instance -> arclog_path ,
1101+ n_fetched = run_wal_prefetch (prefetch_dir ,instanceState -> instance_wal_subdir_path ,
11021102tli ,segno ,num_threads , false,batch_size ,
11031103instance -> xlog_seg_size );
11041104
@@ -1137,7 +1137,7 @@ do_archive_get(InstanceConfig *instance, const char *prefetch_dir_arg,
11371137//rmtree(prefetch_dir, false);
11381138
11391139/* prefetch files */
1140- n_fetched = run_wal_prefetch (prefetch_dir ,instance -> arclog_path ,
1140+ n_fetched = run_wal_prefetch (prefetch_dir ,instanceState -> instance_wal_subdir_path ,
11411141tli ,segno ,num_threads , true,batch_size ,
11421142instance -> xlog_seg_size );
11431143