@@ -113,7 +113,7 @@ static parray *setup_push_filelist(const char *archive_status_dir,
113
113
* Where archlog_path is $BACKUP_PATH/wal/instance_name
114
114
*/
115
115
void
116
- do_archive_push (InstanceConfig * instance , char * wal_file_path ,
116
+ do_archive_push (InstanceState * instanceState , InstanceConfig * instance , char * wal_file_path ,
117
117
char * wal_file_name , int batch_size , bool overwrite ,
118
118
bool no_sync , bool no_ready_rename )
119
119
{
@@ -156,7 +156,7 @@ do_archive_push(InstanceConfig *instance, char *wal_file_path,
156
156
if (system_id != instance -> system_identifier )
157
157
elog (ERROR , "Refuse to push WAL segment %s into archive. Instance parameters mismatch."
158
158
"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 );
160
160
161
161
if (instance -> compress_alg == PGLZ_COMPRESS )
162
162
elog (ERROR , "Cannot use pglz for WAL compression" );
@@ -165,7 +165,7 @@ do_archive_push(InstanceConfig *instance, char *wal_file_path,
165
165
join_path_components (archive_status_dir , pg_xlog_dir , "archive_status" );
166
166
167
167
/* 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);
169
169
170
170
#ifdef HAVE_LIBZ
171
171
if (instance -> compress_alg == ZLIB_COMPRESS )
@@ -206,7 +206,7 @@ do_archive_push(InstanceConfig *instance, char *wal_file_path,
206
206
WALSegno * xlogfile = (WALSegno * ) parray_get (batch_files , i );
207
207
208
208
rc = push_file (xlogfile , archive_status_dir ,
209
- pg_xlog_dir , instance -> arclog_path ,
209
+ pg_xlog_dir , instanceState -> instance_wal_subdir_path ,
210
210
overwrite , no_sync ,
211
211
instance -> archive_timeout ,
212
212
no_ready_rename || (strcmp (xlogfile -> name , wal_file_name ) == 0 ) ? true : false,
@@ -231,7 +231,7 @@ do_archive_push(InstanceConfig *instance, char *wal_file_path,
231
231
archive_push_arg * arg = & (threads_args [i ]);
232
232
233
233
arg -> first_filename = wal_file_name ;
234
- arg -> archive_dir = instance -> arclog_path ;
234
+ arg -> archive_dir = instanceState -> instance_wal_subdir_path ;
235
235
arg -> pg_xlog_dir = pg_xlog_dir ;
236
236
arg -> archive_status_dir = archive_status_dir ;
237
237
arg -> overwrite = overwrite ;
@@ -1008,7 +1008,7 @@ setup_push_filelist(const char *archive_status_dir, const char *first_file,
1008
1008
1009
1009
*/
1010
1010
void
1011
- do_archive_get (InstanceConfig * instance , const char * prefetch_dir_arg ,
1011
+ do_archive_get (InstanceState * instanceState , InstanceConfig * instance , const char * prefetch_dir_arg ,
1012
1012
char * wal_file_path , char * wal_file_name , int batch_size ,
1013
1013
bool validate_wal )
1014
1014
{
@@ -1046,8 +1046,8 @@ do_archive_get(InstanceConfig *instance, const char *prefetch_dir_arg,
1046
1046
join_path_components (absolute_wal_file_path , current_dir , wal_file_path );
1047
1047
1048
1048
/* 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 );
1051
1051
1052
1052
INSTR_TIME_SET_CURRENT (start_time );
1053
1053
if (num_threads > batch_size )
@@ -1098,7 +1098,7 @@ do_archive_get(InstanceConfig *instance, const char *prefetch_dir_arg,
1098
1098
* copy requested file directly from archive.
1099
1099
*/
1100
1100
if (!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 ,
1102
1102
tli , segno , num_threads , false, batch_size ,
1103
1103
instance -> xlog_seg_size );
1104
1104
@@ -1137,7 +1137,7 @@ do_archive_get(InstanceConfig *instance, const char *prefetch_dir_arg,
1137
1137
// rmtree(prefetch_dir, false);
1138
1138
1139
1139
/* 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 ,
1141
1141
tli , segno , num_threads , true, batch_size ,
1142
1142
instance -> xlog_seg_size );
1143
1143
0 commit comments