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

Commit3f2e29d

Browse files
committed
minor fix
1 parenta9f0460 commit3f2e29d

File tree

2 files changed

+14
-20
lines changed

2 files changed

+14
-20
lines changed

‎src/backup.c

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,17 +1237,12 @@ wait_wal_lsn(const char *wal_segment_dir, XLogRecPtr target_lsn, bool is_start_l
12371237
inttimeout_elevel,boolin_stream_dir)
12381238
{
12391239
XLogSegNotargetSegNo;
1240-
charwal_segment_path[MAXPGPATH],
1241-
//wal_segment_subdir[MAXPGPATH], // used only to check file existence, not actual parsing
1240+
charwal_segment_path[MAXPGPATH],/* used only for reporting */
12421241
wal_segment[MAXFNAMELEN];
12431242
uint32try_count=0,
12441243
timeout;
12451244
char*wal_delivery_str=in_stream_dir ?"streamed":"archived";
12461245

1247-
//#ifdef HAVE_LIBZ
1248-
//chargz_wal_segment_path[MAXPGPATH];
1249-
//#endif
1250-
12511246
/* Compute the name of the WAL file containing requested LSN */
12521247
GetXLogSegNo(target_lsn,targetSegNo,instance_config.xlog_seg_size);
12531248
if (in_prev_segment)
@@ -1256,12 +1251,15 @@ wait_wal_lsn(const char *wal_segment_dir, XLogRecPtr target_lsn, bool is_start_l
12561251
instance_config.xlog_seg_size);
12571252

12581253
// obtain WAL archive subdir for ARCHIVE backup
1259-
//if (in_stream_dir)
1260-
//strcpy(wal_segment_subdir, wal_segment_dir);
1261-
//else
1262-
//get_archive_subdir(wal_segment_subdir, wal_segment_dir, wal_segment, SEGMENT);
1263-
//
1264-
//join_path_components(wal_segment_path, wal_segment_subdir, wal_segment);
1254+
if (in_stream_dir)
1255+
join_path_components(wal_segment_path,wal_segment_dir,wal_segment);
1256+
else
1257+
{
1258+
charwal_segment_subdir[MAXPGPATH];
1259+
get_archive_subdir(wal_segment_subdir,wal_segment_dir,wal_segment,SEGMENT);
1260+
join_path_components(wal_segment_path,wal_segment_subdir,wal_segment);
1261+
}
1262+
12651263
/*
12661264
* In pg_start_backup we wait for 'target_lsn' in 'pg_wal' directory if it is
12671265
* stream and non-page backup. Page backup needs archived WAL files, so we
@@ -1282,11 +1280,6 @@ wait_wal_lsn(const char *wal_segment_dir, XLogRecPtr target_lsn, bool is_start_l
12821280
elog(LOG,"Looking for LSN %X/%X in segment: %s",
12831281
(uint32) (target_lsn >>32), (uint32)target_lsn,wal_segment);
12841282

1285-
//#ifdef HAVE_LIBZ
1286-
//snprintf(gz_wal_segment_path, sizeof(gz_wal_segment_path), "%s.gz",
1287-
// wal_segment_path);
1288-
//#endif
1289-
12901283
/* Wait until target LSN is archived or streamed */
12911284
while (true)
12921285
{

‎src/parsexlog.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2051,7 +2051,8 @@ static XLogReaderState* WalReaderAllocate(uint32 wal_seg_size, XLogReaderData *r
20512051

20522052
/*
20532053
* Is WAL file exists in archive directory
2054-
* first check subdirectory, then fallback to archive directory
2054+
* for stream backup check uncompressed segment in wal_root_dir
2055+
* for archive backup first check subdirectory, then fallback to archive directory
20552056
*/
20562057
boolIsWalFileExists(constchar*wal_segment_name,constchar*wal_root_dir,boolin_stream_dir)
20572058
{
@@ -2098,11 +2099,11 @@ bool IsWalFileExists(const char *wal_segment_name, const char *wal_root_dir, boo
20982099
gotonot_found;
20992100

21002101
found_compressed_file:
2101-
elog(LOG,"Found WAL segment: %s",wal_file_fullpath);
2102+
elog(LOG,"FoundcompressedWAL segment: %s",wal_file_fullpath);
21022103
return true;
21032104

21042105
found_uncompressed_file:
2105-
elog(LOG,"FoundcompressedWAL segment: %s",wal_file_fullpath_gz);
2106+
elog(LOG,"Found WAL segment: %s",wal_file_fullpath_gz);
21062107
return true;
21072108

21082109
not_found:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp