Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita13a23f

Browse files
committed
Merge branch 'release_2_5-pgpro-5018' into release_2_5-pgpro-4850
2 parents2f843a7 +ac2e7cc commita13a23f

23 files changed

+1263
-1035
lines changed

‎src/archive.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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
*/
115115
void
116-
do_archive_push(InstanceConfig*instance,char*wal_file_path,
116+
do_archive_push(InstanceState*instanceState,InstanceConfig*instance,char*wal_file_path,
117117
char*wal_file_name,intbatch_size,booloverwrite,
118118
boolno_sync,boolno_ready_rename)
119119
{
@@ -156,7 +156,7 @@ do_archive_push(InstanceConfig *instance, char *wal_file_path,
156156
if (system_id!=instance->system_identifier)
157157
elog(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

161161
if (instance->compress_alg==PGLZ_COMPRESS)
162162
elog(ERROR,"Cannot use pglz for WAL compression");
@@ -165,7 +165,7 @@ do_archive_push(InstanceConfig *instance, char *wal_file_path,
165165
join_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
#ifdefHAVE_LIBZ
171171
if (instance->compress_alg==ZLIB_COMPRESS)
@@ -206,7 +206,7 @@ do_archive_push(InstanceConfig *instance, char *wal_file_path,
206206
WALSegno*xlogfile= (WALSegno*)parray_get(batch_files,i);
207207

208208
rc=push_file(xlogfile,archive_status_dir,
209-
pg_xlog_dir,instance->arclog_path,
209+
pg_xlog_dir,instanceState->instance_wal_subdir_path,
210210
overwrite,no_sync,
211211
instance->archive_timeout,
212212
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,
231231
archive_push_arg*arg=&(threads_args[i]);
232232

233233
arg->first_filename=wal_file_name;
234-
arg->archive_dir=instance->arclog_path;
234+
arg->archive_dir=instanceState->instance_wal_subdir_path;
235235
arg->pg_xlog_dir=pg_xlog_dir;
236236
arg->archive_status_dir=archive_status_dir;
237237
arg->overwrite=overwrite;
@@ -1008,7 +1008,7 @@ setup_push_filelist(const char *archive_status_dir, const char *first_file,
10081008
10091009
*/
10101010
void
1011-
do_archive_get(InstanceConfig*instance,constchar*prefetch_dir_arg,
1011+
do_archive_get(InstanceState*instanceState,InstanceConfig*instance,constchar*prefetch_dir_arg,
10121012
char*wal_file_path,char*wal_file_name,intbatch_size,
10131013
boolvalidate_wal)
10141014
{
@@ -1046,8 +1046,8 @@ do_archive_get(InstanceConfig *instance, const char *prefetch_dir_arg,
10461046
join_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

10521052
INSTR_TIME_SET_CURRENT(start_time);
10531053
if (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
*/
11001100
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,
11021102
tli,segno,num_threads, false,batch_size,
11031103
instance->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,
11411141
tli,segno,num_threads, true,batch_size,
11421142
instance->xlog_seg_size);
11431143

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp