27
27
//const char *progname = "pg_probackup";
28
28
29
29
/* list of files contained in backup */
30
- static parray * backup_files_list = NULL ;
30
+ parray * backup_files_list = NULL ;
31
31
32
32
/* We need critical section for datapagemap_add() in case of using threads */
33
33
static pthread_mutex_t backup_pagemap_mutex = PTHREAD_MUTEX_INITIALIZER ;
@@ -36,25 +36,7 @@ static pthread_mutex_t backup_pagemap_mutex = PTHREAD_MUTEX_INITIALIZER;
36
36
bool exclusive_backup = false;
37
37
38
38
/* Is pg_start_backup() was executed */
39
- static bool backup_in_progress = false;
40
-
41
- typedef struct PGStopBackupResult
42
- {
43
- /*
44
- * We will use values of snapshot_xid and invocation_time if there are
45
- * no transactions between start_lsn and stop_lsn.
46
- */
47
- TransactionId snapshot_xid ;
48
- time_t invocation_time ;
49
- /*
50
- * Fields that store pg_catalog.pg_stop_backup() result
51
- */
52
- XLogRecPtr lsn ;
53
- size_t backup_label_content_len ;
54
- char * backup_label_content ;
55
- size_t tablespace_map_content_len ;
56
- char * tablespace_map_content ;
57
- } PGStopBackupResult ;
39
+ bool backup_in_progress = false;
58
40
59
41
/*
60
42
* Backup routines
@@ -66,18 +48,9 @@ static void *backup_files(void *arg);
66
48
static void do_backup_pg (InstanceState * instanceState , PGconn * backup_conn ,
67
49
PGNodeInfo * nodeInfo , bool no_sync , bool backup_logs );
68
50
69
- static void pg_start_backup (const char * label , bool smooth , pgBackup * backup ,
70
- PGNodeInfo * nodeInfo , PGconn * conn );
71
51
static void pg_switch_wal (PGconn * conn );
72
- static void pg_silent_client_messages (PGconn * conn );
73
- static void pg_create_restore_point (PGconn * conn , time_t backup_start_time );
74
52
75
53
static void pg_stop_backup (InstanceState * instanceState , pgBackup * backup , PGconn * pg_startbackup_conn , PGNodeInfo * nodeInfo );
76
- static void pg_stop_backup_send (PGconn * conn , int server_version , bool is_started_on_replica , bool is_exclusive , char * * query_text );
77
-
78
- static XLogRecPtr wait_wal_lsn (const char * wal_segment_dir , XLogRecPtr lsn , bool is_start_lsn , TimeLineID tli ,
79
- bool in_prev_segment , bool segment_only ,
80
- int timeout_elevel , bool in_stream_dir );
81
54
82
55
static void check_external_for_tablespaces (parray * external_list ,
83
56
PGconn * backup_conn );
@@ -1062,7 +1035,7 @@ confirm_block_size(PGconn *conn, const char *name, int blcksz)
1062
1035
/*
1063
1036
* Notify start of backup to PostgreSQL server.
1064
1037
*/
1065
- static void
1038
+ void
1066
1039
pg_start_backup (const char * label , bool smooth , pgBackup * backup ,
1067
1040
PGNodeInfo * nodeInfo , PGconn * conn )
1068
1041
{
@@ -1297,7 +1270,7 @@ pg_is_superuser(PGconn *conn)
1297
1270
* Returns target LSN if such is found, failing that returns LSN of record prior to target LSN.
1298
1271
* Returns InvalidXLogRecPtr if 'segment_only' flag is used.
1299
1272
*/
1300
- static XLogRecPtr
1273
+ XLogRecPtr
1301
1274
wait_wal_lsn (const char * wal_segment_dir , XLogRecPtr target_lsn , bool is_start_lsn , TimeLineID tli ,
1302
1275
bool in_prev_segment , bool segment_only ,
1303
1276
int timeout_elevel , bool in_stream_dir )
@@ -1459,7 +1432,7 @@ wait_wal_lsn(const char *wal_segment_dir, XLogRecPtr target_lsn, bool is_start_l
1459
1432
}
1460
1433
1461
1434
/* Remove annoying NOTICE messages generated by backend */
1462
- static void
1435
+ void
1463
1436
pg_silent_client_messages (PGconn * conn )
1464
1437
{
1465
1438
PGresult * res ;
@@ -1468,7 +1441,7 @@ pg_silent_client_messages(PGconn *conn)
1468
1441
PQclear (res );
1469
1442
}
1470
1443
1471
- static void
1444
+ void
1472
1445
pg_create_restore_point (PGconn * conn , time_t backup_start_time )
1473
1446
{
1474
1447
PGresult * res ;
@@ -1578,7 +1551,7 @@ pg_stop_backup_send(PGconn *conn, int server_version, bool is_started_on_replica
1578
1551
* parameters:
1579
1552
* -
1580
1553
*/
1581
- static void
1554
+ void
1582
1555
pg_stop_backup_consume (PGconn * conn , int server_version ,
1583
1556
bool is_exclusive , uint32 timeout , const char * query_text ,
1584
1557
PGStopBackupResult * result )
@@ -1709,7 +1682,7 @@ pg_stop_backup_consume(PGconn *conn, int server_version,
1709
1682
/*
1710
1683
* helper routine used to write backup_label and tablespace_map in pg_stop_backup()
1711
1684
*/
1712
- static void
1685
+ void
1713
1686
pg_stop_backup_write_file_helper (const char * path , const char * filename , const char * error_msg_filename ,
1714
1687
const void * data , size_t len , parray * file_list )
1715
1688
{
0 commit comments