@@ -259,7 +259,7 @@ do_backup_pg(InstanceState *instanceState, PGconn *backup_conn,
259
259
write_backup (& current , true);
260
260
261
261
/* In PAGE mode or in ARCHIVE wal-mode wait for current segment */
262
- if (current .backup_mode == BACKUP_MODE_DIFF_PAGE || !stream_wal )
262
+ if (current .backup_mode == BACKUP_MODE_DIFF_PAGE || !current . stream )
263
263
{
264
264
/* Check that archive_dir can be reached */
265
265
if (fio_access (instanceState -> instance_wal_subdir_path , F_OK , FIO_BACKUP_HOST ) != 0 )
@@ -275,7 +275,7 @@ do_backup_pg(InstanceState *instanceState, PGconn *backup_conn,
275
275
}
276
276
277
277
/* start stream replication */
278
- if (stream_wal )
278
+ if (current . stream )
279
279
{
280
280
join_path_components (dst_backup_path , current .database_dir , PG_XLOG_DIR );
281
281
fio_mkdir (dst_backup_path , DIR_PERMISSION , FIO_BACKUP_HOST );
@@ -1076,7 +1076,7 @@ pg_start_backup(const char *label, bool smooth, pgBackup *backup,
1076
1076
1077
1077
PQclear (res );
1078
1078
1079
- if ((!stream_wal || current . backup_mode == BACKUP_MODE_DIFF_PAGE ) &&
1079
+ if ((!backup -> stream || backup -> backup_mode == BACKUP_MODE_DIFF_PAGE ) &&
1080
1080
!backup -> from_replica &&
1081
1081
!(nodeInfo -> server_version < 90600 &&
1082
1082
!nodeInfo -> is_superuser ))
@@ -1261,7 +1261,7 @@ pg_is_superuser(PGconn *conn)
1261
1261
* previous segment.
1262
1262
*
1263
1263
* Flag 'in_stream_dir' determine whether we looking for WAL in 'pg_wal' directory or
1264
- * in archive. Do note, that we cannot rely sorely on global variable 'stream_wal' because,
1264
+ * in archive. Do note, that we cannot rely sorely on global variable 'stream_wal' (current.stream) because,
1265
1265
* for example, PAGE backup must(!) look for start_lsn in archive regardless of wal_mode.
1266
1266
*
1267
1267
* 'timeout_elevel' determine the elevel for timeout elog message. If elevel lighter than
@@ -1407,7 +1407,7 @@ wait_wal_lsn(const char *wal_segment_dir, XLogRecPtr target_lsn, bool is_start_l
1407
1407
wal_delivery_str , wal_segment_path );
1408
1408
}
1409
1409
1410
- if (!stream_wal && is_start_lsn && try_count == 30 )
1410
+ if (!current . stream && is_start_lsn && try_count == 30 )
1411
1411
elog (WARNING , "By default pg_probackup assume WAL delivery method to be ARCHIVE. "
1412
1412
"If continuous archiving is not set up, use '--stream' option to make autonomous backup. "
1413
1413
"Otherwise check that continuous archiving works correctly." );
@@ -1753,15 +1753,15 @@ pg_stop_backup(InstanceState *instanceState, pgBackup *backup, PGconn *pg_startb
1753
1753
pg_create_restore_point (pg_startbackup_conn , backup -> start_time );
1754
1754
1755
1755
/* Execute pg_stop_backup using PostgreSQL connection */
1756
- pg_stop_backup_send (pg_startbackup_conn , nodeInfo -> server_version , current . from_replica , exclusive_backup , & query_text );
1756
+ pg_stop_backup_send (pg_startbackup_conn , nodeInfo -> server_version , backup -> from_replica , exclusive_backup , & query_text );
1757
1757
1758
1758
/*
1759
1759
* Wait for the result of pg_stop_backup(), but no longer than
1760
1760
* archive_timeout seconds
1761
1761
*/
1762
1762
pg_stop_backup_consume (pg_startbackup_conn , nodeInfo -> server_version , exclusive_backup , timeout , query_text , & stop_backup_result );
1763
1763
1764
- if (stream_wal )
1764
+ if (backup -> stream )
1765
1765
{
1766
1766
snprintf (stream_xlog_path , lengthof (stream_xlog_path ),
1767
1767
"%s/%s/%s/%s" , instanceState -> instance_backup_subdir_path ,
@@ -1819,7 +1819,7 @@ pg_stop_backup(InstanceState *instanceState, pgBackup *backup, PGconn *pg_startb
1819
1819
{
1820
1820
/* Wait for segment with current stop_lsn, it is ok for it to never arrive */
1821
1821
wait_wal_lsn (xlog_path , stop_backup_result .lsn , false, backup -> tli ,
1822
- false, true, WARNING , stream_wal );
1822
+ false, true, WARNING , backup -> stream );
1823
1823
1824
1824
/* Get the first record in segment with current stop_lsn */
1825
1825
lsn_tmp = get_first_record_lsn (xlog_path , segno , backup -> tli ,
@@ -1847,7 +1847,7 @@ pg_stop_backup(InstanceState *instanceState, pgBackup *backup, PGconn *pg_startb
1847
1847
* because previous record can be the contrecord.
1848
1848
*/
1849
1849
lsn_tmp = wait_wal_lsn (xlog_path , stop_backup_result .lsn , false, backup -> tli ,
1850
- true, false, ERROR , stream_wal );
1850
+ true, false, ERROR , backup -> stream );
1851
1851
1852
1852
/* sanity */
1853
1853
if (!XRecOffIsValid (lsn_tmp ) || XLogRecPtrIsInvalid (lsn_tmp ))
@@ -1861,7 +1861,7 @@ pg_stop_backup(InstanceState *instanceState, pgBackup *backup, PGconn *pg_startb
1861
1861
{
1862
1862
/* Wait for segment with current stop_lsn */
1863
1863
wait_wal_lsn (xlog_path , stop_backup_result .lsn , false, backup -> tli ,
1864
- false, true, ERROR , stream_wal );
1864
+ false, true, ERROR , backup -> stream );
1865
1865
1866
1866
/* Get the next closest record in segment with current stop_lsn */
1867
1867
lsn_tmp = get_next_record_lsn (xlog_path , segno , backup -> tli ,
@@ -1924,9 +1924,9 @@ pg_stop_backup(InstanceState *instanceState, pgBackup *backup, PGconn *pg_startb
1924
1924
*/
1925
1925
if (!stop_lsn_exists )
1926
1926
stop_backup_lsn = wait_wal_lsn (xlog_path , stop_backup_result .lsn , false, backup -> tli ,
1927
- false, false, ERROR , stream_wal );
1927
+ false, false, ERROR , backup -> stream );
1928
1928
1929
- if (stream_wal )
1929
+ if (backup -> stream )
1930
1930
{
1931
1931
/* This function will also add list of xlog files
1932
1932
* to the passed filelist */
0 commit comments