@@ -1237,17 +1237,12 @@ wait_wal_lsn(const char *wal_segment_dir, XLogRecPtr target_lsn, bool is_start_l
1237
1237
int timeout_elevel , bool in_stream_dir )
1238
1238
{
1239
1239
XLogSegNo targetSegNo ;
1240
- char wal_segment_path [MAXPGPATH ],
1241
- // wal_segment_subdir[MAXPGPATH], // used only to check file existence, not actual parsing
1240
+ char wal_segment_path [MAXPGPATH ], /* used only for reporting */
1242
1241
wal_segment [MAXFNAMELEN ];
1243
1242
uint32 try_count = 0 ,
1244
1243
timeout ;
1245
1244
char * wal_delivery_str = in_stream_dir ? "streamed" :"archived" ;
1246
1245
1247
- //#ifdef HAVE_LIBZ
1248
- // char gz_wal_segment_path[MAXPGPATH];
1249
- //#endif
1250
-
1251
1246
/* Compute the name of the WAL file containing requested LSN */
1252
1247
GetXLogSegNo (target_lsn , targetSegNo , instance_config .xlog_seg_size );
1253
1248
if (in_prev_segment )
@@ -1256,12 +1251,15 @@ wait_wal_lsn(const char *wal_segment_dir, XLogRecPtr target_lsn, bool is_start_l
1256
1251
instance_config .xlog_seg_size );
1257
1252
1258
1253
// 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
+ char wal_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
+
1265
1263
/*
1266
1264
* In pg_start_backup we wait for 'target_lsn' in 'pg_wal' directory if it is
1267
1265
* 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
1282
1280
elog (LOG , "Looking for LSN %X/%X in segment: %s" ,
1283
1281
(uint32 ) (target_lsn >> 32 ), (uint32 ) target_lsn , wal_segment );
1284
1282
1285
- //#ifdef HAVE_LIBZ
1286
- // snprintf(gz_wal_segment_path, sizeof(gz_wal_segment_path), "%s.gz",
1287
- // wal_segment_path);
1288
- //#endif
1289
-
1290
1283
/* Wait until target LSN is archived or streamed */
1291
1284
while (true)
1292
1285
{
0 commit comments